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
yawa3891 [41]
3 years ago
12

Write a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less

than 100. End each prompt with a newline. Ex: For the user input 123, 395, 25, the expected output is:
Enter a number (<100):
Enter a number (<100):
Enter a number (<100):
Your number < 100 is: 25
c++

#include
using namespace std;

int main() {
int userInput = 0;

do
cout << "Your number < 100 is: " << userInput << endl;

return 0;
}
Engineering
1 answer:
chubhunter [2.5K]3 years ago
8 0

Answer:

#include <iostream>//including iostream library to use functions such as cout and cin

using namespace std;

int main() {

int userInput = 0;

do

{

 cout << "Enter a number < 100: " ;

 cin >> userInput;

 if (userInput < 100)//condition if number is less than 100

 {

  cout << "Your number < 100 is: " << userInput << endl;

 }

} while (userInput > 100);//do while loop condition

return 0;

}

Explanation:

A do-while loop executes regardless in the first iteration. Once it has run through the first iteration, it checks if the condition is being met. If, the condition is TRUE, the loop begins the second iteration. If FALSE, the loop exits. In this case, the condition is the userInput. after the first iteration, lets say the userInput is 120, the condition userInput > 100 is true.Therefore, the loop will run again until eventually the number is less than hundred, lets say 25. In that case the condition would be 25 > 100, which would be false, so the loops will break.

You might be interested in
Methane and oxygen react in the presence of a catalyst to form formaldehyde. In a parallel reaction, methane is oxidized to carb
Nezavi [6.7K]

Answer:

y_{CH_4}^2=\frac{5mol/s}{100mol/s}=0.05\\y_{O_2}^2=\frac{3mol/s}{100mol/s}=0.03\\y_{H_2O}^2=\frac{47mol/s}{100mol/s}=0.47\\y_{HCHO}^2=\frac{43mol/s}{100mol/s}=0.43\\y_{CO_2}^2=\frac{2mol/s}{100mol/s}=0.02

Explanation:

Hello,

a. On the attached document, you can see a brief scheme of the process. Thus, to know the degrees of freedom, we state the following unknowns:

- \xi_1 and \xi_2: extent of the reactions (2).

- F_{O_2}^2, F_{CH_4}^2, F_{H_2O}^2, F_{HCHO}^2 and F_{CO_2}^2: Molar flows at the second stream (5).

On the other hand, we've got the following equations:

- F_{O_2}^2=50mol/s-\xi_1-2\xi_2: oxygen mole balance.

- F_{CH_4}^2=50mol/s-\xi_1-\xi_2: methane mole balance.

- F_{H_2O}^2=\xi_1+2\xi_2: water mole balance.

- F_{HCHO}^2=\xi_1: formaldehyde mole balance.

- F_{CO_2}^2=\xi_2: carbon dioxide mole balance.

Thus, the degrees of freedom are:

DF=7unknowns-5equations=2

It means that we need two additional equations or data to solve the problem.

b. Here, the two missing data are given. For the fractional conversion of methane, we define:

0.900=\frac{\xi_1+\xi_2}{50mol/s}

And for the fractional yield of formaldehyde we can set it in terms of methane as the reagents are equimolar:

0.860=\frac{F_{HCHO}^2}{50mol/s}

In such a way, one realizes that the output formaldehyde's molar flow is:

F_{HCHO}^2=0.860*50mol/s=43mol/s

Which is equal to the first reaction extent \xi_1, therefore, one computes the second one from the fractional conversion of methane as:

\xi_2=0.900*50mol/s-\xi_1\\\xi_2=0.900*50mol/s-43mol/s\\\xi_2=2mol/s

Now, one computes the rest of the output flows via:

- F_{O_2}^2=50mol/s-43mol/s-2*2mol/s=3mol/s

- F_{CH_4}^2=50mol/s-43mol/s-2mol/s=5mol/s

- F_{H_2O}^2=43mol/s+2*2mol/s=47mol/s

- F_{HCHO}^2=43mol/s

- F_{CO_2}^2=2mol/s

The total output molar flow is:

F_{O_2}+F_{CH_4}+F_{H_2O}+F_{HCHO}+F_{CO_2}=100mol/s

Therefore the output stream composition turns out into:

y_{CH_4}^2=\frac{5mol/s}{100mol/s}=0.05\\y_{O_2}^2=\frac{3mol/s}{100mol/s}=0.03\\y_{H_2O}^2=\frac{47mol/s}{100mol/s}=0.47\\y_{HCHO}^2=\frac{43mol/s}{100mol/s}=0.43\\y_{CO_2}^2=\frac{2mol/s}{100mol/s}=0.02

Best regards.

7 0
3 years ago
You are working in a lab where RC circuits are used to delay the initiation of a process. One particular experiment involves an
Ymorist [56]

Answer:

t'_{1\2} = 6.6 sec

Explanation:

the half life of the given circuit is given by

t_{1\2} =\tau ln2

where [/tex]\tau = RC[/tex]

t_{1\2} = RCln2

Given t_{1\2} = 3 sec

resistance in the circuit is 40 ohm and to extend the half cycle we added new resister of 48 ohm. the net resitance is 40+48 = 88 ohms

now the new half life is

t'_{1\2} =R'Cln2

Divide equation 2 by 1

\frac{t'_{1\2}}{t_{1\2}} = \frac{R'Cln2}{RCln2} = \frac{R'}{R}

t'_{1\2} = t'_{1\2}\frac{R'}{R}

putting all value we get new half life

t'_{1\2} = 3 * \frac{88}{40}  = 6.6 sec

t'_{1\2} = 6.6 sec

7 0
3 years ago
Write a C++ program to display yearly calendar. You need to use the array defined below in your program. // the first number is
ddd [48]

Answer:

//Annual calendar

#include <iostream>

#include <string>

#include <iomanip>

void month(int numDays, int day)

{

int i;

string weekDays[] = {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"};

// Header print

      cout << "\n----------------------\n";

      for(i=0; i<7; i++)

{

cout << left << setw(1) << weekDays[i];

cout << left << setw(1) << "|";

}

cout << left << setw(1) << "|";

      cout << "\n----------------------\n";

      int firstDay = day-1;

      //Space print

      for(int i=1; i< firstDay; i++)

          cout << left << setw(1) << "|" << setw(2) << " ";

      int cellCnt = 0;

      // Iteration of days

      for(int i=1; i<=numDays; i++)

      {

          //Output days

          cout << left << setw(1) << "|" << setw(2) << i;

          cellCnt += 1;

          // New line

          if ((i + firstDay-1) % 7 == 0)

          {

              cout << left << setw(1) << "|";

              cout << "\n----------------------\n";

              cellCnt = 0;

          }

      }

      // Empty cell print

      if (cellCnt != 0)

      {

          // For printing spaces

          for(int i=1; i<7-cellCnt+2; i++)

              cout << left << setw(1) << "|" << setw(2) << " ";

          cout << "\n----------------------\n";

      }

}

int main()

{

int i, day=1;

int yearly[12][2] = {{1,31},{2,28},{3,31},{4,30},{5,31},{6,30},{7,31},{8,31},{9,30},{10,31},{11,30},{12,31}};

string months[] = {"January",

"February",

"March",

"April",

"May",

"June",

"July",

"August",

"September",

"October",

"November",

"December"};

for(i=0; i<12; i++)

{

//Monthly printing

cout << "\n Month: " << months[i] << "\n";

month(yearly[i][1], day);

if(day==7)

{

day = 1;

}

else

{

day = day + 1;

}

cout << "\n";

}

return 0;

}

//end

3 0
3 years ago
The mathematical relationship between
11Alexandr11 [23.1K]
4) Ohms law thats the answer
7 0
3 years ago
Which type of inappropriate practice most likely occurred if a researcher takes credit for someone else’s idea and does not ackn
Rashid [163]

Answer: the answer is plagiarism.

Explanation: Plagiarism is the act of taking credit from someone else's works or ideas, without acknowledging the author. <u>Conflict of interest</u> occurs when an employee has <u>interests that are at odds to each other</u>, which isn't shown at the excerpt given in the exercise. <u>Fabrication</u> is the <u>creation of intellectual property</u>, also not shown in the exercise, and <u>falsification</u> is the <u>creation of a scientific hypothesis</u> that <u>cannot be verified</u> by lack of practical evidence, which is not the case described as well.

7 0
3 years ago
Other questions:
  • A mysterious device found in a forgotten laboratory accumulates charge at a rate specified by the expression gm = 9 - 10tC from
    13·1 answer
  • A tire-pressure monitoring system warns you with a dashboard alert when one of your car tires is significantly under-inflated.
    6·1 answer
  • I WILL GIVE BRAINLIEST IF ANSWER FAST What is the measurement of this dial caliper?
    5·2 answers
  • Give an example of one technology that is well matched to the needs of the environment, and one technology that is not.
    9·1 answer
  • 1) What output force (Fout) is produced if the lever arm length (rout) is 100 mm?
    13·2 answers
  • Could I please get help with this​
    11·1 answer
  • Technician A says that acid core solder should be used whenever aluminum wires are to be soldered.
    14·1 answer
  • A spherical metal ball of radius r_0 is heated in an oven to a temperature of T_1 throughout and is then taken out of the oven a
    6·1 answer
  • EverFi future smart pie chart
    11·1 answer
  • 12. What procedure should you follow when taking measurements?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!