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
abruzzese [7]
2 years ago
14

3.34 LAB: Mad Lib - loops in C++

Computers and Technology
1 answer:
Ganezh [65]2 years ago
7 0

Answer:

A Program was written to carry out some set activities. below is the code program in C++ in the explanation section

Explanation:

Solution

CODE

#include <iostream>

using namespace std;

int main() {

string name; // variables

int number;

cin >> name >> number; // taking user input

while(number != 0)

{

// printing output

cout << "Eating " << number << " " << name << " a day keeps the doctor away." << endl;

// taking user input again

cin >> name >> number;

}

}

Note: Kindly find an attached copy of the compiled program output to this question.

You might be interested in
A blood bank maintains two tables - DONOR, with information about people who are willing to donate blood and ACCEPTOR, with info
Kipish [7]

Answer:

The sql query is given below.

Since we need to count of males and females for a particular blood group, we put xxx for the blood group.

SELECT COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "M%") as Male_Donors,

COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "F%") as Female_Donors

FROM DONOR

WHERE BG = xxx;

Explanation:

The clauses in the query are as follows.

1. SELECT: all the columns required in the output are put in this clause.

2. FROM JOIN ON: the table(s) from which the above columns are taken are put in this clause.

3. WHERE: any condition required to filter the output is put in this clause.

The query is explained below.

1. Find the number of male donors. Number of anything can be found using COUNT() function. A query is required since gender is included in deciding the type of donor.

2. The query is defined to find number of male donors as follows.

COUNT( SELECT DID FROM DONOR WHERE GENDER LIKE "M%"; )

3. In the previous query, LIKE operator is used since it is not defined what value is stored for male donors.

4. Similarly, the query to find the number of female donors is formed.

COUNT( SELECT DID FROM DONOR WHERE GENDER LIKE "F%"; )

5. Next, the final query is formed as follows.

SELECT: both COUNT() functions will come here.

FROM: table name

WHERE: specific blood group will be put here

GROUP BY: this clause is optional and is not used in this query.

HAVING: this clause is optional and is not used in this query.

6. The query after putting all clauses is shown below.

SELECT COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "M%"),

COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "F%")

FROM DONOR

WHERE BG = xxx;

7. Alias is used in the above query for each column to get the final query.

SELECT COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "M%") as Male_Donors, COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "F%") as Female_Donors

FROM DONOR

WHERE BG = xxx;

7 0
2 years ago
The navigation bar on the left side of ____ view contains commands to perform actions common to most office programs.
kondor19780726 [428]

Answer:

The navigation bar on the left side of File view  contains commands to perform actions common to most office programs.

Explanation:

It enable all kinds of operations such as opening a file, closing a file, saving the file, saving a file with a different name, listing recently opened document, etc.

The open option enable us to open an existing file, all the recent files will be listed in the recent option and there are no files opened newly or if the data are cleared often, then it will be empty.

A file can be opened and saved with the different name so that the recent change will be saved in the new file and there will be presence of existing file too.

4 0
2 years ago
Identifying Characters
alina1380 [7]
The answer is d I just took the test
5 0
2 years ago
Read 2 more answers
Fill in the blanks to make the print_prime_factors function print all the prime factors of a number prime factor is a number tha
fomenos

The answer & explanation for this question is given in the attachment below.

3 0
2 years ago
A 1.17 g sample of an alkane hydrocarbon gas occupies a volume of 674 mL at 28°C and 741 mmHg. Alkanes are known to have the gen
Nina [5.8K]

Answer:

C3H8

Explanation:

Step 1:

Data obtained from the question. This includes the following:

Mass of alkane = 1.17g

Volume (V) = 674 mL

Temperature (T) = 28°C

Pressure (P) = 741 mmHg.

Gas constant (R) = 0.08206 atm.L/Kmol

Step 2:

Conversion to appropriate unit.

For Volume:

1000mL = 1L

Therefore, 674mL = 674/1000 = 0.674L

For Temperature:

Temperature (Kelvin) = Temperature (celsius) + 273

Temperature (celsius) = 28°C

Temperature (Kelvin) = 28°C + 273 = 301K

For Pressure:

760mmHg = 1atm

Therefore, 741 mmHg = 741/760 = 0.975atm

Step 3:

Determination of the number of mole of the alkane..

The number of mole of the alkane can be obtained by using the ideal gas equation. This is illustrated below:

Volume (V) = 0.674L

Temperature (T) = 301K

Pressure (P) = 0.975atm

Gas constant (R) = 0.08206 atm.L/Kmol

Number of mole (n) =?

PV = nRT

n = PV /RT

n = (0.975 x 0.674)/(0.08206x301)

n = 0.0266 mole

Step 4:

Determination of the molar mass of the alkane.

Mass of alkane = 1.17g

Number of mole of the alkane = 0.0266mole

Molar Mass of the alkane =?

Number of mole = Mass/Molar Mass

Molar Mass = Mass/number of mole

Molar Mass of the alkane = 1.17/0.0266 = 44g/mol

Step 5:

Determination of the molecular formula of the alkane.

This is illustrated below:

The general formula for the alkane is CnH2n+2

To obtain the molecular formula for the alkane we shall assume n = 1, 2, 3 or more till we arrive at molar Mass of 44.

When n = 1

CnH2n+2 = CH4 = 12 + (4x1) = 16g/mol

When n = 2

CnH2n+2 = C2H6 = (12x2) + (6x1) = 30g/mol

When n = 3

CnH2n+2 = C3H8 = (12x3) + (8x1) = 44g/mol

We can see that when n is 3, the molar mass is 44g/mol.

Therefore, the molecular formula for the alkane is C3H8.

7 0
2 years ago
Other questions:
  • Why are digital calendars considered to be a convenient way to maintain a study schedule?
    10·2 answers
  • Python comes with ________ functions that have been already prewritten for the programmer.
    5·1 answer
  • Mark T for True and F for False. No single person or government agency controls or owns the Internet. The W3C is responsible for
    5·1 answer
  • Select the correct answer. Rachel needs to make a presentation on ethics and etiquettes in college. She has about 30 minutes to
    13·1 answer
  • Describe a situation involving making a copy of a computer program or an entertainment file of some sort for which you think it
    7·1 answer
  • Suppose that f is a function with a prototype like this: void f(________ head_ptr); // Precondition: head_ptr is a head pointer
    6·1 answer
  • Array A is not a heap. Clearly explain why does above tree not a heap? b) Using build heap procedure discussed in the class, con
    15·1 answer
  • Look at the following array definition:
    11·1 answer
  • Explain the emerging trends in microcomputer technology in relation to size​
    11·1 answer
  • Consider a disk that rotates at 3600 rpm. The seek time to move the head between adjacent tracks is 2 ms. There are 32 sectors p
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!