Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Trace the following pieces of code and give their exact output and the tracing steps. a. (5 Marks) String[] names={AAAA, SSSS, HHHH, BBBB, MMMM, LLLL,

image text in transcribed

Trace the following pieces of code and give their exact output and the tracing steps. a. (5 Marks) String[] names={"AAAA", "SSSS", "HHHH", "BBBB", "MMMM", "LLLL", "NNNN", "RRRR", "EEEE", "YYYY", "CCCC"}; System.out.println("Begin here:"); for (int i= names.length-1; i>0; i-=2) System.out.printf("%s ", names[i]); b. (5 Marks) public class Fall2020FinalTHE { static int some Value = 207; public static void main(String[] args) { System.out.println (someValue); int value = 39; System.out.println(value); System.out.println (Fall2020FinalTHE. finalTHEmethod()); System.out.println(finalTHEmethod(1231)); } public static int finalTHEmethod() { System.out.println(someValue); return (someValue > 1) ? 224 : 515; } public static int finalTHEmethod(int someValue) { System.out.println(someValue); return some Value $ 34; } } C. (5 Marks) String s = "TM105FinalExamTakeHomeExam"; int a = s.length()-1; do { if (a = 5); System.out.println("a = " + a)

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

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago