Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Systems analysis and design in a changing world

Authors: John W. Satzinger, Robert B. Jackson, Stephen D. Burd

5th edition

9780324593778, 1423902289, 9781305117204, 324593775, 978-1423902287

More Books

Students also viewed these Programming questions

Question

What role does middleware play?

Answered: 1 week ago