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 asymmetric roof truss is of the type used when a near normal angle of incidence of sunlight onto the south-facing surface AB
marysya [2.9K]

Answer:

Check the explanation

Explanation:

Kindly check the attached image below to see the step by step explanation to the question above.

6 0
4 years ago
If the dry-bulb temperature is 95°F and the wet-bulb temperature is also 78°F, what is the relative humid- ity? What is the dew
Sidana [21]

Answer:

Relative humidity 48%.

Dew point 74°F

humidity ratio 118 g of moisture/pound of dry air

enthalpy 41,8 BTU per pound of dry air

Explanation:

You can get this information from a Psychrometric chart for water, like the one attached.

You enter the chart with dry-bulb and wet-bulb temperatures (red point in the attachment) and following the relative humidity curves you get approximately 48%.

To get the dew point you need to follow the horizontal lines to the left scale (marked with blue): 74°F

for the humidity ratio you need to follow the horizontal lines but to the rigth scale (marked with green): 118 g of moisture/pound of dry air

For enthalpy follow the diagonal lines to the far left scale (marked with yellow): 41,8 BTU per pound of dry air

5 0
3 years ago
.............................................
Akimi4 [234]
....................................
5 0
3 years ago
3. Which of the following statements is false?
MrRa [10]

Answer: c.An accumulator is not used in a system with a receiver/dryer

Explanation:

In a refrigeration system, a condenser is used to transfer heat and this occurs from the refrigerant to the air or water.

Then, the refrigerant then condenses to liquid when the hear has been transferred.

We should note that the condenser is normally mounted in front of the radiator. The receiver/dryer is a storage tank for the liquid refrigerant from the condenser.

The statement that an accumulator is not used in a system with a receiver/dryer is not true. This is because, the accumulator gives protection to the compressor which helps to prevent the failure of the compressor.

Therefore, the answer is C.

7 0
3 years ago
What is polarized electrical receptacle used for
lidiya [134]

Answer:

they are used for electrical currents so that they can flow along the appropriate wires in the circuit

Explanation:

4 0
4 years ago
Other questions:
  • Work-producing devices that operate on reversible processes deliver the most work, and work-consuming devices that operate on re
    6·1 answer
  • A mixture of air and methane is formed in the inlet manifold of a natural gas-fueled internal combustion engine. The mole fracti
    14·1 answer
  • One gram of Strontium-90 has an activity of 5.3 terabecquerels (TBq), what will be the activity of 1 microgram?
    8·1 answer
  • The lower yield point for an iron that has an average grain diameter of 1 × 10–2 mm is 230 MPa. At a grain diameter of 6 × 10–3
    9·1 answer
  • A cylindrical specimen of brass that has a diameter of 20 mm, a tensile modulus of 110 GPa, and a Poisson’s ratio of 0.35 is pul
    15·2 answers
  • For the following circuit, V"#$=120∠30ºV.Redraw the circuit in your solution.a.(4) Calculate the total input impedance seen by t
    6·1 answer
  • The speed of sound is 1150 ft/s convert to mile/h
    7·1 answer
  • A battery provides electricity in the state of ?
    15·1 answer
  • SM Success Maker
    11·1 answer
  • The force of impact is
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!