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
Hoochie [10]
4 years ago
7

. Write a program name Eggs that declares four variables to hold the number of eggs produced in a month by each of four chickens

, and assign a value to each variable. Sum the eggs, then display the total in dozens and eggs. For example, a total of 127 eggs is 10 dozen and 7 eggs.
Computers and Technology
1 answer:
DaniilM [7]4 years ago
5 0

Answer:

// code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables

   int e1,e2,e3,e4;

   int tot,doz,rem_egg;

   cout<<"Enter the eggs given by first chicken:";

   // read the eggs given by first chicken

   cin>>e1;

   cout<<"Enter the eggs given by second chicken:";

   // read the eggs given by second chicken

   cin>>e2;

   cout<<"Enter the eggs given by third chicken:";

   // read the eggs given by third chicken

   cin>>e3;

   cout<<"Enter the eggs given by fourth chicken:";

   // read the eggs given by fourth chicken

   cin>>e4;

   // find total eggs

   tot=e1+e2+e3+e4;

   // find the dozens

   doz=tot/12;

   // remaining eggs

   rem_egg=tot%12;

   // print total eggs, dozen and remaining eggs

   cout<<"A total of "<<tot<<" eggs is "<<doz<<" dozen and "<<rem_egg<<" eggs.";

return 0;

}

Explanation:

Read the eggs given by four chickens and assign them to variables e1,e2,e3,e4 respectively.Then calculate the total eggs of all four chickens.After this find the dozen by dividing the total eggs with 12.To find the remaining eggs after the dozen and assign it to variable "rem_egg".Print the total eggs, dozen and remaining eggs.

Output:

Enter the eggs given by first chicken:40

Enter the eggs given by second chicken:23                                                                                  

Enter the eggs given by third chicken:55

Enter the eggs given by fourth chicken:60

A total of 178 eggs is 14 dozen and 10 eggs.

You might be interested in
Those persons with little in the way of hacking skills that can access and use powerful hacking tools are called _______________
KIM [24]

Answer:

Script Kiddies or "Skiddies"

Explanation:

A script kiddie, or “Skiddie,” is someone who lacks programming knowledge and uses existing software to launch an attack. Often a script kiddie will use these programs without even knowing how they work or what they do. They begin playing with the various programs while searching for online tutorials. At first, they may be perceived as nothing more than an internet troll or noob, due to their lack of experience and quickness to brag and boast. Sometimes they will even resort to cyber stalking or bullying. However , this may simply be a cover for other more nefarious activity.

3 0
4 years ago
What is a path and how do you know that it is filled and selected
Shkiper50 [21]

Explanation:

A path represents a selected editing area of an image, this feature is typically available when using Adobe Photoshop software.

For example, a photographer may select the entire face area of his subject as his path (work path). To know when it is filled the photographer observes to see when the colour changes or other changes are applied to the background layer of the selected path.

8 0
3 years ago
Which statement about the subject line is true? The subject line can be found just below the message box. The subject line is ma
charle [14.2K]
Filling in the subject line is optional, but it is a good practice.
5 0
4 years ago
Read 2 more answers
Who do you like more?<br><br>Lolbit<br><br>-or-<br><br>Mangle
PolarNik [594]

Answer: lolbit

Explanation: she is my glitchy idol along with the shadows and Mr. Afton's cult.

8 0
3 years ago
Read 2 more answers
List the components of a typical operating system and summarize the role of each in a single phrase.
yanalaym [24]

Answer:

The answer is below

Explanation:

There are several components of operating systems, this may be based on the specific types of Operating systems. However, here are some of the major components.

1. Kernel: it delivers the primary level of control on all the computer peripherals.

2. Process Execution: it serves as a connection between the hardware and application program

3. Interrupt: it provides a dependable technique for the OS to transmit & respond to their surroundings.

4. Memory Management: it regulates main memory and then moves processes between disk & main memory during implementation.

5. Multitasking: it interprets the activities of many independent computer programs on a similar computer system.

6. Networking: it defines the interaction of processor through communication lines

7. Security: it protects the activities of other processes going in the system

8. User Interface: it provides permission for a computer operator to get the information.

3 0
3 years ago
Other questions:
  • Write a program to output the following quote by Edsger W. Dijkstra: "Computer Science is no more about computers than astronomy
    9·2 answers
  • if you want to present slide to fellow student or co-workers, wich productivity software should you use to create them?
    7·1 answer
  • Under the Right to Know Rule, employers need to include information on which one of the following in a written and complete haza
    5·1 answer
  • How do you make electricity
    10·1 answer
  • Which one of the following will not be considered as a microcomputer?
    12·2 answers
  • Clicking this would navigate among different worksheets
    14·1 answer
  • What is computer science
    6·2 answers
  • Gina, an IT professional, noticed that the servers were running very slowly. She evaluated the system and made a recommendation
    9·2 answers
  • Sort the layout options for two types of masters in PowerPoint.
    5·1 answer
  • What is e banking effects
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!