Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i understand the outputs but need the explanation for question 7,8,9 6 Fiad the errors), cereet it and write output package javaapplicatio import java.util Scaner

image text in transcribed
image text in transcribed
image text in transcribedi understand the outputs but need the explanation for question 7,8,9
6 Fiad the errors), cereet it and write output package javaapplicatio import java.util Scaner public class JavaApplicatie t args) f boolean r-talse : net allowed int nom-,som- talse tchange the valees of the variables and data type change nane to change the value of z and data type while(s>ynot allowed to the loop condition : 0 "WenG if( sum>5)//sot allowed to change brea s System.out.printin"numum 7. What is the output produced by the following code? package javaapplication38: import java.util.Scanner; publie class JavaApplication3S publie static void main(Stringll args) f int number; WA number entered by the user // Create a Scanner object for keyboard input Scanner keyboard- new ScannerfSystem.in System.out.print Enter an integer between 0 and 10:" number key beard.nextlntO: System.out.print"The number you entered is:"+ numbert "in"); // Determine the nomber entered. switch (number) case 0: case 1: System.out.priat" Hello") case 2: System.out.print" there") System.out.print" I am) System.out.print" Mickey") case 3: case 4: break; otprin print" How" case S: System.out.print" are you?")x case 9: break: case 10: ste m.out.printla(" Have a nice day")i break: default: stem.out,printe" Sorry, the number is out of range"); stem.out.println(in out of switch structure") input: 0 input : 1 output: output: input : 10 output: 8.What is the output of the program? package javaapplication48 import java.util.Seanner public class JavaApplication-48 ( public static void main(Stringll args) int a, b,c "5; a- br+ + 3 System.out.printin"+a+"b+blla 2a-b Systemm.out.printia"+b+""+c:l/a System.out.printin"+b+"e+e); lla 9. What is the output of the program? publie class Test2( public static void main(Stringl) args) int i 1; while (i 5) xMethod(iD public static void xMethod(int i) de f if(i % 2 1:0) System.out.print(+" "); while (i- 1); System.out.printinO

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

Recommended Textbook for

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions

Question

Define Conventional Marketing.

Answered: 1 week ago

Question

6. Explain the power of labels.

Answered: 1 week ago

Question

10. Discuss the complexities of language policies.

Answered: 1 week ago