Question: Write a program that useswhileloops to perform the following steps: a. Prompt the user to input two positive integers. variables:firstNumandsecondNum(firstNummust be less thansecondNum). Validate the
Write a program that useswhileloops to perform the following steps:
a. Prompt the user to input two positive integers. variables:firstNumandsecondNum(firstNummust be less thansecondNum). Validate the user's input; prompt the user again iffirstNumis not less thansecondNum(use while loop).
b. Output all odd numbers betweenfirstNumandsecondNum.(use while loop).
c. Output the sum of all even numbers betweenfirstNumandsecondNum.(use while loop).
d. Output the numbers and their squares between 1 and 10.(use while loop).
e. Output the sum of the square of the odd numbers betweenfirstNumandsecondNum.(use while loop)
f. Output all uppercase letters. (use while loop).
Program layout:
int main()
{
//a
while()
{
}
//b
while()
{
}
//c
while()
{
}
//d
while()
{
}
//e
while()
{
}
//f
while()
{
}
}
***You assume that the user types only integer numbers.
***Do not use any pre-definedfunctions that were not covered in the class.
***Use only topics that were covered in the class.
***No object-oriented programming.
***Match the output below.
Submit your source code (file name is Assignment_08_yourLastName.cpp). Make sure that it compiles using Code::Blocks.
If it doesn't compile, you will lose 50%. Improper indentation: -20%
If it doesn't produce the required results: -30%
Do NOT compress the file.
**************************************************************************************
OUTPUTS:
**************************************************************************************
Enter two positive numbers. First number must be less than the second number: Enter numbers:8 2 First number must be less than the second number! Please try again.
Enter two positive numbers. First number must be less than the second number: Enter numbers:-2 8 No negative numbers! Please try again.
Enter two positive numbers. First number must be less than the second number: Enter numbers:2 8
Odd integers between2and8are: 3 5 7
Sum of even integers between2and8= 20
Number Square of Number 1 1 2 4 3 9 4 16 5 25 6 36 7 49 8 64 9 81 10 100
Sum of the squares of odd integers between2and8= 83
Upper case letters are: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
**************************************************************************************
Enter two positive numbers numbers. First number must be less than the second number you enter Enter numbers:1 9
Odd integers between1and9are: 1 3 5 7 9
Sum of even integers between1and9= 20
Number Square of Number 1 1 2 4 3 9 4 16 5 25 6 36 7 49 8 64 9 81 10 100
Sum of the squares of odd integers between1and9= 165
Upper case letters are: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
**************************************************************************************
Enter two positive numbers numbers. First number must be less than the second number you enter Enter numbers:11 15
Odd integers between11and15are: 11 13 15
Sum of even integers between11and15= 26
Number Square of Number 1 1 2 4 3 9 4 16 5 25 6 36 7 49 8 64 9 81 10 100
Sum of the squares of odd integers between11and15= 515
Upper case letters are: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
**************************************************************************************
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
