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
- 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));
}
}
Step by Step Solution
3.41 Rating (154 Votes )
There are 3 Steps involved in it
Step: 1
Answer 1 import javautilScanner public class DebugThree3 public st...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started