subject
Computers and Technology, 20.11.2020 17:00 grey00

Write a class-based program with an All-in-One Web form to calculate the correct amount of change to return when performing a cash transaction. Allow user (a cashier) to enter the cost of a transaction and the exact amount of money that the customer hands over to pay for the transaction. Define a class named Change. Use set and get functions to store and retrieve both amounts to and from private data members. The use member functions to determine the largest amount of each denomination to return to the customer. Assume that the largest amount denomination a customer will use is a $100 bill. Therefore, you need to calculate the correct amount of change to return, the number of $50, 520, 510, S5, and Sibills to return, and number of quarters, dimes, nickels, and pennies to return. For example, if the price of a transaction is $5.65 and customer hands the cashier $10, the cashier should return $4.35 to the customer as four $1 bills, a quarter, and a dime. Include code that requires the user to enter a numeric value for the two cash transaction fields. • In the class, o You can have a private member, a two dimensional associative array, and initialize the names and values for denominations. There are 9 denominations for money changes: $50 Bill, $20 Bill, $10 Bill $5 Bill, $1 Bill, Quarter. Dime, Nickel, and Penny. o Declare all data members private. o You can have a variable to count denominations, and initialize it in a constructor or constructor function. o The function, which determine the largest amount of each denomination to return to customer, also displays the results (see output examples in the screen shots). o Use other built-in functions (such as round) as needed). • Save the class definition into a separate PHP file, and then use include() or require() function to include it in the client program. • The client program should either include the HTML form on the same page, or create a link to allow the user back to the HTML form for another calculation. • Need to ensure the inputs are not empty and are numeric data. The following are screen shots when the program executes: • Default page Calculate Change Enter a transaction Amount Owed: $Amount Paid: $ Clear Form Calculate Change • Invalid inputs Calculate Change The amount owed must be a numberThe amount paid must be a number. Enter a transaction Amount Owed: $ Amount Paid: $ Clear Form Calculate Change • Amount owed < amount paid Calculate Change Calculation Results The price of the transaction was $42.99. The amount paid was $100.00.The change due is $57.01. Return the following denominations as change: 1 $50 Bill 1 $5 Bill 2 $1 Bilis 1 Penny Enter a transaction Amount Owed: $42.99 Amount Paid: $100.00 Clear Form Calculate Change • Amount owed > amount paid Çalculate Change Calculation Results The price of the transaction was $100.00. The amount paid was $35.00. The change due is 5-65.00. The customer still owes $65.00. Enter a transaction Amount Owed: $100.00 Amount Paid: $35.00 Clear Form Calculate Change • Amount owed = amount paid Calculate Change Calculation Results The price of the transaction was $50.00. The amount paid was $50.00.The change due is $0.00.The customer paid the exact amount, no change is due. Enter a transaction Amount Owed: $50.00 Amount Paid: $50.00 Clear Form Calculate Change

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 15:10
What role did women fill during world war ii?
Answers: 1
question
Computers and Technology, 23.06.2019 16:10
What is the ooh? a. omaha occupation handbook b. online occupational c. occupations online d. occupational outlook handbook select the best answer from the choices provided
Answers: 3
question
Computers and Technology, 23.06.2019 23:40
4. what is the reason for including the following code snippet in the header file animal.h? #ifndef animal_h #define animal_h class animal { public: animal(); animal(double new_area_hunt); void birth(); void hunt(double new_area_hunt); void death(); double get_area_hunt() const; private: double area_hunt; }; #endif
Answers: 3
question
Computers and Technology, 24.06.2019 12:00
How can we take picture in this app
Answers: 1
You know the right answer?
Write a class-based program with an All-in-One Web form to calculate the correct amount of change to...
Questions
question
Mathematics, 24.02.2020 20:33
question
History, 24.02.2020 20:37
question
Mathematics, 24.02.2020 20:37
Questions on the website: 13722362