Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

JAVA only please **********CODE that needs checking************** /* * This Java program inlcudes several errors. One error will keep it from compiling. * The remaining

JAVA only please

image text in transcribedimage text in transcribed

**********CODE that needs checking**************

/* * This Java program inlcudes several errors. One error will keep it from compiling. * The remaining errors will throw exceptions and/or prevent correct output. * * Some errors could be the result of bad typing; some errors are the results of bad logic. * There are NO COMMENTS in this code, and not a lot of whitespace. * * Fix all the errors to produce the output shown in the lab instructions. */ public class TestCake {public static void main(String[] args) { myCake[] myCake = new Cake[4]; myCake[1] = new Cake( "Hello my friend." ); myCake[2] = new Cake( "How are you? " ); myCake[3] = new Cake( ); myCake[4] = new Cake( "Have a great one!" ); for( int x = 0; x

****************************************************************************************************

Thanks!

Expected Output After fully debugging the program, your results should exactly match those provided below: Hello my friend. The String at subscript 0 is 16 characters long How are you? The String at subscript 1 is 13 characters long Happy birthday! The String at subscript 2 is 15 characters long. Have a great one! The String at subscript 3 is 17 characters long

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

Advanced Oracle Solaris 11 System Administration

Authors: Bill Calkins

1st Edition

0133007170, 9780133007176

More Books

Students explore these related Databases questions