EngineTester

EngineTester - Engine1.slower(); // Step 5. Set 'rpm' of...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/** * class EngineTester * * @author Luke Wyatt * @version v.1.0 */ public class EngineTester { // write the code for the main method, following // the exact sequence of steps shown below: // Step 1. Declare the main method. public static void main(String[]args){ // Step 2. Create an Engine instance with Min=5, Max=20, Inc=5. Engine Engine1=new Engine(5,20,5); // Step 3. Call the 'faster()' method of the Engine instance created in Step 1. Engine1.faster(); // Step 4. Call the 'slower()' method of the Engine instance created in Step 1.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Engine1.slower(); // Step 5. Set 'rpm' of the Engine instance to 10. Engine1.setRPM(10); // Step 6. Print out (use System.out.println) the new value of 'rpm' of the instance. System.out.println("rpm="+Engine1.getRPM()); // Step 7. Set 'rpm' of the Engine instance to 15. Engine1.setRPM(5); // Step 8. Print out (use System.out.println) the value of the 'counter' value. System.out.println("Counter="+Engine1.getCount()); }}...
View Full Document

This document was uploaded on 04/14/2010.

Ask a homework question - tutors are online