Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Find The Error Or The Errors in the Following programs segments and explain how to correct them. The errors may be in the syntax or

Find The Error Or The Errors in the Following programs segments and explain how to correct them. The errors may be in the syntax or in the logic of the code

1. If(x

System.out.println("y is between x and z");

2. if (gender =1)

System.out.println("Women");

else;

System.out.println("Man");

3. Switch(n)

{

case 1:

System.out.println("The number is 1");

case 2:

System.out.println("The number is 2");

break;

default;

System.out.println("The Number is not 1 or 2");

break;

4. int x=1;

while (X<=10);

x++

}

5. int n=0;

int sum;

while (n<=10)

sum += n;

n++

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

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions

Question

2. What role should job descriptions play in training at Apex?

Answered: 1 week ago