Sie sind auf Seite 1von 2

Ruchi Kumar

Programming I

WINTER17-B-8-CSC320-1

December 24, 2017

4.a. Screen Snapshot of your Java source code:

4.b. Entire modified version of the source code:


import java.util.Scanner;

public class Program1_RuchiKumar {

public static void main(String[] args) {


// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);

String carBrand;
String model;
int year;
int startingOdometer;
int endingOdometer;
double milesPerGallon;

System.out.print("Enter car brand: ");


carBrand = input.nextLine();
System.out.print("Enter car model: ");
model = input.nextLine();
System.out.print("Enter car year: ");
year = input.nextInt();
System.out.print("Enter car starting car odometer: ");
startingOdometer = input.nextInt();
System.out.print("Enter car ending car odometer: ");
endingOdometer = input.nextInt();
System.out.print("Enter car miles per gallon: ");
milesPerGallon = input.nextDouble();

4.c. Snap Shot showing your program’s successful compile:

4.d. Snapshot showing all of your program’s output:

Das könnte Ihnen auch gefallen