Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I don't want any copied work from anywhere else. Do not forget to add comments to explain how your codes are working! Comments must be

I don't want any copied work from anywhere else.

Do not forget to add comments to explain how your codes are working! Comments must be brief, clear, and understandable. Do not write long sentences!!!

I am asking you to use a "sentinel-controlled loop". It means that user can enter many inputs until a sentinel value is entered. In the question, I am a giving an example when user enters inputs for only two years and then enters -1 (sentinel value) to terminate the loop. I am showing how you must make the calculation.

Question - Lets think that Company XYZ produces t-shirts. Develop a Java application that will input sales revenue and a total number of products sold (both as integers) for each year. The program should calculate and display the selling price of the product for each year. Additionally, in the end, the program prints total sales revenue, a total number of products sold, and combined selling price. All calculations should produce floating-point results. Use class Scanner and sentinel-controlled iteration to obtain the data from the user

UPLOAD SellingPrice.java file....

For example; for the first-year sales revenue is 1000, the total number of products sold 10, for the second-year sales revenue is 2000, the total number of products sold 10) (we are assuming that user enters two inputs) It will print:

Selling price for the first year is $100.00 (1000/10)

Selling price for the second year is $200.00 (2000/10)

Total sales revenue is $3000.00 (1000+2000)

Total number of products sold is 20.00 (10+10)

Combined selling price is $150.00 (3000/20)

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_2

Step: 3

blur-text-image_3

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

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions