Instructions 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 an integer >> 13 Enter a second integer >> 24 Enter a third integer >> 101 The sum of 13 and 24 is 37 The sum of 24 and 101 is 125 The sum of 13 and 101 is 114 The difference between 13 and 24 is -11 The difference between 24 and 101 is -77 The difference between 13 and 101 is -88         Task 1: The DebugThree3 class compiles without error.   Task 2: The add() method adds two integers.   Task 3: The subtract() method subtracts two integers.   Task 4: The DebugThree2 program accepts user input and displays the correct output.

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter16: Graphics
Section: Chapter Questions
Problem 1DE
icon
Related questions
icon
Concept explainers
Question

 

Instructions

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 an integer >> 13 Enter a second integer >> 24 Enter a third integer >> 101 The sum of 13 and 24 is 37 The sum of 24 and 101 is 125 The sum of 13 and 101 is 114 The difference between 13 and 24 is -11 The difference between 24 and 101 is -77 The difference between 13 and 101 is -88

 

 
 

 

Task 1: The DebugThree3 class compiles without error.

 

Task 2: The add() method adds two integers.

 

Task 3: The subtract() method subtracts two integers.

 

Task 4: The DebugThree2 program accepts user input and displays the correct output.

 

14
€03
C
> OUTLINE
> TIMELINE
8
EXPLORER
STUDENT [CODESPACES: LITERATE SNIFFLE]
J DebugThree2.java
> JAVA PROJECTS
* Codespaces: literate sniffle
+© ¢O#FCX TAFOJOJÓ JÓ JO¹ C ‹ $__+9¹ © ¢ £ ¡© ¢© ¢¢© ¢ ° ¢ © ¢ © ¢
https://literate-sniffle-x5wx9wg5x7w4fr5r.github.dev/?folder=/workspaces/9780357673423_java-programming-10e-5... B
Q
All
☆ {} CD
template A0
J Debug Three2 java x
J DebugThree2.java >.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// This application displays some math facts
import java.util.Scanner;
public class DebugThree2
{
public static void main(String args[])
int a, b, c
Scanner input = new Scanner(System.in);
System.out.print("Enter an integer >> ");
a input.nextInt();
System.out.print("Enter a second integer >> ");
a = input.nextInt();
System.out.print("Enter a third integer >> ");
a input.nextInt();
add(a, b);
add (b, c);
add(a, c);
subtact(a, b);
subtact(b, c);
subtact (a, c);
}
public static int add(int a, int b)
{
System.out.println("The sum of " + a +
and " + b + " is " + a + b);
student (Codespaces: literate sniffle]
1 Java Lightweight Mode
M
HA
w
= Companion X
Instructions
Enter an integer >> 13
Enter a second integer >> 24
Enter a third integer >> 101
The sum of 13 and 24 is 37
The sum of 24 and 101 is 125
The sum of 13 and 101 is 114
The difference between 13 and 24 is -11
The difference between 24 and 101 is -77
The difference between 13 and 101 is -88
}
nublic static void subtract/int a int h)
PROBLEMS OUTPUT DEBUG CONSOLE TERMINAL PORTS 1 COMMENTS
@jbowen3225 →.../9780357673423_java-programming-10e-5d83f9ac-c9c6-4288-9e22-37326c529145/chapter3/de@2/student (template) $
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:
+
Task 1: The Debug Three3 class compiles without error.
·[+]
bash +
用
P
<>
¤
O
Layout: US
08
C
Transcribed Image Text:14 €03 C > OUTLINE > TIMELINE 8 EXPLORER STUDENT [CODESPACES: LITERATE SNIFFLE] J DebugThree2.java > JAVA PROJECTS * Codespaces: literate sniffle +© ¢O#FCX TAFOJOJÓ JÓ JO¹ C ‹ $__+9¹ © ¢ £ ¡© ¢© ¢¢© ¢ ° ¢ © ¢ © ¢ https://literate-sniffle-x5wx9wg5x7w4fr5r.github.dev/?folder=/workspaces/9780357673423_java-programming-10e-5... B Q All ☆ {} CD template A0 J Debug Three2 java x J DebugThree2.java >. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 // This application displays some math facts import java.util.Scanner; public class DebugThree2 { public static void main(String args[]) int a, b, c Scanner input = new Scanner(System.in); System.out.print("Enter an integer >> "); a input.nextInt(); System.out.print("Enter a second integer >> "); a = input.nextInt(); System.out.print("Enter a third integer >> "); a input.nextInt(); add(a, b); add (b, c); add(a, c); subtact(a, b); subtact(b, c); subtact (a, c); } public static int add(int a, int b) { System.out.println("The sum of " + a + and " + b + " is " + a + b); student (Codespaces: literate sniffle] 1 Java Lightweight Mode M HA w = Companion X Instructions Enter an integer >> 13 Enter a second integer >> 24 Enter a third integer >> 101 The sum of 13 and 24 is 37 The sum of 24 and 101 is 125 The sum of 13 and 101 is 114 The difference between 13 and 24 is -11 The difference between 24 and 101 is -77 The difference between 13 and 101 is -88 } nublic static void subtract/int a int h) PROBLEMS OUTPUT DEBUG CONSOLE TERMINAL PORTS 1 COMMENTS @jbowen3225 →.../9780357673423_java-programming-10e-5d83f9ac-c9c6-4288-9e22-37326c529145/chapter3/de@2/student (template) $ 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: + Task 1: The Debug Three3 class compiles without error. ·[+] bash + 用 P <> ¤ O Layout: US 08 C
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Instructions

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 an integer >> 13 Enter a second integer >> 24 Enter a third integer >> 101 The sum of 13 and 24 is 37 The sum of 24 and 101 is 125 The sum of 13 and 101 is 114 The difference between 13 and 24 is -11 The difference between 24 and 101 is -77 The difference between 13 and 101 is -88

 

 
 

 

Task 1: The DebugThree3 class compiles without error.

Task 2: The add() method adds two integers.

Task 3: The subtract() method subtracts two integers.

Task 4: The DebugThree2 program accepts user input and displays the correct output.

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Operators
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT