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
jolli1 [7]
3 years ago
9

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:
Bezzdna [24]3 years ago
4 0

Answer:

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

  double cost = 0;

  double priceF, priceS, priceT;

  int nOne = 0, nTwo = 0, nThree = 0;

  int fBurn, sBurn, tBurn;

  int burnTime = 0;

  isEnd = "n";

   while (isEnd == "n"){

      Scanner in = new Scanner(System.in);

      int option = in.nextInt();

      if (option == 1){

            priceF = 2.50;

            fBurn = 5;

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

            nOne += in.nextInt();

            burnTime += fBurn * nOne;

            cost += priceF * nOne;

        } else if (option== 2){

            priceS = 3.75;

            sBurn = 7;

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

            nTwo += in.nextInt();

            burnTime += sBurn * nTwo;

            cost += priceS * nTwo;

        } else if(option == 3){

            priceT = 5.99;

            tBurn = 12;

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

            nThree += in.nextInt();

            burnTime += tBurn * nThree ;

            cost += priceT * nThree;

        } else{

            System.out.println("option must be between 1 and 3");

        }

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

      isEnd = in.nextLine();

  }

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

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

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

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

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

  double cpm = (burnTime * 60) / cost;

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

}

}

Explanation:

The Java program prompts the user to continuously choose from three options 1, 2 and 3. The prices, the burn time and the cost per minute burn of the total candles ordered are printed out.

You might be interested in
Does anyone have any tips on how to begin a 10 page Capstone project paper? I've got to write a write a research paper on the ty
Stella [2.4K]

Answer:

first resherch what you will be doing on the job and maybe what training you will need and what school you will have to go to it might also help to include what pay you would get and how many hours you will do

Explanation:

sorry its not much but i hope this helps

8 0
2 years ago
Read 2 more answers
Why ads on this app do it help pay for the free stuff?
UNO [17]

Answer:

Yes

Explanation:

The ads help support the system for you using this website for free.

4 0
2 years ago
The "c" key and the "e" key are struck by
adoni [48]
1 because when you type on the home row your left middle finger will hit both of those letters.
3 0
3 years ago
Read 2 more answers
In codd's model of a relational database, data is stored in a(n) _____, which maintains information about a(
Dmitry [639]
<span>Which is not a component of a database that describes how data is stored?</span>
5 0
4 years ago
What is a key function of a scrum master plato answer plz
sdas [7]
The scrum master is the team role responsible for ensuring the team lives agile values and principles and follows the processes and practices that the team agreed they would use.
6 0
3 years ago
Other questions:
  • Given a string variable named sentence that has been initialized , write an expression whose value is the the very last characte
    14·1 answer
  • Write a program that reads in 10 numbers from the user and stores them in a 1D array of size 10. Then, write BubbleSort to sort
    13·1 answer
  • On what basis can you categorize the generations of computers
    7·1 answer
  • What do you click to move to the next cell in the row?
    7·1 answer
  • Powerpoint s _____ feature allows you to set the timing for a video clip
    12·1 answer
  • Complete the missing code in the templatepublic class Exercise09_04Extra { public static void main(String[] args) { SimpleTime t
    13·1 answer
  • which of the following is something that an information systems (IS) professional would do? A. devise new ways to use computers
    10·1 answer
  • What tool is used to edit pre-existing range names? (check all that apply)?
    10·1 answer
  • Dropdown Complete the sentence. To protect a web-based database, you should apply to any online forms that add data to it. princ
    14·2 answers
  • Which term refers to a shorthand method for identifying network and host bits in an ip address?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!