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]
2 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]2 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
Suppose that, even unrealistically, we are to search a list of 700 million items using Binary Search, Recursive (Algorithm 2.1).
damaskus [11]

Answer:

There is also an attachment below

Explanation:

Since we are talking about binary search, let's assume that the items are sorted according to some criteria.

Time complexity of binary search is O(logN) in worst case, best case and average case as well. That means it can search for an item in Log N time where N is size of the input. Here problem talks about the item not getting found. So, this is a worst case scenario. Even in this case, binary search runs in O(logN) time.

N = 700000000.

So, number of comparisions can be log(N) = 29.3 = 29.

So, in the worst case it does comparisions 29 times

7 0
3 years ago
What is a neuromorphic chip?
Dominik [7]

Answer:

A neuromorphic computer is a machine comprising many simple processors / memory structures (e.g. neurons and synapses) communicating using simple messages (e.g. spikes). ... Neuromorphic computing systems excel at computing complex dynamics using a small set of computational primitives (neurons, synapses, spikes).

Explanation:

The structure of neuromorphic computers makes them much more efficient at training and running neural networks. They can run AI models at a faster speed than equivalent CPUs and GPUs while consuming less power. This is important since power consumption is already one of AI's essential challenges.

3 0
2 years ago
In case of a suspected data breach, what course of action should a chief information security officer (CISO) take
guapka [62]

Answer

1. Assemble his team

2. Find reason for breach

3. Evaluate what was lost

4. Ensure password change

Explanation:

In case of a suspected breach, the Chief information security officer should first of all assemble his incidence response team. This team should have representatives from all areas of the organization.

Then the reason for the breach and how access was gained has to be found out. An evaluation of what has been lost in the breach would be carried out and it's likely impact on the company.

In case credentials were stolen the CISO has to ensure that the employees change passwords. Also he has to notify all the necessary parties about the breach.

The CISO has to ensure that all employees are trained properly on security and they comply to security policies.

7 0
3 years ago
Look at the following code.int x = 7;int *iptr = &x;What will be displayed if you send the expression *iptr to cout ? What h
masha68 [24]

Answer:

The answer to the given question can be given as:

The value of *iptr is 7. and the value of iptr is dynamic.

Explanation:

In the c++ code, it is defined that x is an integer variable that assigns a value which is 7. Then we define a pointer variable that is *iptr. This variable holds an address of the x variable. When we print the value of the iptr variable. if we use the expression *iptr to print value of the pointer variable by cout that is used in c++ for pint values. so the value of the iptr is 7. If we use the expression iptr sent to cout so we show the address of the variable x. In the pointer, it manages the addresses of dynamically allocated so the address of the variable is changed on execution time.

4 0
3 years ago
A user is troubleshooting a mobile device app that is displaying errors and has contacted the app manufacturer’s technical suppo
dlinn [17]

Answer:

The answer is "The user uses the method for retrieval, which is dependent on the specific app or devices on the operating system".

Explanation:

For retrieving the requested information of the form, with the user device, he uses the retrieval method, which is based upon the specific application or system operating system.

  • In this, the user can resolve the mobile phone application but also show the errors which have been committed to the assistance team of the application manufacturer.
  • Its repair technician requires detailed system data on the way the software responds and also what triggers the mistakes.
4 0
3 years ago
Other questions:
  • What is life all about?
    15·2 answers
  • If your address is 10 B Street, what are the first three bytes in ASCII
    12·1 answer
  • True or false.the color attribute cannot recognized the hexadecimal code.
    7·2 answers
  • Windows 1.0 was not considered to be a "true" operating system but rather an operating environment because _____.
    13·1 answer
  • To rename a database object, press and hold or right-click the object in the navigation pane and then tap or click ____ on the s
    10·1 answer
  • Which of the following statements are true?
    13·1 answer
  • Justice wrote a program and forgot to put the steps in the correct order. Which step does she need to review?
    5·2 answers
  • If the three operations were combined, O(logN) + O(N) * O(logN) + 1, the overall algorithm cost would be:________
    6·1 answer
  • What game is this?????????????????????
    15·1 answer
  • What is a file path?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!