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
Everyone in a healthcare organization has the responsibility to prevent abuse and neglect from occurring no matter what his or h
Vsevolod [243]

Answer:

doctor

Explanation:

it is what it is

and he help patients

8 0
2 years ago
What is the advantage of learning through story compared to learning through personal experience?
Artemon [7]

Answer:

I think the answer would be D

Explanation:

it just seems to make the most sense

7 0
3 years ago
Read 2 more answers
Cual es la relacion existe entre TENGNOLOGIA y la PRODUCCION DE ENERGIA
andrezito [222]

Answer:

la tecnología tiene energía para hacer que los dispositivos funcionen, que es como los humanos y la energía. Los seres humanos usan energía, ¡la tecnología también usa energía!

Explanation:

ps. this is in english, my home language

technology has energy to make devices work, which is like humans and energy. human beings use energy, technology uses energy too!

5 0
3 years ago
Lisa as a grade 6 student, not only knows how to read and write but also, she can solve problems critically proven from quiz bee
noname [10]

Hi, your question isn't quite clear and complete. However, I made general inferences.

<u>Explanation:</u>

Spelling bees are competitions that involve asking several contestants are asked to spell certain words, which have a varying degree of difficulty. However, if it involves rephrasing the sentence. It could read;

'Lisa is a grade 6 student that knows how to read and write and she can also solve problems, such as quiz bees which she had participated in and won.'

4 0
3 years ago
FREEEEEEEEEEEEE FREEEEEEEEEEEEE Pointttssss​
Paul [167]

Answer:

Thx TYSM TYSM

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • Explain a business scenario where management information systems plays a part.
    11·1 answer
  • The conscious process of planning and controlling how you spend your time is called?
    15·1 answer
  • Which is the largest unit of measurement for computer data?
    14·1 answer
  • What is output by the following C# code segment?int temp;temp = 180;while ( temp != 80 ) {if ( temp &gt; 90 ) {Console.Write( "T
    7·1 answer
  • What is modularity? Help asap
    9·1 answer
  • When you open your word-processing program, it opens in a<br> field<br> menu
    9·2 answers
  • A company has three (3) components in a system and requires all three to be operational for 24 hours, Monday to Friday. Failure
    5·1 answer
  • Name the factors which of the following resources relate to :
    7·1 answer
  • 2+2? D: I don't knoww​
    12·1 answer
  • Q5: what is the difference between a spreadsheet and a relational database? when would you have to use a relational database ins
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!