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
Absolute time would be most similar to :
mr Goodwill [35]
The absolute time would be most similar to a fact. It was theorised and in fact, approved by scientists as a scientific law which governs, according to Wikipedia, as a "<span>true and mathematical </span>time<span>, of itself, and from its own nature flows equably without regard to anything external, and by another name is called duration: relative, apparent and common </span><span>time."</span>
6 0
3 years ago
Evaluate each condition as to whether it is true or not.
ivann1987 [24]

Answer:

For the first one you have not met those requirements because you are still 16, for the second one you have met those requirements because you can either have a score over 30 (which you have 34) or be a valedictorian

Explanation:

Above

7 0
3 years ago
Converting terminology via computers is called
Vitek1552 [10]

Hi Bentley


Converting terminology via computers is called a Cryptography


I hope that's help !



5 0
3 years ago
Read 2 more answers
The _____ database structure is more flexible and stores data as well as instructions to manipulate the data.
Talja [164]

Answer:

Databace

Explanation:

5 0
3 years ago
Women make up 52 percent of the voting-age population and are more likely to vote, yet
NeX [460]
<span>Gender discrimination has been a prevalent issue that prevented a century of women not to participate.

Discrimination has become widespread nowadays ranging from gender discrimination, racial discrimination, work discrimination and many others.These types of discrimination are experienced by almost all people everyday without them even knowing it. Some discrimination lies behind a sweet smile and an accommodating eyes and in order to defend yourself against this discrimination you need to load up yourself of a lot of self confidence.</span>
3 0
3 years ago
Read 2 more answers
Other questions:
  • The rangevalidator object on a web form has a type property for identifying the type of data for the range, such as ____.​
    10·1 answer
  • Which framework can be used to develop cross-platform applications?
    13·1 answer
  • What are network operating systems
    8·1 answer
  • Complete method printPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 2, print "Too
    5·1 answer
  • Which of the following is not a component of Google Display ads' value proposition?
    9·1 answer
  • Page No.
    10·1 answer
  • ________________is a distribution of Linux Operating<br>system for desktop computers.<br>​
    15·1 answer
  • ____ is any technology that aids in gathering information about a person or organization without their knowledge.
    14·1 answer
  • your friend's parent's are worried about going over their budget for the month. Which expense would you suggest is NOT a need?
    11·1 answer
  • What is the official name of an application on a desktop or a laptop?.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!