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

1 Expert Approved Answer
Step: 1 Unlock

Answer 1 import javautilScanner public class DebugThree3 public st... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!