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
If you want to work on all aspects of your presentation, switch to __________ view, which displays the Slide pane, Outline pane,
oksano4ka [1.4K]

Answer:

Normal

Explanation:

3 0
3 years ago
(in order of a-z)
Lerok [7]

Answer:

Airplane

Balloons

Bookmark

Boot

Chips

Cup

Dog

Flowers

Glove

Hat

Lamp

Notebook

Orange

Pen

Poster

Scissors

Snake

Telephone

Turtle

6 0
2 years ago
Computers have small bumps on the keyboards that enable persons to type without looking at the keyboard. These letters are:
QveST [7]

A) FJ is the right answer

3 0
3 years ago
Read 2 more answers
SOMEONE WHO ACTUALLY KNOW HOW TO DO THIS PLEASE DO IT AND SEND A SCREENSHOT I REALLY NEED IT FOR MY EXAMS AND DONT TROLL ​
vodka [1.7K]
What computer do you own?
8 0
2 years ago
Write a complete c++ program using function and array.​
lana66690 [7]

Answer:

Index Value Hash

0 1 $

1 2 $$

2 3 $$$

3 4 $$$$

4 5 $$$$$

Explanation:

8 0
3 years ago
Other questions:
  • A developer writes a trigger on the Account object on the before update event that increments a count field. A workflow rule als
    12·1 answer
  • Provide an example of a time in your personal or work life when you used the household measuring system and measured out an exac
    6·1 answer
  • Submit your 300-word essay describing the equipment usedI in a well-equipped studio’s audio department and the training and expe
    8·2 answers
  • Plllzzzzzzzzzzzzzz annnssswweeweerrr...
    6·1 answer
  • 11.
    9·2 answers
  • If you type too much text on a PowerPoint slide, the additional text is added to a second slide.
    9·1 answer
  • What is ambiguous grammar, explain in maximum 50words.
    5·1 answer
  • For safety, the lights on your vehicle must be in good working condition. Which statement about
    8·2 answers
  • Write a program that repeatedly shows the user a menu to select the shape form three main shapes or to print the shapes created
    15·1 answer
  • Write a program that allows a user to choose to roll between 1 and 100 dice between 1 and 1000 times
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!