Question
T$he goal of this assignment is To learn how to use command line arguments Your task is to write an appli$cation that prints stars (*)
T$he goal of this assignment is To learn how to use command line arguments Your task is to write an appli$cation that prints stars (*) or dollar signs ($) depending on the command line argument. The first command line argument must be a string of star or dollar. The second command line argument is the the number of the symbols to be printed in total. The third command line argument is the number of the symbols to be printed in a line. If the argument values are not valid, print the usage and quit the application. See Fig 7.21 to see how you can convert a string to an integer.
Your code must compile from the windows command line using the following commands.
> java PrintSymbols star 7 3
***
***
*
> java PrintSymbols dollar 9 5
$$$$$
$$$$
> java PrintSymbols comma 10 2 Usage: java PrintSymbols [star|dollar] number_of_symbols number_of_symbols_per_line
> java PrintSymbols star 10 Usage: java PrintSymbols [star|dollar] number_of_symbols number_of_symbols_per_line
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started