Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write the answer for the below questions, and explain each steps and procedures: a) Write down the exact outputs of the following program. [5

Please write the answer for the below questions, and explain each steps and procedures:

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

image text in transcribed

a) Write down the exact outputs of the following program. [5 marks] b) What output is produced by the following program? Please explain with detailed steps. [3 marks] public class Q1b \{ public static void main(String[] args) \{ int count =0; for (int i=1;i0){ ++ count; b[i]; \} \} return b; \} \} d) Write down the exact outputs of the following program. Please explain with detailed steps. [6 marks] public class Q1d \{ public static void main(String[] args) \{ func("Abc123Aabd2223"); \} public static void func(String s) \{ int[] array = new int[26]; for (int i=0;i out1) out1 = array[i]; if (array [i] !=0) ++ out 2 ; \} System.out.println(out1); System.out.println(out2); \} \} Question 2 (10 marks) Read the following program which accepts as input a sorted integer array with ascending order and an integer. public class Q2 \{ public static void main(String[] args) \{ int [] array ={10,20,35,50,75,80}; int num =70; System.out.println(scanNumber(array, num)); \} public static boolean scanNumber(int[] a, int num) \{ int i=0; int j= a.length -1 ; while (i

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

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions

Question

Explain all drawbacks of the application procedure.

Answered: 1 week ago

Question

Determine Leading or Lagging Power Factor in Python.

Answered: 1 week ago