The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly. An example of the program is shown below: Enter the amount of your check >> 12.99 Enter the amount of your friend's check >> 9.50 The tip should be at least $1.9485 The tip should be at least $1.425   Task 1: The DebugThree1 class compiles without error.   Task 2: The calcTip() method calculates a 15% gratuity.   Task 3: The DebugThree1 program accepts user input and displays the correct output.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

 

nstructions

The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly.

An example of the program is shown below:

Enter the amount of your check >> 12.99 Enter the amount of your friend's check >> 9.50 The tip should be at least $1.9485 The tip should be at least $1.425

 

Task 1: The DebugThree1 class compiles without error.

 

Task 2: The calcTip() method calculates a 15% gratuity.

 

Task 3: The DebugThree1 program accepts user input and displays the correct output.

 

14
€03
C
> OUTLINE
> TIMELINE
FOJOJ JOJOJO FC
C at C
https://literate-sniffle-x5wx9wg5x7w4fr5r.github.dev/?folder=/workspaces/9780357673423_java-programming-10e-5... B
Q
All
EXPLORER
STUDENT [CODESPACES: LITERATE SNIFFLE]
J DebugThree1.java
> JAVA PROJECTS
* Codespaces: literate sniffle
+C c
LFCX Q FO
template A0
J DebugThree1.java X
J DebugThree1.java >..
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// This class calculates a waitperson's tip
// as 15% of the bill
import java.util.Scanner;
public class DebugThreel
{
19
20
21
22
23
24
25 }
public static void main(String args[])
{
double check1;
double check2;
}
Scanner input = new Scanner(System.in);
System.out.print("Enter the amount of your check >> ");
check1 input.nextInt ();
System.out.print("Enter the amount of your friend's check >> ")
check2 inputnextInt();
calcTip(check1);
calcTip(check2);
}
public static void calcTip()
{
final doubel RATE= 0.15;
double tip;
tip = bill / RATE;
System.out.println("The tip should be at least $" + tip);
S HOF
1 Java Lightweight Mode
student (Codespaces: literate sniffle)
MARKER
j. Cc
BAL
200
Companion X
C
PROBLEMS OUTPUT DEBUG CONSOLE TERMINAL PORTS 1 COMMENTS
@jbowen3225 →.../9780357673423_java-programming-10e-5d83f9ac-c9c6-4288-9e22-37326c529145/chapter3/dee1/student (template) $
C C
An example of the program is shown below:
Enter the amount of your check >> 12.99
Enter the amount of your friend's check >> 9.50
The tip should be at least $1.9485
The tip should be at least $1.425
{}
Your current grade is: 0%
CD
Task 1: The DebugThree1 class compiles without error.
Task 2: The calcTip() method calculates a 15% gratuity.
+
·[+]
Task 3: The DebugThreel program accepts user input and displays the correct
output.
bash +
V
世
用
4
❤
O
08
Layout: US C
Transcribed Image Text:14 €03 C > OUTLINE > TIMELINE FOJOJ JOJOJO FC C at C https://literate-sniffle-x5wx9wg5x7w4fr5r.github.dev/?folder=/workspaces/9780357673423_java-programming-10e-5... B Q All EXPLORER STUDENT [CODESPACES: LITERATE SNIFFLE] J DebugThree1.java > JAVA PROJECTS * Codespaces: literate sniffle +C c LFCX Q FO template A0 J DebugThree1.java X J DebugThree1.java >.. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 // This class calculates a waitperson's tip // as 15% of the bill import java.util.Scanner; public class DebugThreel { 19 20 21 22 23 24 25 } public static void main(String args[]) { double check1; double check2; } Scanner input = new Scanner(System.in); System.out.print("Enter the amount of your check >> "); check1 input.nextInt (); System.out.print("Enter the amount of your friend's check >> ") check2 inputnextInt(); calcTip(check1); calcTip(check2); } public static void calcTip() { final doubel RATE= 0.15; double tip; tip = bill / RATE; System.out.println("The tip should be at least $" + tip); S HOF 1 Java Lightweight Mode student (Codespaces: literate sniffle) MARKER j. Cc BAL 200 Companion X C PROBLEMS OUTPUT DEBUG CONSOLE TERMINAL PORTS 1 COMMENTS @jbowen3225 →.../9780357673423_java-programming-10e-5d83f9ac-c9c6-4288-9e22-37326c529145/chapter3/dee1/student (template) $ C C An example of the program is shown below: Enter the amount of your check >> 12.99 Enter the amount of your friend's check >> 9.50 The tip should be at least $1.9485 The tip should be at least $1.425 {} Your current grade is: 0% CD Task 1: The DebugThree1 class compiles without error. Task 2: The calcTip() method calculates a 15% gratuity. + ·[+] Task 3: The DebugThreel program accepts user input and displays the correct output. bash + V 世 用 4 ❤ O 08 Layout: US C
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education