Computers and Technology
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

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 12:30, Machuco127
Some of the first computer games were created in the early 1970s by college students experimenting after hours to see what the were capable of doing.
Answers: 3
image
Computers and Technology, 22.06.2019 17:30, jonquil201
Where would you click to edit the chart data?
Answers: 1
image
Computers and Technology, 24.06.2019 12:50, neptunesx
Write a new lc-3 trap subroutine (i. e. a subroutine that will be invoked via the trap instruction) that will receive a numeric digit entered at the keyboard (i. e. an ascii character), echo it to the screen, and return in r0 the corresponding numeric value: so if the user types the digit '7', the character '7' will appear on the screen, but the value returned in r0 will be b0000 0000 0000 0111 (#7) you may not use any trap calls in your code - you must implement the "polling" code that interrogates the keyboard status and data registers. ; getnum_tsr ; a subroutine for obtaining a numeric value ; given ascii numeric digit input to keyboard. ; the numeric digit is echoed to the console (e. g. '7' = b0000 0000 0011 0111), ; but the value returned in r0 is the actual numeric value ; corresponding to the digit (e. g. b0000 0000 0000 0111 =
Answers: 3
image
Computers and Technology, 24.06.2019 15:00, MilanPatel
In excel, what happens to the cell contents when you click and drag a cell into multiple cells?
Answers: 1
Do you know the correct 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
Mathematics, 25.05.2021 22:30
Konu
Mathematics, 25.05.2021 22:30
Konu
Mathematics, 25.05.2021 22:30
Konu
Computers and Technology, 25.05.2021 22:30