2. Use thedocumentation to complete the application program that tests eachof th
ID: 3608751 • Letter: 2
Question
2. Use thedocumentation to complete the application program that tests eachof the methods by calling them.
import java.util.Scanner;
public class ApplicationProgram
{
public static void main(String[ ] args )
{
intstart;
Scanner keyboard = newScanner(System.in);
//declare and instantiate an object of type Counter
_____________________________________________
//declare and instantiate another Counter object,
// initialize the variable to –1 using theparameter
______________________________________________
//display the data value of the first object using the writemethod
______________________________________________
//display the data value of the second object using thegetNum method
______________________________________________
System.out.println( “Enter the starting point for yourcounter”);
start = keyboard.nextInt;
//change the first object’s data using start and thesetNum method
_______________________________________________
//increment the first object’s data value
_______________________________________________
//decrement the second object’s data value
_______________________________________________
//display the contents of the first object’s datausing the getNum method.
________________________________________________
//display the contents of the second object’s datausing the write method
________________________________________________
}
}
Explanation / Answer
import java.util.Scanner;
public class ApplicationProgram
{
public static void main(String[ ] args )
{
intstart;
Scanner keyboard = newScanner(System.in);
____________________________________________
______________________________________________
______________________________________________
______________________________________________
System.out.println( “Enter the starting point for yourcounter”);
start = keyboard.nextInt;
______________________________________________
_______________________________________________
_______________________________________________
________________________________________________
________________________________________________
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.