Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can I get some help? /** * This Java program inlcudes several errors. One error will keep it from compiling. * The remaining errors will

Can I get some help?

image text in transcribed

image text in transcribed

image text in transcribed

/** * 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. * Submit your completed and CORRECT version of PeelOnion. * * (c) 2019 Terri Davis */ public class PeelOnion {public static void main(String[] args){ Onion[] myStuff = new Onion[5]; myStuff[1] = new Onion( "There should be some sort of text here..." ); myStuff[2] = new Onion( "Hello! How are you?" ); myStuff[3] = new Onion( "My name is " ); myStuff[4] = new Onion( ); myStuff[5] = new Onion( "It's a lovely day in the neighborhood." ); for( int h = 0; h

Lab 05 nstructions.pdf (SECURED) - Adobe Reader File Edit View Window Help 66.7% Tools Fill 8 Sign Comment Sign In General Information This is a different sort of leb. Provided materials for this lab include executable code for a cless, Onion, and with code to process a group of objects of that class, peelonion. The process code includes several errors. Your task is to find and correct all of those errors. Export PDF Background We will discuss error handling, axceptions, stack traces, and stack unwinding in class I recommend that you read Chapter 11.7 again before attempting this lab Adobe ExportPDF Convert PDF files to Word or Excel online. Select PDF File: As you by now have experienced, debugging code is a large part of programming. This exercise will give you some experience tracing a few common issues. in fact, you have almost definitely seen every one of the ndudQd Issues in your own, or someone 10's, code. Lab 05 Instructions.pd 1 file/465 KB Given: Convert To: UML describing the class onLon Onion.class-the executable code for class Onion (you will not need the source code) Peelonion.java-this is the process code that you will Tix Microsoft Word (docx) Recognize Text in English(U.S.) Change Task: Correct Peelonion.java so that it produces the Expected Results Deliverable Your corrected version of Peelonion.java Convert Requirements The provided source code has no comments beyond the block comment discussing the lab assignment There is very, very little whitespace included. You may find the code difficult to read in this format Please feel free to add comments and white space to make the code more readable. If you choose not to do so, there will be no point deduction. - Create PDF The first two errors will keep the code from compiling. Once you have corrected those, others will appear in sequence. Some errors may be due to typos in the code, some may be due to logic errors in the code. It is also entirely possible to introduce additionel (unplanned) errors while you are trying to debug the program. Edit PDF Combine PDF Send Files Store Files Testing After fully debugging the program, your results should exactly match those provided Submitting Your Work Submit your correct version of Peelonion.java. Be sure to submit the source code, NOT the edit/backup copy or the executable. IS 2041 2019 Terri D vs Spring 2019 640 PM O Type here to search . Onion UML Class Diagram.pdf (SECURED-Adobe Reader File Edit View Window Help 68.3% |- Tools Fill 8 Sign Comment Onion onion Contains a reference to a public Onion Onion constructor, creates a default String object reference for onion Onion object to instance variable onion public getlength(): int an integer representing the length of the String object referenced by variable onion Notes Standard na tandard Onion (c) 2019 Terri Davis S 2041 Spring 2019 6:40 PM O Type here to search Expected Output from PeelOnion.pdf (SECURED) - Adobe Reader File Edit View Window Help Tools Fill&SignComment Expected Output from PeelOnion.java There should be some sort of text here. The String at subscript is 41 characters long Hello! How are you? The String at subscript 1 is 19 characters long My name is The String at subscript 2 is 11 characters long. This is a default message layer. The String at subscript 3 is 32 characters long. It's a lovely day in the neighborhood The String at subscript 4 is 38 characters long 6:40 PM 0 Type here to search

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 Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions

Question

What does stickiest refer to in regard to social media

Answered: 1 week ago

Question

Distinguish between filtering and interpreting. (Objective 2)

Answered: 1 week ago