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
Leni [432]
3 years ago
12

Write a program that uses while loops to perform the following steps: Step a: Prompt the user to input two integers: firstNum an

d secondNum (firstNum must be less than secondNum). Step b: Output all odd numbers between firstNum and secondNum. Step c: Output the sum of all even numbers between firstNum and secondNum. Step d: Output the numbers and their squares between 1 and 10. Step e: Output the sum of the square of the odd numbers between firstNum and secondNum. Step f: Output all uppercase letters.
Engineering
1 answer:
Elodia [21]3 years ago
8 0

Answer:

#include<iostream>  

using namespace std;  

int main()

{

    int i, sum = 0, sqSum = 0, firstNum = 1, secondNum = 0;

    char ch;

    while (!(firstNum < secondNum))

    {

         cout << "Enter starting number: ";

         cin >> firstNum;

    cout<<"Enter ending number(must be > startingNumber): ";

         cin >> secondNum;

    }

    i = firstNum;

    cout << "The odd numbers between " << firstNum

         << " and " << secondNum << " are:\n";

    while (i <= secondNum)

    {

         if (i % 2 == 0)

             sum = sum + i;

         else

         {

             cout << i << " ";

             sqSum = sqSum + i * i;

         }

         i++;

    }

    cout << "\n\nThe sum of the even numbers is:"

         << sum << endl << endl;

    cout << "The sum of squares the odd numbers is:"

         << sqSum << endl;

    i = 1;

    cout << "\nNumber Square\n";

    while (i <= 10)

    {

         cout << " " << i << "\t " << i * i << endl;

         i++;

    }

    system("pause");

    return 0;

}

You might be interested in
The cylinder C is being lifted using the cable and pulley system shown.
Sonja [21]

Answer:

sry but it's kinda hard

4 0
3 years ago
Describe a gear train that would transform a counterclockwise input rotation to a counterclockwise output rotation where the dri
masya89 [10]

Answer:

For a gear train that would train that transform a counterclockwise input into a counterclockwise output such that the gear that is driven rotates three times when the driver rotates once, we have;

1) The number of gears in the gear train = 3 gears with an arrangement such that there is a gear in between the input and the output gear that rotates clockwise for the output gear to rotate counter clockwise

2) The speed ratio of the driven gear to the driver gear = 3

Therefore, we have;

Speed \ Ratio =\dfrac{Speed \ of \ Driven \ Gear}{Speed \ of \ Driver \ Gear} = \dfrac{The \ Number \ of \ Teeth \ of \ Driver \ Gear}{The \ Number \ of \ Teeth \ of \ Driven \ Gear}

Therefore, for a speed ratio of 3, the number of teeth of the driver gear, driving the output gear, must be 3 times, the number of teeth of the driven gear

Explanation:

3 0
3 years ago
12. What procedure should you follow when taking measurements?
OlgaM077 [116]
I think the answer is b
8 0
2 years ago
A liquid refrigerant (sg=1,2) is flowing at a weight flow rate of 20,9 N/h. Refrigerant flashes into a vapor and its specific we
Iteru [2.4K]

Answer:

Explanation:

volume of 20.9 N

= 20.9 / 11.5 m³

= 1.8174 m³

In one hour 1.8174 m³ flows

in one second volume flowing = 1.8174 / 60 x 60

= 5 x 10⁻⁴ m³

Rate of volume flow = 5 x 10⁻⁴ m³ / s .

5 0
3 years ago
An inventor claims to have invented a heat engine that operates between the temperatures of 627°C and 27°C with a thermal effici
Oksana_A [137]

Answer Explanation:

the efficiency of the the engine is given by=1-\frac{T_2}{T_1}

where T₂= lower temperature

           T₁= Higher temperature

we have given efficiency =70%

lower temperature T₂=27°C=273+27=300K

higher temperature T₁=627°C=273+627=900K

efficiency=1-\frac{T_2}{T_1}

                =1-\frac{300}{900}

                 =1-0.3333

                 =0.6666

                 =66%

66% is less than 70% so so inventor claim is wrong

3 0
3 years ago
Other questions:
  • Which of the following is an example of seeking accreditation?
    7·1 answer
  • All of the following are categories for clutch covers except
    11·1 answer
  • When -iron is subjected to an atmosphere of hydrogen gas, the concentration of hydrogen in the iron, CH (in weight percent), is
    5·1 answer
  • Help me asap I rely need help u will be my fav​
    8·2 answers
  • What is applied technology?
    14·1 answer
  • Nitrogen (N2) enters an insulated compressor operating at steady state at 1 bar, 378C with a mass flow rate of 1000 kg/h and exi
    8·1 answer
  • Consider the function f(x)=/x/
    5·1 answer
  • A jointed arm robot can rotate on the following 6 axes?
    8·1 answer
  • Steam locomotives with a 4-6-2 wheel arrangement were usually classified as what?.
    5·1 answer
  • Whose responsibility is it to provide direction on correct ladder usage?<br> select the best option.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!