السلام عليكم .. انا طالبه في كلية بسلطنة عمان
وعندي مشكلة في ++c شو ما سويت ما قادره استوعب شئ
وقررت اني اجمع اوراق الاختبارات السنوات الي طافت واحاول احلها بس ما قدرت احل شئ
ياريت تساعدوني احل بعض الاسئلة بليييييز ما باقي على الاختبار شئ
السؤال الأول :
Write a C++ program that uses a function called
calcPay( ) to calculate the total wages of an employee. The total wages are calculated as follows. Total wages= (number of hours worked in a week*hourly pay rate) + vehicle allowance. Get the values of the total number of hours worked and the vehicle allowance from the user. Assume that the Hourly pay rate is R.O.7
السؤال الثاني
Write a C++ program that calculates and displays the charges for a person‟s stay in a hotel. First, the program should ask if the user wants a normal room or a deluxe room. If the user selects a
normal room, the following charges apply.
R.O. 25 per day of stay in the hotel.
R.O 10 per day for Breakfast and Lunch
R.0. 5 for service charges.(fixed for all days)
If the user selects a deluxe room, the following charges apply.
R.O. 35 per day of stay in the hotel.
R.O 15 per day for Breakfast and Lunch
R.0. 5 for service charges.(fixed for all days)
The program should use two functions to calculate the total charges. Both the functions should accept the number of days of stay and then calculate and display the total charges.
السؤال الثالث
Write a C++ to find out the area of a Circle. The program should have
a. The class should have three attributes – x,y (centre) and radius.
b. The class should contain two methods- getData(), cirArea() and cirCum().
c. getData() method initializes three variables x,ye and radius.
d. cirArea() calculates the area of the Circle using the formula
area= r
2
e. The
cirCum() method should calculate the circumference of the Circle using the formula circumference=2r.
The main method should create an object of the class and call the above functions to check their functionality.