subject

The owner of a candle shop has asked for your help. The shop sells three types of candles as shown below: Type Price Burn Time (hours)
1 $2.50 5
2 $3.75 7
3 $5.99 12

The owner wants you to write a program to perform certain calculations when customers buy different numbers of the candles.

Required:
a. Develop an algorithm to satisfy the following requirements:

Prompt the user to enter the number of candles of each type the customer wants to buy. Since you can’t buy a fraction of a candle, the input for each type of candle must be an integer. (You may assume that only integer values between 0 and 10 will be entered when this program is tested.)
Calculate the total price of all the candles bought using the information in the table above. For example, two Type 1 candles and one Type 2 candle would have a total price of $8.75.
Calculate the total burn time of all the candles if they were burned consecutively (i. e., one after the other). For example, one Type 1 and one Type 3 candles would burn for 17 hours.
Calculate the cost-per-minute for that purchase.
Output some kind of meaningful display that includes the number of candles of each type bought, the total price, the total burn time, and the cost-per-minute. You can be as creative as you want with this!
Write the pseudocode for the algorithm and store it in a file (file format can be text, pdf or doc) with the name CandleShopSteps.

b. Write the code (20 points)

Once you've written your algorithm it is time to turn it into a Java program. that can be executed (run). Here are some things to keep in mind:

the class should be name CastleShop.
the program will need to import the Scanner class from the Java util package.
the class should have a main method that will include the logic for the algorithm you developed in Part A. You may choose to add additional methods that are called in the main method.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:30, DestinyK8033
Why would a programmer use the logical operator and in an if statement? a: when an action is to be taken that requires both conditions to be falseb: when an action is to be taken that requires both conditions to be truec: when an action is to be taken that requires the first condition to be falsed: when an action is to be taken that requires the second condition to be truei took the test and the answer is b.
Answers: 3
image
Computers and Technology, 22.06.2019 18:30, Liantic8738
List the five on-board vehicle subsystems
Answers: 1
image
Computers and Technology, 22.06.2019 22:50, youngboymark123
Assume the existence of a bankaccount class. define a derived class, savingsaccount that contains two instance variables: the first a double, named interestrate, and the second an integer named interesttype. the value of the interesttype variable can be 1 for simple interest and 2 for compound interest. there is also a constructor that accepts two parameters: a double that is used to initialize the interestrate variable, and a string that you may assume will contain either "simple", or "compound", and which should be used to initialize the interesttype variable appropriately. there should also be a pair of functions getinterestrate and getinteresttype that return the values of the corresponding data members (as double and int respectively).
Answers: 2
image
Computers and Technology, 23.06.2019 16:10, alexis9658
What is the ooh? a. omaha occupation handbook b. online occupational c. occupations online d. occupational outlook handbook select the best answer from the choices provided
Answers: 3
You know the right answer?
The owner of a candle shop has asked for your help. The shop sells three types of candles as shown b...

Questions in other subjects:

Konu
Advanced Placement (AP), 23.01.2020 22:31