Skip to content
VUBuddy

CS301 Midterm Past Paper Fall 2004 Set 2

Data Structures PDF 26 KBUpdated 23 Oct 2026
Midterm past paper CS301 Midterm Past Paper Fall 2004 Set 2 PDF 26 KB
vubuddy.com
Type
Midterm past paper
Course
CS301 Data Structures
Size
PDF 26 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 26 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2, 3 of 3. Download the file for all 3 pages.

CS201 Introduction to Programming · Mid Term Examination - November 2004 · Time Allowed: 90 Minutes

make an appropriate assumption and use it to solve the problem.

d. All coding questions should be answered using the C ++ syntax. You are allowed to use the Dev-C++ compiler to write and test your code. If you do so please remember to copy and paste your code into the examination solution area.

(Do NOT share your code; your colleague could get higher marks than you!!)

**WARNING: Please note that Virtual University takes serious note of

unfair means. Anyone found involved in cheating will get an `F` grade in

this course.

Total Questions: 11

Q1. Marks : 2

If a program is producing incorrect results on execution, it means there is a:

Syntax error Logical error Problem with computer Compiler error Linker error

Q2. Marks : 8

Write a program that asks the user to enter two numbers, obtains the two numbers from the user, and prints the sum, product, difference, quotient and modulus of the two numbers.

Q3. Marks : 2

In a structure we have

Variables of one type of data only Only integers native data types and can not have pointers Variables of different data types Only pointers

Q4. Marks : 2

A computer program:

writes a document in word processor is a plan for a picnic is a precise sequence of steps to solve a particular problem is written in C language only always appears on the screen

Q5. Marks : 2

Which one is the correct declaration for a pointer myptr to an integer?

int pointer myptr; int myptr; *int myptr; int * myptr; int* yourptr, myptr;

Q6. Marks : 6

What is a pointer? What is call by value and call by reference? Briefly explain with examples.

Q7. Marks : 2

fstream, ifstream and ofstream open a file with:

open () read () get () seekg () seekp ()

Q8. Marks : 6

Write a function that shows max of 3 numbers entered by user?

Q9. Marks : 2

The body of for loop

Executes at least once Executes zero or more times Can not be executed more than100 times Consists one and only one statement Can not execute infinitely

Q10. Marks : 14

The Super Cheap Computer Company sells its product, the Super-Cheap-PC, for Rs.490.00. In addition, they sell disk drives for Rs.200.00, printers for Rs.75.00 and software packages for Rs.50.00 each. If the customer's total bill would be above Rs.850.00 then the customer gets a 15% discount. Write a program that prompts the salesperson to enter quantity of each item the customer wants to purchase and then outputs a bill. The complete interactive I/O should appear as below: Please enter the following info:

Number of PCs: Number of Disk Drives: Number of Printers: Number of Software Packages:

The Super Cheap Computer Company Item Quantity Price Cost PC 1 490.00 490.00 Disk Drive 2 200.00 400.00 Printer 1 75.00 75.00 Software 4 50.00 200.00 Total (15% discount if above 850) 990.25

Also write the bill details (cost of each Item and total bill) in a text file called "BillDetail.txt".

All CS301 files →
CS301 Data Structures All CS301 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.