Sunteți pe pagina 1din 9

Mehran University Of Engineering and Technology Introduction to Computer and C++ PROGRAMMING

Time Allowed:03 Hours 1st Term 1st Year for B.E(Civil) 07-Batch Under External System Max Marks:80
NOTE: ATTEMPT FIVE QUESTIONS. ALL QUESTIONS CARRY EQUAL MARKS

Q#1: Define Computer and its importance in our daily life? Discuss its all components with the help of Diagram. Q#2: Write Short note on any three of folloimwing: (i) IO Devices (ii) EDP (iii) WINDOWS OS (iv) Desktop of Windows Q#3: (A) Write a C++ statement for the following: i) Read three numbers from Keyboard and stores their sum in the Variable X. ii) Print X = : followed by the value of product of X and Y iii) Test the Values of the Variable count is greater then 10. if it is Print Count is greater then 10. iv) Initialize the variable sum to zero . Add variable to variable sum and assign the results to the variable sum. (B) Write the C++ statement for i) w= x5+sin( x2+y2) ii) x=-b+b2-4ac/2a iii)log (x + y ) - | Sinx | iv) x+ y + xy Q#4: Differentiate the following with suitable examples. i) Iostream.h and Constream.h Header Files ii) Arithmetic and Relational Operators iii) While and do-while Loops iv) Break and Continue Statement Q#5: (A) Define different loop statement used in c++ with their syntax and flowchart with examples. (B) Write a C++ program to display the table of any number entered by user and asks for an other table. Q#6: Differentiate between Ordinary variable and an array variable. Where a C++ program using arrays to arrange 10 random number into ascending order Q#7: (A) What is prototype functioning? Discuss the advantages of prototyping. Write a c++ program to find the maximum of three numbers entered from keyboard using functions. (B) Write a C++ program to find the value of ex for x=1.5 from its series 1+x+x2/2!+x3/3!... Q#8: (A) Write a c++ program in text mode to generate a window a print your message in the center of the window color background and colored text. (B) Write a c++ program to draw colorful nested circles in the center of the screen using Graphic mode.

Mehran University Of Engineering and Technology Introduction to Computer and C++ PROGRAMMING
Time Allowed:03 Hours 1st Term 1st Year for B.E(Civil) 05-Batch Under External System Max Marks:80
NOTE: ATTEMPT FIVE QUESTIONS. ALL QUESTIONS CARRY EQUAL MARKS

Q#1(A): What is Computer? Describe the function of various components of a computer system. Q#1(B): Classify the Computer according to size. Q#1: (C) Write a C++ statement for the following: (i) Read three numbers from Keyboard store them in the variables x, y and z. Print their Sum as a variable sum. (ii) Initialize the variable sum to zero . Add variable X from 1 to 10 in the variable sum and assign the result to the variable sum. Q#2: Write a Program that reads a name of a student and marks of five subjects. Display the aggregate grade as follow: Grade A: if marks are 80 or above. Grade B: if marks are lies between 60-79 Grade C: if marks are 50-59 Grade D: if marks are 40-49 Grade F: Below 40. Q#3: Explain with the following with suitable examples. (i) Preprocessor Directors. (ii) Data Types used in C++. (iii)Different operates used in C++. (iv) Variable Declaration and Initialization of Variables. Q#4: Discuss different control statements used in C++. Write a Program to find the sum of positive odd integers and the product of even integers less or equal to 100. Q#5(A): Define an array. How much array can be declared and initialized? Q#5(B): Write a Program to find the maximum number from a one dimensional array. Q#6(A): Differentiate between predefined and used defined function? What is function declaration, function call and function definition . Write a Program to demonstrate the function overloading. Q#6(B): Write a C++ Program to find the roots of Quadratic Equations. Q#7(A): Explain the idea of structures of C++? What is structure tag? Give the syntax of structure. Write a C++ program that uses a structure to store four different resistor values for a series circuit. Compute the total resistance of the circuit by adding the individual vales together. Q#7(B): Explain Pointers with Examples.

Q#8: Do as Directed. (a) Find the error. If any in the following code correct it and find the output Main( ) { clrscr ( ) Int array[26]: For (i=0, j<=10, j++){ Array[i]A+I; Cout<<Array[i]; } Getch; } (b) if int i=8 , j=5; float x=0.005, y=0.01 . what will the possible output of . 1. (i-3*j) % (x-y) 2. I * (j/x)

(c) What will be output where R is your roll number Void main ( ) { Int x=5, max=R, min; If( x>=max) { max=x; cout<<max;} Else { min=x;cout<<min}

Mehran University Of Engineering and Technology C++ PROGRAMMING Practical Examination


Time Allowed:03 Hours 2nd Term 2nd Year for B.E(Civil) 04-Batch. Max Marks:80
NOTE: ATTEMPT ALL QUESTIONS. ALL QUESTIONS CARRY EQUAL MARKS

Q#1: True or False ? (i) Concept of using computer was started from 1000 B.C. (ii) The biggest milestone in the achievement of mankind has been the discovery of number. (iii) Conversion of data into a useful shape is called data processing (iv) Header file iostream.h is used for clrscr( ) function. (v) && operator assign Right Value to Left Value. (vi) A variable of type char can hold 2 bytes in the memory. (vii) Two variables cant be declared in one statement. (viii) Two default case required in the switch selection structure is necessary. (ix) Function rand ( ) is used to produce random numbers. (x) A pointer is a structure lap. Q#2: Fill in the Blanks? 1. ** 2. A program that controls and handle operations and required applications is called as _____________ 3. The expression 16%3 evaluates to ________________ 4. ____________ works as an interface between user and computer. 5. The closing brace of _____________ is followed by Semi colon. 6. The Declaration and initialization of a variable at single step is referred as ______________ 7. _______________ are operations used with the insertion operation to modify or manipulate the way data displayed. 8. The key word void is used to indicate a function _____________ a value. 9. The number used to refer to a particular value of an array is called as _________________. 10. __________________ is a character type array. Q#3: Find the correct answer. 1. The _______ program transfers the executable image of C++ programs froom disk to memory Compiler Loader Linker

2. A functions single most important role is to ____________ Give name to block of code Reduce program size Help organize a program in a conceptual units 3. The getche ( ) library function is _____________________ Does not return a character when any key is passed. Display a character. Does not return a character when Enter key is to pressed. 4. A Pointer is _________________ Variable of storing address. None of the above. The address of the variable. 5. The unsigned float occupies ___________ times as many bytes of memory of type char. 2 times 4 times 8 times Q#4: Do as Directed: 1. How many time the loop will execute. For( int i=1; i<=100; i+10) 2. Find the error if any correct. Double cube( float num) ; { num * num * num; } 3. What will be the output of Int x=2, y; While ( y < 10 ) X+=y; 4. Write a c++ statement for a) z=X2 + tan ( U 2 + V2 ) ezy b) Log ( x+y) - | sin x |

Mehran University Of Engineering and Technology


DATA PROCESSING & C++ PROGRAMMING
Time Allowed:03 Hours 2ND Term 4th Year for B.E(Civil) 2001 to 99-Batchs Max Marks:80
NOTE: ATTEMPT FIVE QUESTIONS. ALL QUESTIONS CARRY EQUAL MARKS

Q#1: Write Short note on any 4 of following: (i) System Software & Application Software (ii) Components of C.P.U (iii) Floppy Disk (iv) Hardware and Software (v) DOS and Windows (vi) ROM and RAM Q#2: (i)What is computer? Discuss the classifications of computers according to types and sizes. (ii) What is the difference between External and internal DOS commands ? Also write down any eight external and internal DOS commands with Syntax and Purpose. Q#3(A): Remove the error and correct the following C++ program and write the output. ## include ( conio.h )
main [ ] inte cont = 1, total 0. Clscr( ); While ( cout <6 ) { total+=count; cout>>count=>>count>>/t total= total>>/n; count } getch [ ];

Q#3(B): Write a table program in C++ language . Use do while loop. Q#4: Write down the syntax & purpose of the following in C++ language by providing an example. (i) compound if statement (ii) For statement (iii) while & do while statement (iv) Structure statement (v) else statement. Q#5(a) What is the difference b/w Local and Global variables. User-define function and Predefine function? Also write an Age Program which read the current date and your birth date then calculate your total age ( Maintain the user-define function). (b) Write a program that reads a grade A,B,C,D or F and their point Excellent, Good , Fair , Poor , fail . Use switch statement. Q#6(a): Write a C++ program using multidimensional arrays to add the elements of 3x3 Matrix A with 3x3 Matrix B and store the result in Matrix C. Q#6(b): Write a program in c++ to draw a set of ten circles centered at (3,40) with radii from 11 to 20. Q#7(a) Write a program to read the Bio Data of your class fellow , which include name, fathers name , ID number, discipline and Age , Main the Structure body. Q#7(b) Write a program to calculate the power . Use the Overloading function ( Maintain the class ) Q#8(a) Define pointers. Also write a program for finding cube of a variable using call by reference with a pointer agreement. Q#8(b) Explain the following pre-defined functions with syntax, header file and its application. (i) Break (ii) Continue (iii) Getche( ) (iv) clrscr ( ) (v) exit ( )

Mehran University Of Engineering and Technology


INTRODUNCTION TO COMPUTER & C++ PROGRAMMING
Time Allowed:03 Hours 2ND Term 4th Year for B.E(Civil) 2002-Batchs Max Marks:80
NOTE: ATTEMPT FIVE QUESTIONS. ALL QUESTIONS CARRY EQUAL MARKS

Q#1: Write Short note on any 4 of following: (i) System Software & Application Software (ii) Storage Devices (iii)Data Processing. Q#2: Describe any eight of the following briefly? (i) Desktop (ii) Task bar (iii) Recycle Bin (Iv) Ms Paint (v) Mouse operations (vi) Creating Shortcuts (vii) Files and Folders (viii) Internet tools (ix) Ms WordPad (x) Windows Accessories. Q# 3(a) What are the data types used in C++. Describe each in detail. Write a basic structure of a simple C++ program? Write five commonly used escape sequence. Q#3 (b) What are the operators used in C++? Define in detail and also describes the precedence of the operators ? Q#4: (a) Write a program that calculates the addition , subtraction , multiplications , division and remainder of two real numbers entered by user? Q#4: (b) Write a program that converts the temperature from Centigrade to Farhenheit. (c) write a program using if-else statement which displays TEXTILE if condition is true and INDUSTRIAL if condition is false. Also draw its flow chart. Q#5 (a) what are loops and decision making statements used in C++. Define each with the help of flow charts. (b) Write a program that displays the table of number entered by user and ask for the next table. c) Write a program that displays output in the following format? 1 2 3 4 5 6 7 8 9 10 2 4 6 8 10 1 14 16 18 20 Q#6(a) Differentiate between 2 ordinary variable and array variable. 3 6 9 12 15 1 21 24 27 30 Write a program that multiplies two 8 matrices A and B of order 3X3 and 4 8 12 16 20 2 28 32 36 40 points its output? 4 (b)Define pointers? What is an 5 10 15 20 25 3 35 40 45 50 structure? Write a program using 0 structure to displays digital clock at the center of screen? Q#7(a) Define user defined function. What is overloading in C++ using overloading in functions, write a program to calculate the power of number. ( assuming there is no built in function of power) both base and exponent may of any data type entered by user. (b) write a program that computes the Sin and Cos of any Value. Q#8(a) write a program that displays the colorful 200 nested circles at the center of the screen. (b) what are the basis features of OOP? Write a program that maintain the bank account of any account holder.

Mehran University Of Engineering and Technology Introduction to Computer and C++ PROGRAMMING
Time Allowed:03 Hours 1st Term 1st Year for B.E(Civil) 07-Batch Under External System Max Marks:80
NOTE: ATTEMPT FIVE QUESTIONS. ALL QUESTIONS CARRY EQUAL MARKS

Q#1: (a) Write Short note on any three of following: (i) The roll of the computers in the development of modern world. (ii) History of computers (iii) Advantages and Disadvantages of Internet. (iv) Data Types Used in C++. Q#1(b) Discuss any three of the following: i) Desktop ii) ROM and RAM iii) Task Bar iv) Byte and Word v)Buffers Q#2: Do as Directed: i) How many times the loop will execute For (int i=0; i<=-20; i-3) ii)find the error if any and correct a. if (e<7); cout <<c is less than \n; b. for (y=0.1 ; y!=1.0; y+=0.1) cout <<y<<endl; iii) Whether the following a valid identifier, if not why ? a. Cos_in_$ b. 20thBirthday C. _BSRS (B) Write the C++ statement for i) Z= x3+tan ( x2+y2) ii) x=-b+b2-4ac/2a iii)log (x + y ) - | Sinx | iv) Initialize the variable sum to zero. Add variable x to Variable sum and Assign the result to the variable sum. v)Print The product is : followed by the value of the variable result (C) What will be the output of the following program : #include < iostream.h> #include<conio.h> Int main( ) { for (int x=1; x<=10; x++) { If ( X==5) continue; cout <<x;} return 0; getche ( ) ; } Q#3: (A) Define Looping . What are the different looping structures used in C++? Explain with syntax and flowchart. (B) Write a C++ program to display the table of any number entered by user and asks for an other table. Q#4: Discuss the different decision statement inC++? Write a program code for class average of 10 students in five different subjects. Print Grade A if the average is greater then 75 grade B if the average is greater than 60, grade C if the average is greater than 50, grade D if the average is greater than 40 else FAIL. Q#5: Differentiate the following with suitable examples. (i) Preprocessor Directives (ii) Arithmetic and Logical Operaters (iii) Array and a Structure

(iv)Protype functioning and its advantages Q#6: Define User Defined functions and Overloading . Write a C++ program to calculate the power of any number assuming that no built in function for power exist, where both base and exponent are of any data type entered by user. Q#7: (A) Differentiate between ordinary variable and array variable . Write a program that arranges 10 random number entered by user in ascending or descending order.
(B) Write a program in C++ to calculate the multiplication of two matrices of order 3X3 Q#8(A) What files must be available to your program if you want to draw lines and circles? Write a C++ program in text mobile to generate a window a print your message in the center of the window with colored background and colored text. (B) Write a C++ program to draw colorful nested circles in the center of the screen using graphic mode.

S-ar putea să vă placă și