Question
Using the IST Linux system create the following Java command line iterator application Lab3. Pass in four arguments from the Linux command line when the
Using the IST Linux system create the following Java command line iterator application Lab3. Pass in four arguments from the Linux command line when the program starts.
For example java Lab3 value1 value2 value3 value4
The four command line arguments get passed into the main method as a String array in the variable object named args. Remember they get passed in as strings so you need to parse them into integers using the Integer.parseInt(args[X]) if you want to use them as integers. Create four sections that perform the following functions.
if expression: check if matches the value1 passed in and you select a hardcoded value to check, the code block will print the value matched
if-else expression: check if matches the value2 passed in select a hardcoded value, code block will print the value matched or not matched
if expression with a boolean condition: check if matches the Boolean value3 passed in, code block will print the boolean value
switch statement: Using the value4 passed in find the value in the switch and print the value one, two, three. Check only for 1-3 values.
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