Question: Your class CountByTen has a method addTen ( ) , which takes an integer as an input parameter and returns the sum of that integer
Your class CountByTen has a method addTen which takes
an integer as an input parameter and returns the sum of that
integer plus
Your task:
Finish your main method by follow the steps outlined in your
main precisely
Basically, your program should read in a commandline argument,
print it out, and then add ten to it times printing it out
every time
For example, if your commandline value is
your program should output the following:
and if your commandline value is
your program should output the following:
Finish steps one through six in main to complete the program.
Reminder: each comment in main is an instruction.
Your code for that instruction can go below it
an example of a properly completed step:
create a variable of type integer named x and initialize it to
int x ;
Hint: steps through require one line of code each
Don't forget to include a file header with your name and date
Make sure to add comments to your code if you remove the starter file comments
public class CountByTen
dont change this method its written for you:
public static int addTenint num
return num;
public static void mainString args
Declare an int variable x:
Initialize x to be the first commandline argument:
Print out x:
Call method addTen using x as an input parameter
and assign the returned value to x again:
Print out this new x:
Repeat steps and four more times:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
