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 is the key function of a sales team?
Marianna [84]

Answer:

C

Explanation:

best option for the available answers

3 0
4 years ago
Your dive computer indicates you need to make a mandatory decompression stop. You buddy's dive computer does not. You should: A.
Sati [7]

Answer: Option C : Make a decompression stop that splits the difference between what your buddy's computer requires and what yours does.

Explanation:

Dive computers are battery-powered computers within a watertight and pressure resistant case. These computers track the dive profile by measuring time and pressure.

hence, making a decompression stop that splits the difference between what your buddy's computer requires and what yours does is the best option.

7 0
4 years ago
How to type the plus sign +
zmey [24]

Answer:

you just did it. its on da keyboard

Explanation:

hold shift and click the equal sign

Shift + = = +

7 0
2 years ago
Read 2 more answers
Write javadoc comments for each of the 7 static methods you just wrote. They should include: a. A one line summary of what the m
Inga [223]

Answer:

In general, the Javadoc comments are code documentation that offer brief description of a segment of code (e.g. purpose, required input parameter and output)

A sample Javadoc comments is given below:

/**

* Calculate average of a list of number.

* @param myArray -  a list of floating point numbers

*  @return result -  the calculated average of the list of numbers in the array

*/

public static double getAverage(double myArray[] )

{

    // some codes to calculate average

    return result

}

The sample format of the Javadoc above can be applied to document various Java program code.

5 0
3 years ago
An array can store integers and doubles together.true or false
Anna [14]

Answer:

False

Explanation:

An array stores a sequence of values that are all of the same type

7 0
3 years ago
Other questions:
  • By default, a word document generally displays in ____ view.
    9·1 answer
  • Alison wants to add her company name at the bottom of every page in her document. Which option should she use?
    11·2 answers
  • While using the CLI on a Windows 10 64-bit computer with a single HDD and a single volume, you want to move from the current dir
    15·1 answer
  • Fourlotts Corp. provide integrated services that include storing manufactured goods, packaging, and delivering it to the dealers
    13·1 answer
  • -Convert the 1's complement 10111010 to decimal
    15·2 answers
  • Ask the user to input an integer. Print out the next three consecutive numbers.
    12·1 answer
  • You are implementing a RAID storage system and have found a system with eight 100 GB drives. How much storage space will you hav
    5·1 answer
  • Patrick manages the cloud services that are used by a small hospital system. He knows that there are a lot of laws and regulatio
    9·1 answer
  • Big data are used to _____. Select 3 options.
    5·1 answer
  • True or False? Security code is almost always open source!<br> True<br> False
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!