answer.
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
kenny6666
1 month ago
6

Meadowdale Dairy Farm sells organic brown eggs to local customers. It charges $3.25 for a dozen eggs, or 45 cents for individual

eggs that are not part of a dozen. Write a program that prompts a user for the number of eggs in the order and then display the amount owed with a full explanation. For example, typical output might be, You ordered 27 eggs. That’s 2 dozen at $3.25 per dozen and 3 loose eggs at 45 cents each for a total of $7.85. Save the program as Eggs.java.
Computers and Technology
1 answer:
ivann1987 [982]1 month ago
7 0

Response:

Clarification:

import java.Util;

public class Eggs{

public static void main (String [] args)

{

int eggCount, dozens, remainingEggs;

float finalAmount;

Scanner scanner = new Scanner(System.in);

eggCount = scanner.nextInt();

if(eggCount < 0)

{

System.out.print("Invalid");

}

else

{

if(eggCount >= 12)

{

dozens = eggCount/12;

remainingEggs = eggCount % 12;

}

else

{

dozens = 0;

remainingEggs = eggCount;

}

finalAmount = dozens * 3.25 + (remainingEggs * 45)/100;

System.out.print("You have ordered "+eggCount+" eggs.\n");

System.out.print("This amounts to "+dozens+" dozen at $3.25 each and "+remainingEggs+" loose eggs at 45 cents each, totaling $"+finalAmount);

}

}

}

You might be interested in
How concerned are you about the security of rtos in cars smart homes and wearable technology?
Harlamova29_29 [950]
Not to concerned where it worry’s me but technology can break down
5 0
1 month ago
PLEASE HELP!!~~
Rzqust [962]

Response:

A

Rationale:

7 0
1 month ago
The part of the computer that contains the brain, or central processing unit, is also known as the A.monitor B.modem C.keyboard
Harlamova29_29 [950]
<span>The portion of the computer that houses the brain, or central processing unit, is referred to as the System Unit. The CPU is crucial as it serves as the main element within the computer. Without the CPU, no calculations occur. It instructs the entire computer system to execute the stored program instructions.</span>
5 0
1 month ago
What are the 2 things you are not sure about evaluating functions​
oksian1 [849]

Answer:

everything

Explanation:

6 0
1 month ago
Read 2 more answers
Allison wants to use equations to simplify the process of explaining something to the Sales team, but the default eq
ivann1987 [982]

Response:

Look for a solution that meets her requirements

Clarification:

Various strategies exist for problem-solving, with the method chosen depending on how the problem is defined. Not every process can be expressed with mathematical equations; some are theoretical and can be clarified using simple logic.

If Allison can't find suitable equations among the standard options, she might create one that addresses the ongoing process. If she can't devise such an equation, other suitable methods should be utilized to convey the necessary concept to the team.

7 0
16 days ago
Read 2 more answers
Other questions:
  • Which of the following is true of how computers represent numbers?
    9·2 answers
  • Assume that getPlayer2Move works as specified, regardless of what you wrote in part (a) . You must use getPlayer1Move and getPla
    14·1 answer
  • 3. Megan and her brother Marco have a side business where they shop at flea markets, garage sales, and estate
    9·1 answer
  • Your revenue is $22,000. Your Cost of Goods is 16,250. Your gross profit is _____________, fill in the blank,.
    14·1 answer
  • Consider a load-balancing algorithm that ensures that each queue has approximately the same number of threads, independent of pr
    14·1 answer
  • Sara is writing a program to input her monthly phone bills and output the month name and amount for the month with maximum amoun
    7·1 answer
  • Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, a
    10·1 answer
  • Which of the following is opened when the Find command is clicked?
    12·1 answer
  • Write a program in pascal to find the area of a circle
    14·1 answer
  • A 2-dimensional 3x3 array of ints, has been created and assigned to tictactoe. Write an expression whose value is true if the el
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!