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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:30, micahpauleen748
In a compound condition, both conditions on either side of the logical operator and must be true for the overall condition to be true. a: true b: false
Answers: 1
image
Computers and Technology, 22.06.2019 18:30, ovoxotas
Which of the following commands is more recommended while creating a bot?
Answers: 1
image
Computers and Technology, 23.06.2019 04:10, cvbnkifdfg
2pointswho was mikhail gorbachev? oa. a russian leader who opposed a coupob. a polish leader who founded the labor union "solidarityoc. a soviet leader who called for a closer relationship with the unitedstates, economic reform, and a more open societyd. a soviet leader who called for more oppression in the soviet union
Answers: 3
image
Computers and Technology, 23.06.2019 22:00, elijah1090
Technician a says engine assemblies can be mounted longitudinally in a chassis. technician b says engine assemblies can be mounted transversely in a chassis. who is correct?
Answers: 2
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 in other subjects:

Konu
World Languages, 26.02.2020 00:34
Konu
Chemistry, 26.02.2020 00:34