Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2.) if string str = Grand Canyon, then what is the value of str.substring (7);? A. Canyon B. anyon C. nyon D. Grand C E.

2.) if string str = "Grand Canyon", then what is the value of str.substring (7);? A. Canyon B. anyon C. nyon D. Grand C E. and Canyon

3.) Consider the following method total below. public static into total (int result, int a, int b)

{ if (a==0)

{ if (b==0) { return result * 2;

}

return result /2;

}

else

{

return result *3;

}

}

The assignment statement x=total (1,0,1); must result in

A. x being assigned the value 3 B. x being assigned the value 7 C. x being assigned the value 5 D. x being assigned the value 2 E. x being assigned the value 0

4. Consider the method total below. public static int total (int result, int a, int b)

{ if (a==0) { if (b==0) { return result *2; } return result /2; } else { return result *3; } } The assignment statement x=total (5,0,0); must result in

A. x being assigned the value 4 B. x being assigned the value 8 C. x being assigned the value 5 D. x being assigned the value 2 E. x being assigned the value 10

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

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions