Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Juestion 3 (10 points) Please write the result of the codes, If there is an error, then please explain what the error is. Codes int

Juestion 3 (10 points)

Please write the result of the codes, If there is an error, then please explain what the error is.

Codes

int cans

6;

cans

cans cans

cans

System.out.printin(cans);

&

int result = 7/4;

System.out.printin(result);

&

int result = 7%4;

System.out.printin(result);

&

String name = "Sally";

System.out.printin(name.substring(1,4));

&

String name ="MIS103", name2="-" System.out.print(name.substring(0,3)); System.out.print(name2);

System.out.print(name.substring(3));

double price = 10/3;

System.out.printf("%.2f", price);

&

if("Tomato".substring(0,3) == ("Tom")}{System.out.print("BUS103");}

&

if("Tomato".substring(0,3).equals("Tom")}{System.out.print("Fall2022");}

&

int i=0, sum=10;

while (sum < 10) {

i++;

sum = sum - i;

&

System.out.print("i");}

int n=5;

while (n>0){

n--; System.out.print(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_2

Step: 3

blur-text-image_3

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

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students explore these related Databases questions

Question

What Is acidity?

Answered: 3 weeks ago

Question

Explain the principles of delegation

Answered: 3 weeks ago

Question

State the importance of motivation

Answered: 3 weeks ago