Professional Documents
Culture Documents
2. Write a program to check whether a number input by user is odd number. If odd,
display an appropriate message.
3. Write a program to check whether a number input by user is even number. If even,
display an appropriate message.
5. Write a program to input price and quantity of the item. Calculate the total price for all
items. If total price is greater than RM50, give 15% discount to customer. Display the
price before and after discount.
2. Write a program to check whether a number input by user is odd or even number. If
odd, display “odd”, otherwise display “even”.
3. Write a program to check whether a grade input by user is fail or not. If grade is less
than to 50, display “fail”, and otherwise display “pass”.
5. Write a program to input price and quantity of item. Calculate the total price for all
items. If total price is greater than RM50, give 20% discount to customer. If not, give
5% discount to customer.
a. Your program should read two inputs from the keyboard, which are the
amount of investment and profit.
b. If the investment is more than or equal to RM50,000 and the profit is more
than RM20,000, the following message is displayed: This investment is
worthy to continue
NORMAZIAH - FSKM
CSC128
MULTIPLE SELECTION
1. PWM Bank wants to do a program so that it can help the customer to calculate the
monthly instalment. The program will receive two inputs from the customer which are
the amount of loan in Ringgit Malaysia and year of instalment. Based on those
two inputs, write a program to calculate and display the monthly instalment.
The table of interest calculation is provided as follows:
2. Write a C++ program that will accept two numbers that are greater than zero.
If user enter s number less than or equal to zero, display an error message.
Otherwise user need to input an arithmetic operator(+,-,*,/). The program will
perform calculation on those number using operator and display the result.
5 * 10 = 50
NORMAZIAH - FSKM