Help me fix my code to my java problem assignment please What is wrong with my code? The assignment is called Interstate highway numbers in zybooks 3.24 for Java Im trying to get my code 200 is not a valid interstate highway number. As my answer Instead I’m getting I-200 is auxiliary, serving I-0, going east/west. As the answer Help me fix that one problem with my code thank you

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Help me fix my code to my java problem assignment please What is wrong with my code? The assignment is called Interstate highway numbers in zybooks 3.24 for Java Im trying to get my code 200 is not a valid interstate highway number. As my answer Instead I’m getting I-200 is auxiliary, serving I-0, going east/west. As the answer Help me fix that one problem with my code thank you
1: JAVA Pro X
O Program Help : cprogramming
Content
Content
ECHCCCSC151TeterSpring2022/chapter/3/section/24
g home > 3.24: LAB: Interstate highway numbers
Your output
I-290 is auxiliary, serving I-90, going east/west.
3: Invalid (0) ^
1/1
Input
Your output
0 is not a valid interstate highway number.
4: Compare output a
0/1
Output differs. See highlights below.
Special character legend
Input
200
Your output
I-200 is auxiliary, serving I-0, going east/west.
Expected output
200 is not a valid interstate highway number.
5: Compare output a
2/2
Input
5
Your output
I-5 is primary, going north/south.
2/2
6: Compare output a
Input
405
Your output
I-405 is auxiliary, serving I-5, going north/south.
2/2
7: Compare output a
Input
1000
立
Transcribed Image Text:1: JAVA Pro X O Program Help : cprogramming Content Content ECHCCCSC151TeterSpring2022/chapter/3/section/24 g home > 3.24: LAB: Interstate highway numbers Your output I-290 is auxiliary, serving I-90, going east/west. 3: Invalid (0) ^ 1/1 Input Your output 0 is not a valid interstate highway number. 4: Compare output a 0/1 Output differs. See highlights below. Special character legend Input 200 Your output I-200 is auxiliary, serving I-0, going east/west. Expected output 200 is not a valid interstate highway number. 5: Compare output a 2/2 Input 5 Your output I-5 is primary, going north/south. 2/2 6: Compare output a Input 405 Your output I-405 is auxiliary, serving I-5, going north/south. 2/2 7: Compare output a Input 1000 立
151: JAVA Prc X
O Program Help : cprogramming
Content
Content
YTECHCCCSC151TeterSpring2022/chapter/3/section/24
ing home > 3.24: LAB: Interstate highway numbers
354532 2042412 qzay7
LAB
3.24.1: LAB: Interstate highway numbers
ACTIVITY
9/10
LabProgram.java
Load default template...
1 import java.util.Scanner;
2
3 public class LabProgram {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int highwayNumber;
int primaryNumber;
4
6.
7
8
9.
highwayNumber = scnr.nextInt();
10
%3D
11
12
primaryNumber - highwayNumber % 100;
13
14
if ((highwayNumber > 0) && (highwayNumber < 100))
{
if (highwayNumber % 2 -- 0)
{
System.out.println("I-" + highwayNumber + " is primary, going east/west.");
}
else
15
16
17
18
19
20
21
{
System.out.println("I-" + highwayNumber + " is primary, going north/south. ");
}
22
23
24
25
else if ((highwayNumber > 99) && (highwayNumber < 1000))
if (highwayNumber % 2 == 0)
{
System.out.println("I-" + highwayNumber + " is auxiliary, serving " + "I-" + primaryNumber + ", going eas
26
27
28
29
30
31
else
32
{
System.out.println("I-" + highwayNumber + " is auxiliary, serving " + "I-" + primaryNumber + ", going nor
}
else if ((highwayNumber < 1) || (highwayNumber > 999))
{
System.out.println(highwayNumber + " is not a valid interstate highway number.");
33
34
35
36
37
38
39
40
41
42 }
Transcribed Image Text:151: JAVA Prc X O Program Help : cprogramming Content Content YTECHCCCSC151TeterSpring2022/chapter/3/section/24 ing home > 3.24: LAB: Interstate highway numbers 354532 2042412 qzay7 LAB 3.24.1: LAB: Interstate highway numbers ACTIVITY 9/10 LabProgram.java Load default template... 1 import java.util.Scanner; 2 3 public class LabProgram { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int highwayNumber; int primaryNumber; 4 6. 7 8 9. highwayNumber = scnr.nextInt(); 10 %3D 11 12 primaryNumber - highwayNumber % 100; 13 14 if ((highwayNumber > 0) && (highwayNumber < 100)) { if (highwayNumber % 2 -- 0) { System.out.println("I-" + highwayNumber + " is primary, going east/west."); } else 15 16 17 18 19 20 21 { System.out.println("I-" + highwayNumber + " is primary, going north/south. "); } 22 23 24 25 else if ((highwayNumber > 99) && (highwayNumber < 1000)) if (highwayNumber % 2 == 0) { System.out.println("I-" + highwayNumber + " is auxiliary, serving " + "I-" + primaryNumber + ", going eas 26 27 28 29 30 31 else 32 { System.out.println("I-" + highwayNumber + " is auxiliary, serving " + "I-" + primaryNumber + ", going nor } else if ((highwayNumber < 1) || (highwayNumber > 999)) { System.out.println(highwayNumber + " is not a valid interstate highway number."); 33 34 35 36 37 38 39 40 41 42 }
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY