1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
laiz [17]
3 years ago
14

The owner of a candle shop has asked for your help. The shop sells three types of candles as shown below:

Computers and Technology
1 answer:
Keith_Richards [23]3 years ago
3 0

Answer:

import java.util.Scanner;

public class Main {

 public static void main(String[] args) {

   double total = 0;

   double fPrice, sPrice, tPrice;

   int firstN = 0, secdN = 0, thirdN = 0, fTime, sTime, tTime;

   int totalT = 0;

   isEnd = "n";

   for (;;){

       if (isEnd == "y"){

           break;

       }

       Scanner in = new Scanner(System.in);

       int option = in.nextInt();

       switch (option){

         case 1:

             fPrice = 2.50;

             fTime = 5;

             System.out.print("Enter number of items: ");

             firstN += in.nextInt();

             totalT += fTime * firstN;

             total += fPrice * firstN;

             break,

         case 2:

             sPrice = 3.75;

             sTime = 7;

             System.out.print("Enter number of items: ");

             secdN += in.nextInt();

             totalT += sTime * secdN;

             total += sPrice * secdN;

             break,

         case 3:

             tPrice = 5.99;

             tTime = 12;

             System.out.print("Enter number of items: ");

             thirdN += in.nextInt();

             totalT += tTime * thirdN ;

             total += tPrice * thirdN;

             break,

        default:

             System.out.println("Looking forward to the Weekend");

       }

       System.out.print("Do you want to end the order? y/n: ");

       isEnd = in.nextLine();

   }

   System.out.println("Number of Type 1 candles bought : "+firstN);

   System.out.println("Number of Type 2 candles bought : "+secdN);

   System.out.println("Number of Type 3 candles bought : "+thirdN);

   System.out.println("Total cost is : "+total);

   System.out.println("Total burn time is : "+totalT);

   double costPerBurn = (totatT * 60) / total;

   System.out.println("Cost per minute : "+ costPerBurn);

 }

}

Explanation:

The Java program creates a continuous for-loop statement that gets the candle type, price and amount ordered from a switch and accumulates the total cost and burn time of the candles bought and the cost per minute burn of the candles consecutively.

You might be interested in
How do online note-taking tools support students’ academic goals? Check all that apply.
MakcuM [25]

Answer:

all but 3

Explanation:

3 is strange and I need points sorry

5 0
3 years ago
Read 2 more answers
Before you can use the Management Studio to work with the objects in a database, you must ___________ the database files (i.e.,
Lelu [443]

Answer:

You must attach the database files

Explanation:

4 0
3 years ago
which is the quickest way to change the font color in multiple, randomly located cells in a worksheet?
insens350 [35]
First select or highlight the rows or columns that you want to change the font color<span>. You can hold the ctrl key while select </span>multiple cells<span>. After, selecting you can now </span>change the font color<span> of everything you selected.</span>
6 0
3 years ago
Read 2 more answers
Mary needs to choose the menu in order to place the text in a desired fashion around the image.
n200080 [17]
Can you be more specific?

7 0
3 years ago
Read 2 more answers
The document asks about dependents because the number can
BARSIC [14]
The answer is: Lower overall taxes
8 0
3 years ago
Read 2 more answers
Other questions:
  • PLS HURRY!! This OS introduced a very cool GUI that had animations and transparencies.
    5·1 answer
  • Which of the following statements about Java Class Libraries is false: a. Java class libraries consist of classes that consist o
    9·1 answer
  • You install an M.2 SSD card in an M.2 slot on a motherboard. When you boot up your system, you discover the DVD drive no longer
    15·1 answer
  • When the increment or decrement operator is placed before the operand (or to the operand's left), the operator is being used in
    6·1 answer
  • 6. Sandra did a survey to see how
    9·1 answer
  • Hey does anybody know how to delete history on a school-issued chrome book, I tried to delete it but it won't let you clear your
    7·1 answer
  • What is the value of the result after the following statement is executed? int result = 2 + 3 + 4 ;
    7·1 answer
  • Firefox, Chrome, Opera, and Safari are examples of
    15·1 answer
  • Which feature of REPL.it would you use to transmit your program to a friend?
    12·1 answer
  • What are some of the characteristics found in an editorial photograph?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!