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 13:10
What is domain name system (dns)? allows dynamic ip address allocation so users do not have to have a preconfigured ip address to use the network converts ip addresses into domains, or identifying labels that use a variety of recognizable naming conventions the efficient coexistence of telephone, video, and data communication within a single network, offering convenience and flexibility not possible with separate infrastructures the integration of communication channels into a single service
Answers: 2
question
Computers and Technology, 23.06.2019 17:20
What is the best assassins creed game?
Answers: 2
question
Computers and Technology, 23.06.2019 23:30
A. in packet tracer, only the server-pt device can act as a server. desktop or laptop pcs cannot act as a server. based on your studies so far, explain the client-server model.
Answers: 2
question
Computers and Technology, 24.06.2019 13:30
Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. the program should output the average high, average low, and the highest and lowest temper- atures for the year. your program must consist of the following functions: a. function getdata: this function reads and stores data in the two- dimensional array. b. function averagehigh: this function calculates and returns the average high temperature for the year. c. function averagelow: this function calculates and returns the aver- age low temperature for the year. d. function indexhightemp: this function returns the index of the highest high temperature in the array. e. function indexlowtemp: this function retur
Answers: 3
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, 10.05.2021 20:40
question
History, 10.05.2021 20:40
question
Mathematics, 10.05.2021 20:40
Questions on the website: 13722359