Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

7. What is the output during execution if the user types in bdcda as input? char ch1=' '; int j = 0; for(int i =

7. What is the output during execution if the user types in "bdcda" as input? char ch1=' '; int j = 0; for(int i = 0 ; i < 5; i++) { try { ch1 = (char) System.in.read(); } catch(Exception e) {} if (ch1 == 'a') break; else if (ch1 == 'b') continue; else if (ch1 == 'c') i--; else if (ch1 == 'd') j++; j++; } System.out.println( j );

8. What value is returned when method func(9) is invoked? public double SquareRoot( double value ) throws ArithmeticException { if (value >= 0) return Math.sqrt( value ); else throw new ArithmeticException(); } public double func(int x) { double y = (double) x; y *= -9.0; try { y = SquareRoot( y ); } catch(ArithmeticException e) { y /= 3; } finally { y += 10; } return y; }

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

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions

Question

4 Name four appraisal methods.

Answered: 1 week ago

Question

Discuss the techniques of job analysis.

Answered: 1 week ago

Question

How do we do subnetting in IPv6?Explain with a suitable example.

Answered: 1 week ago

Question

Explain the guideline for job description.

Answered: 1 week ago

Question

What is job description ? State the uses of job description.

Answered: 1 week ago

Question

What are the objectives of job evaluation ?

Answered: 1 week ago

Question

3. Is there opportunity to improve current circumstances? How so?

Answered: 1 week ago

Question

2. What do you believe is at the root of the problem?

Answered: 1 week ago