Write a program that will count from 1 to 10 by 1. The default output should be 1, 2, 3, 4, 5, 6 , 7, 8, 9, 10 There should be only a newline after the last number. Each number except the last should be followed by a comma and a space. To make your program more functional, you should parse command line arguments and change behavior based on their values. Argument Parameter Action -f, --first yes, an integer Change place you start counting -l, --last yes, an integer Change place you end counting -s, --skip optional, an integer, 1 if not specified Change the amount you add to the counter each iteration -h, --help none Print a help message including these instructions. -j, --joke none Tell a number based joke.   So, if your program is called counter counter -f 10 --last 4 --skip 2 should produce 10, 8, 6, 4 Please use the last supplied argument. If your code is called counter, counter -f 4 -f 5 -f 6 should count from 6. You should count from first to last inclusively. You you may not display the last number if the skip value is something other than 1. The skip value should always be greater than 0.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 15E
icon
Related questions
Question

Write a program that will count from 1 to 10 by 1. The default output should be

1, 2, 3, 4, 5, 6 , 7, 8, 9, 10

There should be only a newline after the last number. Each number except the last should be followed by a comma and a space.

To make your program more functional, you should parse command line arguments and change behavior based on their values.

Argument Parameter Action
-f, --first yes, an integer Change place you start counting
-l, --last yes, an integer Change place you end counting
-s, --skip optional, an integer, 1 if not specified Change the amount you add to the counter each iteration
-h, --help none Print a help message including these instructions.
-j, --joke none Tell a number based joke.

 

So, if your program is called counter

counter -f 10 --last 4 --skip 2

should produce 10, 8, 6, 4

Please use the last supplied argument. If your code is called counter,

counter -f 4 -f 5 -f 6

should count from 6.

You should count from first to last inclusively.

You you may not display the last number if the skip value is something other than 1.

The skip value should always be greater than 0.

AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Similar questions
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr