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
For laminar flow over a hot flat plate, the local heat transfer coefficient decreases with distance because (select all that are
kotegsom [21]

Answer:

B. The thickness of the heated region near the plate is increasing.

Explanation:

First we know that, a boundary layer is the layer of fluid in the immediate vicinity of a bounding surface where the effects of viscosity are significant. The fluid is often slower due to the effects of viscosity. Advection i.e the transfer of heat by the flow of liquid becomes less since the flow is slower, thereby the local heat transfer coefficient decreases.

From law of conduction, we observe that heat transfer rate will decrease based on a smaller rate of temperature, the thickness therefore increases while the local heat transfer coefficient decreases with distance.

3 0
3 years ago
Discuss 7 habits of highly effective people and how important are ethics in today's society​
kompoz [17]

Answer:

Explanation:

The 7 Habits of Highly Effective People, is a book written and first published in 1989. It is a business and self-help book that was written by Stephen Covey. The seven habits include

Being proactive

Starting anything with the end in mind

First things first

Always thinking towards a win-win situation

Seeking initially to understand, then going on to want to be understood

Synergize, and lastly

Growing

7 0
3 years ago
Points for free
gulaghasi [49]

Answer:

THANK YOUUUUU!!!!!

Explanation:

3 0
2 years ago
Read 2 more answers
As a general rule of thumb, in-line engines are easier to work on than the other cylinder arrangements.
siniylev [52]

Answer:

The general rule of thumb is that the SMALLER a substance's atoms and the STRONGER the bonds, the harder the substance. Two of the strongest forms of chemical bonds are the ionic and covalent bonds.

Explanation:

5 0
2 years ago
A rigid, well-insulated tank of volume 0.9 m is initially evacuated. At time t = 0, air from the surroundings at 1 bar, 27°C beg
Eva8 [605]

Answer:

\dot{w}= -0.303 KW

Explanation:

This is the case of unsteady flow process because properties are changing with time.

From first law of thermodynamics for unsteady flow process

\dfrac{dU}{dt}=\dot{m_i}h_i+\dot{Q}-\dot{m_e}h_i+\dot{w}

Given that tank is insulated so\dot{Q}=0 and no mass is leaving so

\dot{m_e}=0

\int dU=\int \dot{m_i}h_i\ dt-\int \dot{w}\ dt

m_2u_2-m_1u_1=(m_2-m_1)h_i- \dot{w}\Delta t

Mass conservation m_2-m_1=m_e-m_i

m_1,m_2 is the initial and final mass in the system respectively.

Initially tank is evacuated so m_1=0

We know that for air u=C_vT ,h=C_p T,P_2v_2=m_2RT_2

m_2=0.42 kg

So now putting values

0.42 \times 0.71 \times 730=0.42\times 1.005\times 300- \dot{w} \times 300

\dot{w}= -0.303 KW

3 0
3 years ago
Other questions:
  • An excavation is at risk for cave-in and water accumulation because of the excess soil that has accumulated. What type of excava
    12·1 answer
  • 1. A thin plate of a ceramic material with E = 225 GPa is loaded in tension, developing a stress of 450 MPa. Is the specimen lik
    14·1 answer
  • Air modeled as an ideal gas enters a turbine operating at steady state at 1040 K, 278 kPa and exits at 120 kPa. The mass flow ra
    12·1 answer
  • A force of 16,000 will cause a 1 1 bar of magnesium to stretch from 10 to 10.036 . Calculate the modulus of elasticity in . (Ent
    6·1 answer
  • Refrigerant-134a enters the expansion valve of a refrigeration system at 120 psia as a saturated liquid and leaves at 20 psia. D
    15·1 answer
  • Does an electronic clock use electrical energy?​
    10·2 answers
  • A steam power plant is represented as a heat engine operating between two thermal reservoirs at 800 K and 300 K. The temperature
    14·1 answer
  • Drivers education :Anything that draws your mind off driving is
    9·1 answer
  • How frequently should vehicle registration be renewed?
    6·1 answer
  • 3. (5%) you would like to physically separate different materials in a scrap recycling plant. describe at least one method that
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!