Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * File: Lab3
- * Project: Lab 3 - "Two Numbers"
- * Author: Dylan Rindo
- * Description: Similar to the "Rectangle" project in class,
- * display 2 numbers and then display the output
- * of several operations with the 2 numbers as
- * the inputs.
- * Comments: This Particular code allows the TwoNumbers class to be
- * run without opening the "TwoNumbers" file.
- */
- public class TwoNumbersTester
- {
- public TwoNumbersTester()
- {
- }
- /* Main Method, runs object as application to test */
- public static void main( String[] args)
- {
- /* List of processes that will be done during the test */
- TwoNumbers twoNumbersOriginal;
- TwoNumbers twoNumbersSecond;
- twoNumbersOriginal = new TwoNumbers();
- twoNumbersSecond = new TwoNumbers( 100.0, 200.0 );
- System.out.println( " Test of TwoNumbers " );
- System.out.println( " *** Now testing TwoNumbers objects ***" );
- System.out.println( "" );
- System.out.println( " *** First Number Set *** " );
- System.out.println( " " );
- System.out.println( " First number: " + ' '
- + twoNumbersOriginal.getNumber1() );
- System.out.println( " Second number: " + ' '
- + twoNumbersOriginal.getNumber2() );
- System.out.println( " " );
- System.out.println( " Sum: " + ' '
- + twoNumbersOriginal.getSum() );
- System.out.println( " Difference: " + ' '
- + twoNumbersOriginal.getDifference() );
- System.out.println( " Product: " + ' '
- + twoNumbersOriginal.getProduct() );
- System.out.println( " Quotient: " + ' '
- + twoNumbersOriginal.getQuotient() );
- System.out.println( " Average: " + ' '
- + twoNumbersOriginal.getAverage() );
- System.out.println( " " );
- System.out.println( " *** Second Number Set *** " );
- System.out.println( " " );
- System.out.println( " First number: " + ' '
- + twoNumbersOriginal.getNumber1() );
- System.out.println( " Second number: " + ' '
- + twoNumbersOriginal.getNumber2() );
- System.out.println( " " );
- System.out.println( " Sum: " + ' '
- + twoNumbersSecond.getSum() );
- System.out.println( " Difference: " + ' '
- + twoNumbersSecond.getDifference() );
- System.out.println( " Product: " + ' '
- + twoNumbersSecond.getProduct() );
- System.out.println( " Quotient: " + ' '
- + twoNumbersSecond.getQuotient() );
- System.out.println( " Average: " + ' '
- + twoNumbersSecond.getAverage() );
- System.out.println( " " );
- twoNumbersSecond.setNumber1( 50.0 );
- twoNumbersSecond.setNumber2( 60.0 );
- System.out.println( " *** Third Number Set *** ");
- System.out.println( " " );
- System.out.println( " First Number: " + ' '
- + twoNumbersSecond.getNumber1() );
- System.out.println( " Second Number: " + ' '
- + twoNumbersSecond.getNumber2() );
- System.out.println( " " );
- System.out.println( " Sum: " + ' '
- + twoNumbersSecond.getSum() );
- System.out.println( " Difference: " + ' '
- + twoNumbersSecond.getDifference() );
- System.out.println( " Product: " + ' '
- + twoNumbersSecond.getProduct() );
- System.out.println( " Quotient: " + ' '
- + twoNumbersSecond.getQuotient() );
- System.out.println( " Average: " + ' '
- + twoNumbersSecond.getAverage());
- System.out.println( " " );
- }
- }
Add Comment
Please, Sign In to add comment