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 processes allows animators to use computers to input human movement that can later be transformed to crea
nadya68 [22]
Motion Capture. "it's a combination of rotoscoping with newer computer technology, allowing people to use live footage as the basis for animation without having to go through the process of drawing over it." -scienceworld .ca
7 0
2 years ago
Read 2 more answers
How do you restore deleted notpad++ file?
Natasha2012 [34]
Check your trash can, if that doesnt work then I would say its lost.
3 0
3 years ago
Which of the operating systems listed below was the last to be released
Elena-2011 [213]

Mac OS came out in 2001. This is software that was created by Apple to run the "Mac Computers." This software is still used to this day.

MS-DOS came out in 1981. This is software that was created by Microsoft to run x86 computers. This software is no longer used.

Windows New Technology came out in 1985. This is software that was created by Microsoft to run a ton of different computers. This software is still used to this day.

Windows Vista came out in 2006. This software that was created by Microsoft to run a variety of personal computers. This software is no longer used.

By the information given, Windows Vista was the last to be released.

Best of Luck!

8 0
3 years ago
If you used the VLookup function, where would it look for a value?
zheka24 [161]

Answer:

rowwww potapot FG fhvnhtbrhabeynrynrynebeynye eynry eyney eyney e ye enegbe

4 0
3 years ago
Read 2 more answers
What shows the web address of the page that is currently displayed in the workspace?
babunello [35]

Answer:

In a web browser, the address bar (also location bar or URL bar) is a GUI widget that shows the current URL. The user can type a URL into the bar to navigate to a chosen website.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Send a document as a PDF when A. you want the recipient to make changes to the file. B. it needs to be printed. C. it contains m
    10·1 answer
  • Whitch action should a user take to ensure that formatting is applied to a row? A. use the ctrl+a keys. B. highlight the whole t
    11·1 answer
  • When including multiple images in a report, it may help to create a _____ on each image so you can cross reference them througho
    11·1 answer
  • Employees at the Red Bluff Golf Club & Pro Shop have the opportunity to become certified trainers if they log enough hours.
    13·1 answer
  • Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
    12·2 answers
  • What type of error results from an error in the formatting of the program code?
    13·1 answer
  • D. What is the work of the following features:<br>1. Foot note​
    10·1 answer
  • Name the application used for creating Presentations___
    5·2 answers
  • Explain the principles of computer applications ​
    11·1 answer
  • I need major help. Word processing
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!