Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

good IX Write a complete program comment at the top and at least one more good comment later in (you are not expected to use

image text in transcribed
good IX Write a complete program comment at the top and at least one more good comment later in (you are not expected to use methods although you may if you wish): Java program, including comments (worth 2 pts-be sure to include a the program), to do the following 1. Read in the order number for tickets for a school show i and children will attend. Include prompts. Print the original data right after you read throughout the program, every time you print a value, make sure you also print some it explaining what that value is.) You will need to keep track of 2 counts-see #7 below. including how many adults, students, it in. (Note: words next to A typical set of values read in could be: 1234 46 10 This means order 1234 was for 4 adults, 6 students, and 10 children This is simply the sum of the three values (20 in 2. Compute the number of people in the group. the example shown above). Print the total 3. Compute the combined total amount owed for the order, using this formula: Each adult pays 5.00, each student pays 3.50, and each child pays 2.50. Print the combined total. In the example above, it is 4 5.00+6 3.50+102.50 4. The school gives a discount of 10% if the number of people in the group is 10 or more Determine if the order gets the discount, and how much it will be. Print an appropriate message (qualifies for a discount or doesn't). Also keep track of how many orders qualified for the discount. 5. Determine the order's final price. If the order gets the discount, the final price is the combined total amount owed minus the discount. If the order does not get the discount, the final price is the computed total amount. Keep count of how many orders qualify for the discount. Print the the discount and final price. You should print 0 for the discount if there is no discount on this product. 6. Repeat the entire series of calculations for the next order, and the next, until all of the orders have been processed. You must decide how to tell when all of the orders have been processed. You do not know how many orders there will be.(Your program should test for the end of data.) Make sure that this method is described in a comment. 7. Calculate the percent of orders that received a discount. This is the number that got the discount divided by the total number of orders. Print the total number of orders, the total that received the discount, and the percent that received the discount (with 3 places after the decimal), Suggestion: You will need two separate counters

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

More Books

Students also viewed these Databases questions

Question

Classify delivery styles by type.

Answered: 1 week ago

Question

=+ Why have these changes occurred?

Answered: 1 week ago

Question

=+90 percent of all oil refineries) into several smaller companies

Answered: 1 week ago