CS201 Mid Term Solved Paper
-
Cs201 current paper 14_12_2019 8:30am Q no.1 Convert the following while loop into a for loop Int I=1; While(i<=h) { Couti*I; I++; } Q no.2 Given below is the code segment of a file handling program. What is the purpose of the condition given in the while loop While(! Infile.eof()) { Infile>> name>>sal>>dept; Cout name"\ t" saal"\ t" dept endl; } Q no.3 Write a function definition which takes three arguments: retail price, sales taxes, incom tax and returns the net price of a book. Note: the net price of the book can be calculated by the formula Net price= retail price + sales tax + incom tax Q no.4 Write a program which defines two string " Hello" and "Pakistan", merges both the strings using manipulation function and display on the screen. Q no.5 What will be the output from the following program? #include<iostream> #include<conio.h> Int main ( ) { for int i=1; i<6;i++ If( i%2==0) Couti+1endl; else Coutiendl; System("pause"); }
-
Total questions 1 to 23
1 to 19 only MCqs (mostly from previous papers)
2 shorts (one and two dimentonal array , file data on disk)
2 programs ( interger from user and display product with formula , and 1 long program kilogram weight ponds like this) -
Cs201 15/12 4pm
program(marks 3): make a 2d array of 3x3
2nd question(marks 3) find the mistakes in following
If(num%2==o);
Cout"the number is even";
else()
Cout"the number is odd";
3rd question(marks 5) define the function of following
outfile.open
4rth question(marks 5) find the perimeter of a circle by taking value of radius from user. You just have to declare 2 variables peri and radius and formula is
Perimeter of circle=23.14radius
5th question(marks 5) make a program which converts the weight in kgs to pounds by defining function…
Mcqs were easy if u read handouts just 2 or 3 mcqs came from past papers… But it was easy. -
-