Course Code | MCS-011 |
Course Title | Problem Solving and Programming |
Assignment Number | BCA(2)/011/Assignment/2019-20 |
Maximum Marks | 100 |
Weightage | 25% |
Last Dates for Submission | 15th October 2019 (For July 2019 Session) 15th April 2020 (For January 2020 Session) |
There are seven questions in this assignment, which carry 80 marks. Rest 20 marks are for viva-voce. Answer all the questions. You may use illustrations and diagrams to enhance the explanations. Please go through the guidelines regarding assignments given in the Programme Guide for the format of presentation. Insert comments in the code for better understanding.
Q1. Write the following functions that: (2 ½ X 4 =10)
a) Request the user for two integers and outputs them and their sum.
b) Request the user for two integers and outputs their remainder after division.
c) Request the user for two floats and outputs their product.
d) Request the user for a word and prints it twice on the same row.
Write a C (main) program to provide the above functions as options to the user using a switch statement and performs the functions accordingly.
Q2. Write an algorithm, draw a corresponding flowchart and write an interactive program to convert a binary number to its decimal equivalent. (20)
Q3. Write the following functions that: (2 ½ X 4 =10)
a) Request the user to input a 5 digit number and reverse the given number and print it.
b) Request the user to input two floats and outputs the largest of the inputs.
c) Request the user to input an integer and, if the number is divisible by two, divides it by two, otherwise multiplies it by three and output the result.
d) Request the user for three integers and output whether any of them are equal. Use only one if-else-statement
Write a C (main) program to provide the above functions as options to the user using a switch statement and perform the functions accordingly.
Q4. Write a program which reads characters from a string and calculates the number of vowels in it. It should print the string and the number of vowels in it. (10)
Q5. Following is the Taylor-series expansion for sin(x): (10)
sin(x)=x-x3/3!+x5/5!-x7/7!+……
Write a program that reads a value of x and calculates sin(x) using the first 10 terms only and prints out the result.
Q6. Using structures, write an interactive C program to generate Grade Card for BCA first semester courses for 20 students of your study centre. (10)
Note: Follow the evaluation criteria given in your programme guide.
Q7. Write a C program: (5 + 5 =10)
(a) To generate 10 random numbers between -1.5 and 1.5 and writes them in a file ran.dat.
(b) To read the data from the file ran.dat (created above) and computes the average of the data. It also finds the number of data above the average value.