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
cupoosta [38]
3 years ago
11

If apples are currently $4.99 a dozen, create a program that will determine the cost of any number of apples. Make the cost of a

dozen apples a variable as well, so that it can easily be changed if the price of apples changes.
Computers and Technology
1 answer:
CaHeK987 [17]3 years ago
7 0

Answer:

Explanation:

The following code is written in Java, it takes the cost of a dozen apples as a variable (costPerDozen), it then asks the user for the total number of apples that is places in a variable called (numberOfApples). It then calculates the total cost of the apples by dividing the costPerDozen by 12 and then multiplying by the total nuumber of apples requested. Finally it prints out the total.

 public static void main(String[] args) {

       double costPerDozen = 4.99;

       Scanner input = new Scanner(System.in);

       System.out.println("How many apples would you want?");

       int numberOfApples = input.nextInt();

       double totalCost = (costPerDozen / 12) * numberOfApples;

       System.out.println("That will cost: " + totalCost);

   }

You might be interested in
What are some of the challenges that could arise from setting up a file management system on a computer?
son4ous [18]
It could glitch out or be hacked or deleted.
8 0
3 years ago
Which of the following is the best example of market censorship
Papessa [141]
To bleep it out! hopefully this helped
4 0
3 years ago
Read 2 more answers
You often insert your company's logo into a document you create.one way to make it easier for you to quickly insert it is to sav
eduard
Save the logo as a TEMPLATE.

A template is a pre-developed page layout in soft copy or hard copy used to make pages with the same pattern, style, or design.

In the above scenario, you can prepare a template with you logo in it and save it for future use. In the event that you need to create a new document, you only have to bring up the saved template and edit it with the new information that you need to type.

This way, you will not be hassled to manually add your logo to every new document you create.
5 0
3 years ago
Choose the correct term to complete the sentence
notka56 [123]

Answer:

popleft

Explanation:

5 0
3 years ago
Which item converts a high level language program to low level machine instruction?
vodomira [7]
The compiler translates each source code instruction into the appropriate machine language instruction, an
8 0
3 years ago
Other questions:
  • Identify the correct XHTML syntax for inserting an image as a hyperlink from the options provided. A. book.gif B. C. D.
    9·1 answer
  • What statement best describes Konrad Zuse?
    6·2 answers
  • Give 5 uses of software and hardware.
    15·1 answer
  • what type of machine is a ramp for wheelchairs? compound machine, mechanical, machine complex machine, simple machine
    15·2 answers
  • The master production schedule for Product A shows a need for 30 units, and Product B shows a need of 25 units. To manufacture a
    12·1 answer
  • ________ of Willa Catha present an unadorned picture oflife on the prairies of the Midwestern United States during the19th centu
    8·1 answer
  • The post-closing trial balance shows the balances of only the ____ accounts at the end of the period.
    12·1 answer
  • Write a program to find all integer solutions to the equation 4x + 3y -9z = 5 for values of x, y, and z between 0 to 100.
    11·1 answer
  • When you create a new database using --------- , the database includes prebuilt tables and forms which you can populate with dat
    15·1 answer
  • The chain of _____ documents that the evidence was under strict control at all times and no unauthorized person was given the op
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!