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 10.
Your task:
Finish your main method by follow the steps outlined in your
main (precisely!)
Basically, your program should read in a command-line argument,
print it out, and then add ten to it 5 times (printing it out
every time).
For example, if your command-line value is 0,
your program should output the following:
0
10
20
30
40
50
and if your command-line value is 107,
your program should output the following:
107
117
127
137
147
157
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:
//1. create a variable of type integer named x and initialize it to 0
int x =0;
Hint: steps 1 through 5 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{
//don't change this method (its written for you):
public static int addTen(int num){
return num+10;
}
public static void main(String[] args){
//1.Declare an int variable x:
//2.Initialize x to be the first command-line argument:
//3.Print out x:
//4.Call method addTen() using x as an input parameter
// and assign the returned value to x again:
//5.Print out this new x:
//6.Repeat steps 4 and 5 four more times:
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!