Write a complete program that: 1. Prompts the user for a startingNumber and reads the startingNumber into an integer. 2. Checks (1) for input failure, if input failure occurs an error should be output and the program should exit. 3. Prompts the user for an endingNumber and reads the endingNumber into an integer. 4. Checks (3) for input failure, if input failure occurs an error should be output and the program should exit. 5. Verifies that startingNumber < endingNumber. If not an error should be output. 6. Prompts the user for an increment and reads the increment into an integer. 7. Checks (6) for input failure, if input failure occurs an error should be output and the program should exit. Prints out numbers in the following manner: 8. а. Print startingNumber. b. Increment startingNumber by increment. Continue from (a) until startingNumber > endingNumber. с.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Write in C++

**Program Instructions**

Create a complete program that performs the following steps:

1. **Prompt for startingNumber:**
   - Ask the user to provide a `startingNumber`.
   - Convert this `startingNumber` into an integer.

2. **Check for input failure for startingNumber:**
   - Validate the input for `startingNumber`.
   - If there is an input failure, display an error message and terminate the program.

3. **Prompt for endingNumber:**
   - Ask the user to provide an `endingNumber`.
   - Convert this `endingNumber` into an integer.

4. **Check for input failure for endingNumber:**
   - Validate the input for `endingNumber`.
   - If there is an input failure, display an error message and terminate the program.

5. **Verify the relationship between startingNumber and endingNumber:**
   - Confirm that `startingNumber` is less than or equal to `endingNumber`.
   - If this condition is not met, display an error message.

6. **Prompt for increment:**
   - Ask the user to provide an `increment`.
   - Convert this `increment` into an integer.

7. **Check for input failure for increment:**
   - Validate the input for `increment`.
   - If there is an input failure, display an error message and terminate the program.

8. **Output numbers in sequence:**
   - Begin by printing the `startingNumber`.
   - Increment `startingNumber` by the `increment`.
   - Repeat this process until `startingNumber` exceeds `endingNumber`.
Transcribed Image Text:**Program Instructions** Create a complete program that performs the following steps: 1. **Prompt for startingNumber:** - Ask the user to provide a `startingNumber`. - Convert this `startingNumber` into an integer. 2. **Check for input failure for startingNumber:** - Validate the input for `startingNumber`. - If there is an input failure, display an error message and terminate the program. 3. **Prompt for endingNumber:** - Ask the user to provide an `endingNumber`. - Convert this `endingNumber` into an integer. 4. **Check for input failure for endingNumber:** - Validate the input for `endingNumber`. - If there is an input failure, display an error message and terminate the program. 5. **Verify the relationship between startingNumber and endingNumber:** - Confirm that `startingNumber` is less than or equal to `endingNumber`. - If this condition is not met, display an error message. 6. **Prompt for increment:** - Ask the user to provide an `increment`. - Convert this `increment` into an integer. 7. **Check for input failure for increment:** - Validate the input for `increment`. - If there is an input failure, display an error message and terminate the program. 8. **Output numbers in sequence:** - Begin by printing the `startingNumber`. - Increment `startingNumber` by the `increment`. - Repeat this process until `startingNumber` exceeds `endingNumber`.
**Instructions for Counting with Increments**

1. **Enter a Starting Number:**
   - **Value Entered:** 0

2. **Enter an Ending Number:**
   - **Value Entered:** 10

3. **Enter a Value to Increment By:**
   - **Value Entered:** 1

**Output Sequence:**
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

In this exercise, the user learns how to generate a sequence of numbers by specifying a starting point, an endpoint, and a specific increment value. Here, the sequence starts at 0 and ends at 10, with each number increasing by 1. This is a fundamental concept in programming and mathematics, aiding in understanding loops and iterations.
Transcribed Image Text:**Instructions for Counting with Increments** 1. **Enter a Starting Number:** - **Value Entered:** 0 2. **Enter an Ending Number:** - **Value Entered:** 10 3. **Enter a Value to Increment By:** - **Value Entered:** 1 **Output Sequence:** - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 In this exercise, the user learns how to generate a sequence of numbers by specifying a starting point, an endpoint, and a specific increment value. Here, the sequence starts at 0 and ends at 10, with each number increasing by 1. This is a fundamental concept in programming and mathematics, aiding in understanding loops and iterations.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY