More detail in the attached: Instructions Write a program that useswhileloops to perform the following steps: Prompt the user to input two integers:firstNumandsecondNum (firstNummust be less...

1 answer below »


More detail in the attached:



Instructions


Write a program that useswhileloops to perform the following steps:



  1. Prompt the user to input two integers:firstNumandsecondNum


    • (firstNummust be less thansecondNum).


  2. Output all odd numbers betweenfirstNumandsecondNum.


    • Separate each number with a space


  3. Output the sum of all even numbers betweenfirstNumandsecondNum.

  4. Output the numbers and their squares between1and10.

  5. Output the sum of the square of the odd numbers betweenfirstNumandsecondNum.

  6. Output all uppercase letters.


    • Separate each letter with a space





Instructions Write a program that uses while loops to perform the following steps: 1. Prompt the user to input two integers: firstNum and secondNum · (firstNum must be less than secondNum). 2. Output all odd numbers between firstNum and secondNum. · Separate each number with a space 3. Output the sum of all even numbers between firstNum and secondNum. 4. Output the numbers and their squares between 1 and 10. 5. Output the sum of the square of the odd numbers between firstNum and secondNum. 6. Output all uppercase letters. · Separate each letter with a space This is what the run check looks for: Tasks 0.00 out of 10.00 while loops used 1 0 out of 1 checks passed. Review the results below for more details. Checks Code PatternIncomplete while loops used Description Searched your code for a specific pattern: \s*while\s*\(.+\) You can learn more about regular expressions [here](https://ruby-doc.org/core-2.1.1/Regexp.html). 0.00 out of 10.00 Accept user input (Part a) 2 0 out of 2 checks passed. Review the results below for more details. Checks Code PatternIncomplete Input firstNum (Part a) Description Searched your code for a specific pattern: cin.+firstNum You can learn more about regular expressions [here](https://ruby-doc.org/core-2.1.1/Regexp.html). Code PatternIncomplete Input secondNum (Part a) Description Searched your code for a specific pattern: cin.+secondNum You can learn more about regular expressions [here](https://ruby-doc.org/core-2.1.1/Regexp.html). 0.00 out of 10.00 Odd number output (Part b) 2 0 out of 2 checks passed. Review the results below for more details. Checks Test CaseIncomplete Odd number output (Part b) Input 4 36 Output Results 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 Show Details Test CaseIncomplete Odd number output case 2 (Part b) Input 987 1001 Output Results 987 989 991 993 995 997 999 1001 Show Details 0.00 out of 10.00 Sum of even numbers output (Part c) 2 0 out of 2 checks passed. Review the results below for more details. Checks Test CaseIncomplete Sum of even numbers output (Part c) Input 4 36 Output Results 340 Show Details Test CaseIncomplete Sum of even numbers output case 2 (Part c) Input 987 1001 Output Results 6958 Show Details 0.00 out of 10.00 Output 1-10 squared (Part d) 2 0 out of 2 checks passed. Review the results below for more details. Checks Test CaseIncomplete Output 1-10 squared (Part d) Input 4 36 Output Results 1 1 2 4 3 9 4 16 5 25 6 36 7 49 8 64 9 81 10 100 Show Details Test CaseIncomplete Output 1-10 squared case 2 (Part d) Input 987 1001 Output Results 1 1 2 4 3 9 4 16 5 25 6 36 7 49 8 64 9 81 10 100 Show Details 0.00 out of 10.00 Output sum of odd numbers squared (Part e) 2 0 out of 2 checks passed. Review the results below for more details. Checks Test CaseIncomplete Output sum of odd numbers squared (Part e) Input 4 36 Output Results 7760 Show Details Test CaseIncomplete Output sum of odd numbers squared case 2 (Part e) Input 987 1001 Output Results 7904456 Show Details Exercise 5-8
Answered 1 days AfterOct 22, 2021

Answer To: More detail in the attached: Instructions Write a program that useswhileloops to perform the...

Sathishkumar answered on Oct 24 2021
115 Votes
#include
#include
using namespace std;
int firstnum,secondnum;
int main()
{

int x=1;
while(x==1)
{
/*Question--1*/
cout << "Enter the first number: "<< endl;
cin >> firstnum;
cout << "Enter the second number: "<< endl;
cin >> secondnum;
/*Question--*/
cout << "Odd numbers in range of "<< firstnum << " and " << secondnum << endl; //// Odd number
for(int i = firstnum; i <= secondnum; i++)
{
    if ( i % 2 != 0 )
    {
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here