This is the debugs for chapter 3 of Java programming. There are two that need to be
Question:
- This is the debugs for chapter 3 of Java programming. There are two that need to be fixed and that is why I am offering such high points. As soon as I test and run the fixed debugs I will award the points right away.
1. // This application gets a user's name and displays a greeting
import java.util.Scanner;
public class DebugThree3
{
public static void main(String args[])
{
String name;
getName();
displayGreeting(name);
}
public static String getName()
{
String name;
Scanner input = new Scanner(System.in);
System.out.print("Enter name ");
name = input.nextInt();
return name;
}
public static void displayGreeting()
{
System.out.println("Hello, " + name + "!");
}
}
2. // This program calculates tutition bills as credits times rate per credit hour
public class DebugThree4
{
public static void main(String args[])
{
int myCredits = 13
int yourCredits = 17
double rate = 75.84;
System.out.println("My tuition:");
tuitionBill(myCredits, rate);
System.out.println("Your tuition:");
tuitionBill(myCredits, rate);
}
public static void tuitionBill(double r)
{
System.out.println("Total due " + (r*c));
}
}
Systems analysis and design in a changing world
ISBN: 978-1423902287
5th edition
Authors: John W. Satzinger, Robert B. Jackson, Stephen D. Burd