Question: C++ REPETITION CONTROL STRUCTURE 1. Write a program to calculate the total amount that a customer has to pay. The program will input the price

 C++ REPETITION CONTROL STRUCTURE 1. Write a program to calculate the

total amount that a customer has to pay. The program will input

C++

REPETITION CONTROL STRUCTURE 1. Write a program to calculate the total amount that a customer has to pay. The program will input the price of the item and the number of items purchased by the customer. The program will then print the total amount that the customer has to pay. The program will stop if the user enters 'N' and then it will display the following report: The total numbers of customers. The numbers of item purchased. The total amount of payment. . The sample of execution is as follows: Enter the price of item Enter the number of items : 5.00 : 2 The number of items you have purchased: 2 The total price that you have to pay is: RM 10.00 The next item (Y) es or (N) O Enter the price of item Enter the number of items : 2.00 : 6 The number of items you have purchased: 6 The total price that you have to pay is: RM 12.00 The next item (Y) es or (N) O : N The number of customers: 2 The number of item purchased: 8 The total amount of payment : RM22.00 (15 marks) ANSWER: FUNCTIONS PNB has declared a dividend for all ASB investors. Each investor will be paid a dividend depending on account balance. The following table shows the details: Account Balance Less than 10,000 10,001 - 50,000 50,001 - 100,000 100,001 and above Dividend % 2% 3% 4% 5.5% Write a function definition of the functions specified in a), b) and c): a) Function AccBalance () inputs the account balance and returns its value. b) Function CalDividend () receives the account balance through its parameter. This function then calculates and returns the amount of total dividend. c) Function display () receives the investors's name, account number, total dividend and the latest account balance through its parameter and display them. d) Write a main program that will ask user to input the account number and the investor's name. This program will calculate latest account balance and then display all the information using the functions defined in question (a), (b) and (c) above. (15 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!