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
What is a computer memory <br>​
Alex_Xolod [135]

Answer:

In computing, memory is a device or system that is used to store information for immediate use in a computer or related computer hardware and digital electronic devices. The term memory is often synonymous with the term primary storage or main memory. An archaic synonym for memory is store.

5 0
3 years ago
Read 2 more answers
A communications objective is
Kazeer [188]

Answer:

They are used to identify your audience, craft messages and evaluate results. Communication Objectives are - as the name suggests – the process of setting targets for communication.Changing company or brand perceptions is another common communication objective.

Hope this helps! If so please mark brainliest and rate/heart to help my account

8 0
4 years ago
Notice that the iris.target array contains 3 different labels. Create a plot that you think is interesting using the data from t
Alexeev081 [22]

Answer:

from sklearn.datasets import load_iris

import seaborn as sns

import pandas as pd

data = load_iris()

final_data = data.data[:]

final_data = pd.DataFrame(final_data)

final_data.columns = ['SepalLengthCm', 'SepalWidthCm', 'PetalLengthCm', 'PetalWidthCm']

species = data.target[:]

final_data['Species'] = species

sns.pairplot(final_data, hue='Species')

Explanation:

8 0
3 years ago
What is the output of the following code: ​ for (loop = 1; loop &lt;3; ++loop) System.out.print(1); for (loop2 = 1; loop2&lt;3;
Mama L [17]

Answer:

The output of the given code as follows:

<u>Output: </u>

1122

Explanation:

In the given java code the two for loop is defined, which can be described as follows:

  • In the first loop, a"loop" variable is used, which starts from 1 and ends when the value of loop is less than 3, inside the loop a print function is used, that print value 1.
  • In the next step, another for loop is declared, inside the loop a variable "loop2" variable is used, that's working is the same as the above loop, but in this loop, it will print a value, that is 2.
7 0
3 years ago
Lenders always accept applications for credit
LenKa [72]
The correct answer to the question that is being stated above is FALSE.

The statement is false because lenders do not always accept applications for credit. Lenders always consider credit history of the applicant. If the applicant has a good credit history background, then he qualifies.
3 0
3 years ago
Other questions:
  • The most popular input device of a computer is a(n) ____.
    6·1 answer
  • Question 13 (6.67 points)
    7·1 answer
  • A display that is thin, flexible, light, and easy to read in all types of light is
    9·2 answers
  • Joshua needs to join in two cells together which of the following would perform the function
    14·1 answer
  • If you were looking for a record in a very large database and you knew the ID number, which of the following commands would be t
    10·1 answer
  • Digital subscriber lines: a. are very-high-speed data lines typically leased from long-distance telephone companies. b. operate
    5·1 answer
  • NO BODY KNOWS! How old is Cynthia Blaise!?
    7·1 answer
  • Which of the following could be true of two diffrent speicies that have competitieve realtionship in the same ecosytem?
    10·1 answer
  • What do you think entertainment or gaming platforms will look like in the future?
    9·1 answer
  • compare the two methods of creating table in ms access ( Datasheet view and Design view) which one wouldyou prefer to use to rec
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!