0% found this document useful (0 votes)
136 views

Psuc

This document appears to be an exam for a problem solving using computers course. It contains 6 questions asking students to: 1) Define an operating system, C++ data types, and distinguish between assembly and high-level languages. 2) Draw a flowchart, do numeric conversions between bases, and write a program to count prime digits. 3) Explain selection sort, write programs using while and do-while loops, and explain looping structures. 4) Write string handling programs and compare structures and unions. 5) Explain value and reference parameter passing and write recursive functions. 6) Discuss software life cycles, define a class, and illustrate macros.

Uploaded by

Ipshita Ranjana
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
136 views

Psuc

This document appears to be an exam for a problem solving using computers course. It contains 6 questions asking students to: 1) Define an operating system, C++ data types, and distinguish between assembly and high-level languages. 2) Draw a flowchart, do numeric conversions between bases, and write a program to count prime digits. 3) Explain selection sort, write programs using while and do-while loops, and explain looping structures. 4) Write string handling programs and compare structures and unions. 5) Explain value and reference parameter passing and write recursive functions. 6) Discuss software life cycles, define a class, and illustrate macros.

Uploaded by

Ipshita Ranjana
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Reg. No.

MANIPAL INSTITUTE OF TECHNOLOGY (Constituent Institute of Manipal University)


MANIPAL-576104 FIRST SEMESTER B.E DEGREE END SEMESTER EXAMINATION NOV/DEC 2011 SUBJECT: PROBLEM SOLVING USING COMPUTERS (CSE-101) Date: 08-12-2011 TIME: 3 HOURS MAX. MARKS: 50

INSTRUCTIONS TO CANDIDATES ANSWER ANY FIVE FULL QUESTIONS.

1. A) What is an operating system? Give an example. B) Explain the basic built-in data types in C++? Give an example for each.

(2 marks) (4 marks)

C) Distinguish between Assembly level and High level language (any four points) (2 marks) D) What will be the output for each of the following expressions? i) -25/3 %2 ii) (5/3) * 3 + 5 % 3 iii) -14 % 4 iv) (5/2.0 == 0.0 && 10/2.0!=0.0) || -6<0.0 (2 marks) (4 marks) (2 marks)

2. A) Draw a flowchart to find the largest of three given numbers. B) Convert the following, with all steps shown clearly i) 31.687510 to Binary ii) 10111.001112 to Decimal iii) 7038 to Hexadecimal iv) 43110 to Octal

C) Write a C++ program to count the prime digits in a given number. 3. A) Illustrate the steps involved in selection sort with a suitable example.

(4 marks) (2 marks)

B) Illustrate the usage of while loop and do-while loop by writing a C++ program to find the product of N natural numbers. (4 marks)

C) Explain entry-controlled and exit-controlled looping structures by clearly showing the flow of control. (4 marks)

4. A) Write a C++ program to (i) enter a string through the keyboard (ii) count the number of Uppercase letters (iii) replace the vowels present in the string with a character X (eg: if the entered string is UnIveRSItY, output should be XnXvXRSXtY). Do not use any string handling functions B) Compare and contrast structure and union.
(CSE-101)

(3 marks) (2 marks)
Page 1 of 2

C) What is the output of the following error free program segment


#include<iostream.h> void main( ){ int array[ ]={99,88,77,66,44,22}; int *ptr1,*ptr2; ptr1=array; ptr2=ptr1++; *ptr2=*ptr1+2; (*ptr1)++; cout<<array[0]<< <<array[5]<< <<array[1]<< <<array[2]; }

(2 marks)

D) Write a C++ program to i) Accept the elements into an integer matrix A of order m x m ii) Print UPPER triangular matrix e.g.: 1 4 7 2 5 8 3 6 9 2 UPPER triangular matrix is 3 6

(3 marks)

5. A) Explain the following parameter passing techniques in functions with example for each i) Pass-by-value ii) Pass-by-reference (4 marks) (3 marks)

B) Write a C++ program to do the following tasks i) Read a number in the main program. ii) Write a function to reverse the number. [without using an array] C) Write a recursive function to compute the nth Fibonacci number.

(3 marks)

6. A) Requirement analysis and specification is mandatory in Software Life Cycle models, YES or NO. Justify the statement with points supporting your answer. (2 marks)

B) Define a class student to represent student details with member variables studName, studRoll, studMarks [total marks of all subjects]. The member function getInfo( ) reads the details of each student and dispInfo( ) displays the details. Create 2 objects to enter details of 2 students and display the entered details. C) Give the output for the following error free program
#include<iostream.h> void main() { func(); func(); } void func() { int x = 0; static int y = 0; x++; y++; cout<<"\n"<< x<< y ; }

(4 marks) (2 marks)

D) Illustrate macros with a suitable example.

(2 marks)

(CSE-101)

Page 2 of 2

You might also like