@@ -0,0 +1,932 @@
+// Add range to Vehicle.%0A%0Aclass Vehicle %7B%0A%09int passengers; // number of passengers%0A%09int fuelcap;    // fuel capacity in gallons%0A%09int mpg;        // fuel consumption in miles per gallon%0A%09%0A%09// Display the range.%0A%09void range() %7B%0A%09%09System.out.println(%22Range is %22 + fuelcap + mpg);%0A%09%7D%0A%7D%0A%0Aclass AddMeth %7B%0A%09public static void main(String args%5B%5D) %7B%0A%09%09Vehicle minivan = new Vehicle();%0A%09%09Vehicle sportscar = new Vehicle();%0A%09%09%0A%09%09int range1, range2;%0A%09%09%0A%09%09// assign values to fields in minivan%0A%09%09minivan.passengers = 7;%0A%09%09minivan.fuelcap = 16;%0A%09%09minivan.mpg = 21;%0A%09%09%0A%09%09// assign values to fields in sportscar%0A%09%09sportscar.passengers = 2;%0A%09%09sportscar.fuelcap = 14;%0A%09%09sportscar.mpg = 12;%0A%09%09%0A%09%09System.out.print(%22Minivan can carry %22 + minivan.passengers + %22. %22);%0A%09%09%0A%09%09minivan.range(); // display range of minivan%0A%09%09%0A%09%09System.out.print(%22Sportscar can carry %22 + sportscar.passengers + %22. %22);%0A%09%09%0A%09%09sportscar.range(); // display range of sportscar.%0A%09%7D%0A%7D%0A

Add range to Vehicle