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
Which programming language is good for 14 year old like me​
ddd [48]

Answer:

It would be Python code

Explanation:

4 0
3 years ago
Read 2 more answers
Write the output of the following program:
Iteru [2.4K]

Answer:

Expression A

Explanation:

In this Pseudocode, the output would be 100. This is because the code is looping from 1 to 20 and adding together all of the odd numbers between 1 and 20. Since it is checking to make sure that the remainder of each number is not equal to 0 which would indicate an odd number, and if it is odd then it adds it to the variable S. Therefore, the odd numbers between 1 and 20 are the following...

1 + 3 + 5 + 7 + 9 + 11 + 13 + 15 + 17 + 19 = 100

6 0
3 years ago
Portrait and Landscape are
ValentinkaMS [17]

Answer:

a page layout

Explanation:

6 0
3 years ago
With simple segmentation, a process is divided into a number of segments that need not be of equal size. When a process is broug
hoa [83]

Answer:

The missing word is <em>backing store.</em>

Explanation:

A backing store is a device for secondary storage of data that typically has greater capacity than the primary store but is slower to access.

A process must be loaded into memory in order to execute.

If there is not enough memory available to keep all running processes in memory at the same time, then some processes who are not currently using the CPU may have their memory swapped out to a fast local disk called the backing store.

The backing store may be the Hard Disk Drive or a Universal Serial Bus Drive.  The backing store can sometimes be referred to as <em>virtual memory.</em>

This memory that appears to exist as main storage although most of it is supported by data held in secondary storage, transfer between the two being made automatically as required.

Cheers!

4 0
3 years ago
Can you please provide sample rexx code?
Aleks04 [339]

Answer:

/*  My first REXX program  */

say 'Hello world'

Explanation:

REXX is an OS/2 scripting language.

7 0
3 years ago
Other questions:
  • Name format Many documents use a specific format for a person's name. Write a program whose input is: firstName middleName lastN
    14·2 answers
  • What is an image that you can apply to another image to add detail and texture?
    6·1 answer
  • What is an allocation unit?
    10·1 answer
  • Create a class called Home that contains 4 pieces of information as instance variables: county (datatype string), street (dataty
    5·1 answer
  • One out of how many people in the world has a Fac3book account?
    8·1 answer
  • What are the functions of online gaming communities?
    12·1 answer
  • Consider a short, 90-meter link, over which a sender can transmit at a rate of 420 bits/sec in both directions. Suppose that pac
    9·1 answer
  • While creating a digital portfolio, Harry wants to add documents that authenticate his skills, experience, and knowledge in digi
    11·1 answer
  • What is one example of an emerging class of software
    12·1 answer
  • Which of the following is a type of input device?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!