Information Systems for Business and Beyond (2019)

number of credits. How would you fix the program so that it would give the correct output? package calcTuition; //import Scanner import java.util.Scanner;

public class CalcTuition { public static void main (String [] args) { //Declare variables int credits; final double TUITION_RATE = 100; double tuitionTotal;

//Get user input Scanner inputDevice = new Scanner (System.in); System.out.println ("Enter the number of credits: "); credits = inputDevice.nextInt();

//Calculate tuition tuitionTotal = credits + TUITION_RATE;

//Display tuition total System.out.println("You total tuition is: " + tuitionTotal);

} } Information Systems for Business and Beyond (2019) pg. 231

Made with FlippingBook flipbook maker