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, 22.06.2019 06:30
Plz 40 points what are raster vectors? a bitmap image a vector file a type of printing press a small projector
Answers: 1
question
Computers and Technology, 22.06.2019 06:30
Exchanging which type of data uses the least bandwidth? music photographs video voice bandwidth- the amount of data that can be moved between two points in a set time period
Answers: 1
question
Computers and Technology, 22.06.2019 08:00
Digital information is stored using a series of ones and zeros. computers are digital machines because they can only read information as on or off –1 or 0. this method of computation is known as the system
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
Arecipients list has been loaded into a document. which commands should be clicked in order to filter the list so that letters will not be printed for recipients who live in a certain state? mailings tab, start mail merge, select recipients, type new list, then insert only contacts from the desired states mailings tab, rules, select recipients, use existing list, then choose a recipients list that includes only contacts in certain states mailings tab, select recipients, use existing list, rules, fill in, then type in certain states mailings tab, rules, skip record select “state” under field name, then type in the state name under “equal to”
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
question
Mathematics, 28.01.2021 23:40
question
Mathematics, 28.01.2021 23:40
question
Mathematics, 28.01.2021 23:40
Questions on the website: 13722363