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
The number of bytes in an array is always a multiple of the number of ____ in an array.
liq [111]

Answer:

The Correct answer for the given question is "elements " .

Explanation:

The number of bytes is always multiple by the number of array elements in an array to getting total memory occupy by any array .

For example :

int a[100];

Since in c language int is 2 bytes

So memory in number of bytes =2*100=200 bytes

Indexes is keep the track of physical location of any file this is also used to track the logical location of file in database so this option is wrong

Subscripts are the index number of an array so we will never used subscripts to getting total memory occupy by any array so this option is wrong

Iterators  are the loop so this option is wrong.

Due to this the correct answer is elements.

4 0
4 years ago
Good Morning! Please Help!
vova2212 [387]

Answer:

cyber bullying

rights

technology

speech

education

study

issues

Explanation:

4 0
3 years ago
This decision control structure enables the program to execute a statement or block of codes if and only if the Boolean expressi
eduard

Answer:

Both if-then and switch is the decision control structure that enables the program to execute a statement or block of codes

Explanation:

This decision control structure always checks for one or more condition and execute true statement “if the condition is true” otherwise it will execute false statement (if present). The “true statement” is compulsory.

In case of “if-then loop”, it executes the true block only if the Boolean expression is true. In a similar way in switch-case, the same happens and instead of else part there will be a “default” statement which is compulsory to be present and it will get executed.

8 0
3 years ago
In order to communicate between devices inside a computer?
labwork [276]
Seems to be a CPU, central processing unit

Handles transactions between on-board memory, as well as I/O (input/output) devices.
4 0
3 years ago
Hot five was the famous band of which musician?
slega [8]
Hot Five was Louis Armstrong's first recording jazz band.
4 0
4 years ago
Other questions:
  • A folder window shows you he contents of the folder
    8·1 answer
  • In nutanix command-line interface (ncli) commands, each entity has a unique set of actions, but a common action across all entit
    15·1 answer
  • Create a script that asks for the visitor's weight in pounds and his/her height in inches. The program should then calculate the
    13·1 answer
  • Is a small file that a web server writes to the disk drive of the client computer, containing information about the user?
    8·1 answer
  • What is DBMS software used for?
    5·1 answer
  • Discuss the 21 st century competencies or skills required in the information society and 4 ways you can apply it during supporte
    6·1 answer
  • After an attacker has successfully gained remote access to a server with minimal privileges, which of the following is their nex
    15·1 answer
  • Which statement about bump mapping and normal mapping is true?
    9·1 answer
  • O
    14·1 answer
  • if a manager identifies numerous data integrity issues, she/he should consider the reports generated from that data as invalid a
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!