Lab exam 2

advertisement

Kingdom of Saudi Arabia

Ministry of Higher Education

Majmaah University

Collage of Science at Al-Zulfi

Computer & Information Dept.

ةيدوعسلا ةيبرعلا ةكلمملا

يلاعلا ميلعتلا ةرازو

ةــعمجملا ةعماج

يفلزلاب مولعلا ةيلك

تامولعملاو بساحلا مولع مسق

1

st

midterm exam - Second Semester 1435-1436H

Course Name : Programming Lang.(2) - Course Code: CSI 221 - Section:

Time Allowed: 90 ) 2 ( ةجمرب ةدام ل ) يلمع ناحتما )

Date: Mon. 22/ 07/ 1436 H  11 / 05 / 2015 G. Number of Pages: 4

Student's Name: ......................................................................................................

Student's ID: ............................................................................................................

Laboratory EXAM

PROGRAMMING 2

Learning Outcomes

Knowledge

1.1 1.2 a2

1.3 a3

Cognitive Skills Interpersonal Skills

1.4 2.1 b1

2.2 b2

2.3 2.4 3.1 3.2 3.3 c3

3.4

Communication, Information

Technology, Numerical

4.1

4.2

4.3

d1

Question Outcome covered Correction Verification

Faculty Member Course coordinator

Total

1

2

3 b1 b2 c3

Marks:……………………………………………………………………………

Dr. Wael Khedr

Revision Committee

Name Signature

Final Mark :

/ 15

2 جذومن

1

Question(1) : -----------------------------------------------------------------------------------[5 marks]

Write a function called

KgToBound( )

that is passed weight in kilograms and returns a weight in in pounds by using equation:

Pounds = kilograms / 0.453592

Write a main() program to exercise this function for n persons ?

Answer

2

Question(2) : ----------------------------------------------------------------------------------[ 5 Marks]

#include<< iostreem>>

Structure Distance //English distance

{ int feet; float inches;

}

////////////////////////////////////////////////////////////////

Distanc addengl(Distanc, Distanc) //declarations void engldisp(Distance)

Correct the errors of Distance structure definition and write definitions of declared functions , and call it into main function with three variables of

Distance ?

Answer

3

Question(3) : ----------------------------------------------------------------------------------[ 5 Marks]

Create an Employee class. The member data should comprise string name , an int for storing the employee's id and a float for storing the employee’s salary . A constructor should initialize fixed values for all variables. A member function GetData( ) should allow the user to enter this data and a member function ShowData( ) should allow display it . Write a main( ) that allows the user to enter data for n array of employees and display them ?

Answer

4

Download