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
A(n) ________ will clear all user data and setting changes, returning the device's software to the state it was in when it left
nika2105 [10]
Factory reset seems to be the best fit answer. This is a feature on most apple devices
7 0
2 years ago
True or false: Your digital footprint is all the information about you online that only you post. Group of answer choices
marta [7]

Answer:

Your correct answer is " True. "

4 0
3 years ago
Read 2 more answers
"In a web app, where is data usually stored? A. Mobile network B. Application storage C. Local computer D. Cloud storage"
ollegr [7]

Answer:

The answer is "Option C".

Explanation:

The local computer also refers to locally, it is a device, that is used by LAN. It is also called as a remote computer, in which all the data is stored in the main computer and accessible by protected password, and certain choices were wrong, which can be described as follows:

  • In option A, It is used in digital communication.
  • In option B, It is used in androids.
  • In option D, It is used to provides web services.
6 0
3 years ago
9. Government and corporate officials concerned about security threats do not bring their own cell phones or laptops when travel
tatuchka [14]

Answer:

True

Explanation:

It is known as Don-Not-Carry rules are implemmented to avoid

-Unauthorized full disk copies (it have been made while the laptop owner was out of the hotel room on overseas travel)

-Laptops steals

- Monitoring by third parties of wireless using.

3 0
3 years ago
Who is the father of computer​
r-ruslan [8.4K]

charles babbage is the father of computer's

3 0
3 years ago
Read 2 more answers
Other questions:
  • You would like to arrange the records alphabetically. You should _____.
    7·2 answers
  • In fiberoptic cable, the signal source is__________waves
    7·1 answer
  • The overall purpose of a food guide is________.
    11·1 answer
  • While in slide show mode, if you are not careful you can close the application by clicking the x on the menu bar. question 38 op
    12·2 answers
  • Haley is helping to choose members for a customer satisfaction team. Which
    6·1 answer
  • Which page in a web site do viewers usually see first?
    15·1 answer
  • Cable Internet access can be described with which feature?
    5·2 answers
  • Write a logical expression using only and, or and not that is equivalent to the Exclusive NOR (XNOR) gate on 2 inputs, called in
    15·1 answer
  • Open excel program then use the (IF) function to fill the column of (Expensive/Cheap) then save your
    9·1 answer
  • EDI, ________, smart cards, and digital certificates are designed to support safe and secure online transactions.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!