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
Which of the following best describes compounds.
Lemur [1.5K]
A. They can only be separate chemically
4 0
3 years ago
Discuss the software development methodology you would use for developing a software product for insurance agents, and state val
nadya68 [22]

Answer:

It depends on what the company will be willing to use and it also depends on their budget

Explanation:

4 0
3 years ago
Why do i have to wait and watch videos
Mila [183]

The reason being is because of your search history. Google will remember everything you like to watch, look, play or buy things on the computer or any device with internet. Since you are interested in the things you like to do, you're computer will remember this and will display Ads made by companies, or people, which possibly may be a scam, or may give a virus. I would advise to avoid these things as much as you can.

7 0
2 years ago
In Excel you insert a comment in a worksheet by using the ____ tab on the Ribbon.
White raven [17]
Review
(I was suprised too)
3 0
3 years ago
How does an author use artifacts in literature?
cestrela7 [59]
They use artifacts in l<span>iterature in order to develop the plot and the characters.</span>
7 0
3 years ago
Other questions:
  • White meat and dark meat fish have slightly different nutritional characteristics. What are the nutrition characteristics of dar
    7·2 answers
  • The person who Oversee the direct work of employees and is responsible for the day-to-day tasks the employees complete is likely
    7·2 answers
  • True or False?
    7·1 answer
  • The optional feature in a business letter is
    10·1 answer
  • The way a program is proceed is know as control flow and are :Sequence(one line after the other), Decision-making(either this or
    8·1 answer
  • What are entity-relationship diagrams and how are they used? What symbol is used for a relationship? What is an associative enti
    5·1 answer
  • Which of the following is NOT an example of soft skill?
    8·1 answer
  • Convert the given for loop to while loop and find the output of the program assuming the
    14·1 answer
  • Select the correct answer.
    9·1 answer
  • An independent penetration testing company is invited to test a company's legacy banking application developed for Android phone
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!