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
dsp73
3 years ago
15

Write a program that uses for loops to perform the following steps: Prompt the user to input two integers: firstNum and secondNu

m (firstNum must be less than secondNum). Output all odd numbers between firstNum and secondNum. Output the sum of all even numbers between firstNum and secondNum. Output the numbers and their squares between 1 and 10. Separate the numbers using any amount of spaces. Output the sum of the square of the odd numbers between firstNum and secondNum. Output all uppercase letters.

Computers and Technology
1 answer:
Artist 52 [7]3 years ago
6 0

Answer:

//Include the required header files.

#include<iostream>

using namespace std;

//Define the main function.

int main()

{

//Define the variables.

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

char ch;

//Check for valid input.

while (!(firstNum < secondNum))

{

cout << "Enter starting number: ";

cin >> firstNum;

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

cin >> secondNum;

}

//Store first number in i

i = firstNum;

//Dispaly the number.

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

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

//Iterate between first and second number.

while (i <= secondNum)

{

//Check for even numbers.

//Store the sum

if (i % 2 == 0)

sum = sum + i;

//Print the odd numbers

//Evaluate the square of sum of odd number.

else

{

cout << i << " ";

sqSum = sqSum + i * i;

}

//Increase the value of i.

i++;

}

//Dispaly the sum of even numbers.

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

<< sum << endl << endl;

//Dispaly the sum of square of odd number.

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

<< sqSum << endl;

//Set i to 1.

i = 1;

//Dispaly the message.

cout << "\nNumber Square\n";

//Iterate and print number between 1 andd 10

//along with the sum.

while (i <= 10)

{

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

i++;

}

//USe for visual studio.

system("pause");

//Return the value 0.

return 0;

}

Explanation:

The program code will perform the function listed below using loop.

Prompt the user to input two integers: firstNum and secondNum (firstNum must be less than secondNum). Output all odd numbers between firstNum and secondNum. Output the sum of all even numbers between firstNum and secondNum. Output the numbers and their squares between 1 and 10. Separate the numbers using any amount of spaces. Output the sum of the square of the odd numbers between firstNum and secondNum. Output all uppercase letters.

Check the attachment for its output and program screenshot.

You might be interested in
Cloud vendors that are hosting hardware, operating system, database, and other software, which clients can then use to build the
iren2701 [21]

Answer:

a. Software as a Service.

Explanation:

These Cloud vendors are said to be providing Software as a Service. This is because regardless of that the underlying specs are in regards to hardware, operating systems, database, etc. The vendor is selling a subscription to their cloud software which bundles all of these services together. Therefore, what they are ultimately providing is a Software that the individual can use as a service, and enjoy all of the included benefits/capabilities.

8 0
3 years ago
In a transaction-processing system (TPS), if the TPS database can be queried and updated while the transaction is taking place,
neonofarm [45]

Answer:

Real time

Explanation:

Real-time data processing is the execution of data in a short time period, providing near-instantaneous output. The processing is done as the data is inputted, so it needs a continuous stream of input data in order to provide a continuous output.

6 0
2 years ago
A condensing oil furnace operates at a higher efficiency because part of the heat output is:________
mario62 [17]

Because some of the heat produced by a condensing oil furnace is latent heat, it functions more efficiently.

<h3>Is the capacity of an oil furnace expressed in input or output?</h3>

The steady-state heat output of the furnace, expressed in BTU/h, is known as the heating (bonnet) capacity of oil heating appliances. Today's typical oil-fired central heating units for residential use have heating capacity ranging from 56,000 to 150,000 BTU/h.

<h3>What unit of heat is the capacity of an oil furnace stated in?</h3>

The amount of heat (Btu per gallon) released during the combustion process, in which the oxygen from the air combines with the hydrogen and carbon in the fuel, is how a fuel oil's heat of combustion value is expressed.

To learn more about condensing oil furnace and heating (bonnet) capacity, Visit:

<u>brainly.com/question/14783076</u>

#SPJ4

4 0
1 year ago
Suppose that TCP's current estimated values for the round trip time (estimatedRTT) and deviation in the RTT (DevRTT) are 400 mse
Masja [62]

Answer:

617.5 msecs, 580.89 msecs, 582.36 msecs

Explanation:

Lets look at the following formulas:

EstimatedRTT = α * SampleRTT+(1- α) * EstimatedRTT

DevRTT = β * | SampleRTT- EstimatedRTT|+(1- β)* DevRTT

TimeoutInterval = EstimatedRTT +4* DevRTT

Given values are:

EstimatedRTT = 400 msec

DevRTT = 25 msec

α = 0.125

β = 0.25

After the first RTT estimate: (210)

EstimatedRTT = 0.125 * 210 + (1 - 0.125) * 400 = 376.25 msecs

DevRTT = 0.25 * |210 - 376.25| + (1 - 0.25) * 25 = 60.3125 msecs

TimeoutInterval = 376.25 + 4 * 60.3125 = 617.5 msecs

After the second RTT estimate: (400)

EstimatedRTT = 0.125 * 400 + (1 - 0.125) * 376.25 = 379.218 msecs

DevRTT = 0.25 * |400 - 379.218| + (1 - 0.25) * 60.3125 = 50.42 msecs

TimeoutInterval = 379.218 + 4 * 50.42 = 580.89 msecs

After the third RTT estimate: (310)

EstimatedRTT = 0.125 * 310 + (1 - 0.125) * 379.218 = 370.56 msecs

DevRTT = 0.25 * |310 - 370.56| + (1 - 0.25) * 50.42 = 52.95 msecs

TimeoutInterval = 370.56 + 4 * 52.95 = 582.36 msecs

5 0
3 years ago
Write a script to check command arguments (3 arguments maximum). Display the argument one by one. If there is no argument provid
serious [3.7K]

Answer:-args (

if:args=true

-cont

if:args=false

-cont investigating

if:args=irrelevance

-loop restate args

)

compile exec

Explanation:

7 0
3 years ago
Other questions:
  • A (blank) is a way for students to keep track of information during research
    7·2 answers
  • In cell B12, enter a formula to calculate the amount budgeted for Mileage to/from Airport. The amount is based on the Mileage Ra
    6·1 answer
  • Can a spreadsheet be filtered only by one column at a time?
    11·1 answer
  • The ____ criteria filter requires the records displayed to start with the specified text string
    14·1 answer
  • . ____________is/are the JSP ImplicitObject(s).sessionapplicationconfigAll of GivenNone of Given
    9·1 answer
  • Multiple Choice
    7·1 answer
  • Hamad wants to get a car from the used car market. He was shared by the car dealer with list of estimated prices of different mo
    6·1 answer
  • Discuss the impact printer and its types in detail?
    7·1 answer
  • Quired to the weight
    12·1 answer
  • Where would you click to see the list of microsoft word styles?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!