Answered step by step
Verified Expert Solution
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 JAVA
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 errorsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started