Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PROGRAMMING LANGUAGE IS JAVA The program (Pluto.java) contains syntax and logic errors. Fix the syntax errors in the Develop mode until the program executes. Then

PROGRAMMING LANGUAGE IS JAVAimage text in transcribedimage text in transcribed

The program (Pluto.java) contains syntax and logic errors. Fix the syntax errors in the Develop mode until the program executes. Then fix the logic errors. Error messages are often long and technical. Do not expect the messages to make much sense when starting to learn a programming language. Use the messages as hints to locate the portion of the program that causes an error. One error often causes additional errors further along in the program. For this exercise, fix the first error reported. Then try to run the program again. Repeat until all the compile-time errors have been corrected. The correct output of the program is: Is Pluto a planet? Some people think so, but others don't. The Moon's mass is 6 times Pluto's. Not much of a planet, is it? End the last output with a newline. \begin{tabular}{l|l} LAB & 1.19.1: LAB: Fixing errors in Pluto \end{tabular} Pluto.java Load default template... 12345678910publicstaticvoidmain(String[]args)proportion=6;System.out.print("IsPlutoaplanet?");System.out.print("Somepeoplethinkso,);System.out.print("butothersdont.");System.out.print("TheMoonsmassis+proportion+"timesPlutos.");System.out.print("Notmuchofaplanet,isit."); Pluto.java:1: error: class, interface, or enum expected public static void main(String [] args) \& Pluto.java:4: error: class, interface, or enum expected System.out.println("Is Pluto a planet?"); Pluto.java:5: error: class, interface, or enum expected System.out.print("Some people think so, ); Pluto.java:5: error: unclosed string literal System.out.print("Some people think so, ); Pluto.java:7: error: class, interface, or enum expected System.out.println("The Moon's mass is ' + proportion + " times Pluto's."); P pluto.java:7: error: unclosed character literal System.out.println("The Moon's mass is' + proportion + " times Pluto's."); Pluto.java:7: error: unclosed string literal System.out.println ("The Moon's mass is ' + proportion + " times Pluto's."); P errors

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

Databases Illuminated

Authors: Catherine M. Ricardo

1st Edition

0763733148, 978-0763733148

More Books

Students also viewed these Databases questions

Question

Describe the selection process.

Answered: 1 week ago

Question

Describe performance management.

Answered: 1 week ago

Question

Explain the importance of preliminary screening.

Answered: 1 week ago