Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

help me check my answer for this long question please ill leave a good review! Its basic A program is supposed to put words in

help me check my answer for this long question please ill leave a good review! Its basic
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
A program is supposed to put words in the list above in alphabetical order. After it runs, the results are as follows: List: A,Z,C,B What type of error is this? logic error not an error run time error syntax error A program is supposed to put words in the list above in alphabetical order. It starts running, but then fails with an error message. What type of error is this? logic error not an error run time error syntax error A program is supposed to put words in the list above in alphabetical order. When the programmer tries to run it, it fails with the following error message: ./Main.java:5: error: ' ; ' expected System.out.println(count) 1 error What type of error is this? logic error not an error run time error syntax error I/ Run the code below. It should add 3 numbers. What are the results? class Main \{ public static void main(String]l args) \{ System.out.println("Code should add 3 numbers"); int num1 =3; int num2 =7 int num3 =0; System.out.println("Add the following " + num1 +" " + num2 + " " + num3): int num4 = num1 - num2 2 num3; System.out.println("The answer is " + num4); 3 ] It does not add them correctly, but it does have an answer, so this is a logic error It does not add them correctly, but it does create some results, so this is not an erron. It creates incorrect results while it is running, so this is a run time error It creates the wrong results, so this is a syntax error. // Run the code below. In the console window, it will ask you to enter a number. Enter any number then press the Return key. // Watch the results, Do it again, this time, instead of a number, type in your name. I/ What are the results when you enter a word instead of a number? import java.io. ; import java.util.:; class Main \{ public static void main(String[] args) [ System.out.println("Enter any number then press Return"): Scanner kbReader = new Scanner(System.in); int number = kbReader.nextlint(); System.out.println("3 plus " + number + "equals"); int sum = 3 + number: System.out.println(sum): ] 1 You entered a word instead of a number. That is not logical, so this is a logic erron. The computer would have given a correct answer if you put in a number, so this is not an error| This is a run time error caused by the wrong type of input. This a syntax error, because you entered a word instead of a number. // Run the code below. It is supposed to print something. What is the result? class Main \{ public static void main(String[] args) \{ System.out.println("Hello Everybody"); ] ] It has a logic error. It does not have an error. It has a run time error. It has a syntax error. // Run the code below. It is supposed to print something. What is the result? class Main \{ public static void main(String[] args) \{ System.out.printin("Hello Everybody") ] ] It produces the wrong results, so it is a logic error It runs fine, no error. If crashes while running, so it is a run time error It is missing a semi-colon, so it is a syntax error. // Run the code below. It is supposed to print something. What is syntax error that prevents it from running? class Main L public static void main(String[] args) \{ System.out.printin("Hello Everybody); \} 1 It is missing a curly bracket. the word "System" is misspelled. It is missing a quote symbol. It is missing a semi-colon. // Run the code below. It is supposed to print something. What is syntax error that prevents it from running? class Main I public static void main(String[] args) [ System.out.println("Hello Everybody"); ] It is missing a curly bracket. The word System is misspelled It is missing a quote It is missing a semi-colon. // Run the code below. It is supposed to print something. What is syntax error that prevents it from running? class Main [ public static void main(String[] args) \{ Syste.out.printIn("Hello Everybody"); 3 3 It is missing a curly bracket. The word System is misspelled. It is missing a quote mark. It is missing a semi-colon

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

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions