Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please write the code in java and explain Part B. Nested If Statements. Work to be handed in for grading. 1. Wnte a program that

please write the code in java and explain
image text in transcribed
image text in transcribed
Part B. Nested If Statements. Work to be handed in for grading. 1. Wnte a program that proanpts the uier to cnter an integer esiag coasole window inpet. Use a nested if-else staterneat to check wbether the number is divisible by both 5 and 6 , neither, of oaly one of them. For euample, please fiter teiteceet If the input is 30 , your program should output: 30 is diviaible by both 5 and 6 . If the input is 10 , yout program should output: 10 is divisible by 5 but not 6 . If the input is 12 , your program should output: 12 is divisible by 6 but not 5 . If the input is 23, your program shoald output: 23 is divisible by neithee 5 nor 6. 2. After you tave created the nessed if elie statemeats, ereate a breakpoint on the line of the firt if. Switeb to the debugeing peripective using the buttoa in the top right of Eclipse. and begin debugking your progrnm by clicking the Debwe (insect) button neat to the Reen bacton on the toelsar. 3. When your program requests inpot, type 10 then press Eter. The debugger abould then suspeod esecution. Use the Svep Over battea to advance the program through your ifelse statements. Pay atiention to the execution erder of your stateneati. Take a sereeashot wben the program enters the correct elause (banch) in the nested if else statement. The correct elause is when the highlighted text is over the print statement that will priet to console, or the ending bracket of the correst if ifelse stademsot. 4. Whea the debug tool is highlighting the closing btacket for your main method, click the resume betton to ferueie nommal prograna execution. 5. Hepeat 5 tepi 3 aed 4 by using 10,12 and 24 as input valioes. Your output sbould look exactly like this. Please make sure to verify your spelling and spacing is correct: Please inter Integer: 30 39 is divisible by both 5 and 6

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

What does the transport layer do?

Answered: 1 week ago