Write a program called Loopmethod that contains a main method and a method called printNums that prints the numbers from a specified start to end value. A method must be used. Refer to the pic and please show your source code and console.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question
Write a program called Loopmethod that contains a main method and a method called printNums that prints the numbers from a specified start to end value. A method must be used. Refer to the pic and please show your source code and console.
a) The main method will do the following:
asks the user for start and end number (int type).
O calls the printNums method
b) The printNums method will do the following:
● receives start and end number (parameters)
prints from the start to the end number using a loop
●
●
Sample Run:
Input start number: 3
Input end number: 9
3456789
Input start number: 9
Input end number: 21
9 10 11 12 13 14 15 16 17 18 19 20 21
Transcribed Image Text:a) The main method will do the following: asks the user for start and end number (int type). O calls the printNums method b) The printNums method will do the following: ● receives start and end number (parameters) prints from the start to the end number using a loop ● ● Sample Run: Input start number: 3 Input end number: 9 3456789 Input start number: 9 Input end number: 21 9 10 11 12 13 14 15 16 17 18 19 20 21
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Math class and its different methods
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,