Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Will thumbs up if answered all, Greatly appreciated, thank you! 26. (3 x 2 marks) The following code snippets have either a syntax or logic

Will thumbs up if answered all,
Greatly appreciated, thank you!
image text in transcribed
26. (3 x 2 marks) The following code snippets have either a syntax or logic error. Find and correct the error s) (you do not need to rewrite all of the code, just make the corrections clear) There is only one error per question and it is in the code that is shown to you a) doubletl values -new doublet31 double result-Math.sqrttvalees) b) publia static int getMax (int s, int b) if( a > b ) return a; else System.out.println (b)a c) Diet dice -e Die151 dice [01.roll int val -dice 01.aLdeUpO 27. (2 x3 marks) What is the output of the following code snippets? Pay attention to the bold lines public static void main(Stringll az5) double x a. System.out printin() System.out.printin(x) public atatic vold maltiply (int x) Systen.out.printin() b. pablic statie void main(String11 args) System.out printin(x[01) System.out.printin([01) public atatie void multiply(int x) for (int 1- x.lengtha 1+) nt-3,5,7 x(-*110 System.out printin(x[o1

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

More Books

Students also viewed these Databases questions