KS06603 ENGINEERING PROGRAMMING Test 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

KS06603 ENGINEERING PROGRAMMING

Test 1
Wednesday, 16 Nov 2022, 8.00am-11.00am

INSTRUCTIONS:
1. This is an open-resource test. Do NOT share your program with others - similar
programs will get a ZERO mark.
2. Answer the question that is allocated for your group only.
3. Copy the program and screenshot the output. Paste both in a yourname.doc
file and upload in SMARTV3 within 15 minutes after the test ends.
Group A and B:

Ahmad makes RM24,000 per year as a Grab rider. His boss offers Ahmad a raise, but
he must choose one of the following two options:

1) An RM1,000 bonus immediately, followed by a ten percent salary increase yearly.


2) A salary increase of one-twelfth of ten percent each month (and no bonus).

Write a program to aid Ahmad in making his decision. Display a three-column output
that shows the year number and the salary for each successive year for each
option. The program should terminate when option two's salary becomes greater than
option one.

Group C and D:

The following formula gives the cost of producing Sambal Nyet Berapi, where the
bottle stands for the number of bottles produced each day.

Cost = bottle3 - 7 bottle2 + RM432

Mr. Khairul Aming wants a program to determine how many bottles should be
produced each day to minimize operating costs.

Write a program that calculates and prints the cost for 1 unit, 2 units, 3 units, and so
on, until a cost that is greater than the previous cost is calculated.

Group E and F:

Write a program that asks for the user's age, annual income, and number of years of
experience, then decide whether the customer can apply for a loan. If the customer
is eligible for a loan, then it computes the amount of the loan the customer is eligible
for, according to the following criteria:
- Only customers who are at least 21 years old are eligible to apply for a loan
- Customers with a minimum of 5 years of experience are eligible for a loan
amount of at least RM20,000.
- A customer is eligible for a loan amount to the maximum extent of 10 times
his/her annual income.
The program should allow the user to repeat this calculation as often as the user
wishes.
Group G and H:

Write a program for the Borenos Fried Chicken restaurant.

The program should display the menu and allow the customer to enter multiple
selections and the quantity for each selection.

For each selection, total up and display the price. If the total price has exceeded
RM200, verify whether the customer would like to continue with the purchase.

Upon checkout, display the total to pay.

cout << "Hello, welcome to Borenos Fried Chicken\!"<< endl;


cout << "\n***************************************" << endl;
cout << "**************SET MEAL*****************" << endl;
cout << "1 :: 2 PC MEAL.................RM10.80" << endl;
cout << "2 :: 3 PC MEAL.................RM13.80" << endl;
cout << "3 :: 1/2 SPRING CHICKEN MEAL...RM15.80" << endl;
cout << "4 :: FISH & CHIPS..............RM15.80" << endl;
cout << "5 :: 6 PC NUGGET MEAL..........RM09.80" << endl;
cout << "***************************************" << endl;
cout << "*************KIDS MEAL*****************" << endl;
cout << "6 :: SET A.....................RM05.90" << endl;
cout << "7 :: SET B.....................RM05.90" << endl;
cout << "***************************************" << endl;
cout << "*************ADD ON********************" << endl;
cout << "8 :: DRINKS....................RM01.50" << endl;
cout << "9 :: ICE CREAM.................RM01.50" << endl;
cout << "10 :: CHEESE DIP................RM01.50" << endl;
cout << "***************************************\n" << endl;
GROUP I and J

Tagal Sungai Moroli in Kampung Luanti, Ranau is a popular tourist attraction. Here,
you will have the chance to try out the fish massage, which is deemed to have a
curative effect on those who have psoriasis. However, the Tagal Sungai Moroli is
operated privately by the villager and lacks a ticketing management system. You are
required to design a ticketing management system that can do the following:

1. Display a welcoming message to the visitors and ticket price:

Welcome to Tagal Sungai Moroli!

Malaysian:Sabahan
Adult >18 yrs ………..RM 3.00
Children <18 yrs ……RM 1.00

Malaysian:Non-Sabahan
Adult >18 yrs ……….RM5.00
Children <18 yrs…….RM 2.00

International
Adult/Children………..RM 10.00

2. Allow the visitor to select multiple tickets from any category.


3. List the selected tickets with the price to pay.
4. Confirm to proceed with payment.

You might also like