Question
Asked Jan 20, 2019
6 views

What are the errors in the following code?

Poblic class Has Errors
Poblic static void mainO;
n ain
Sqstem.out. print (piease coter tuvo numbers:)
X n.readDooble
y : in. read Double,
help_outline

Image Transcriptionclose

Poblic class Has Errors Poblic static void mainO; n ain Sqstem.out. print (piease coter tuvo numbers:) X n.readDooble y : in. read Double,

fullscreen
check_circle

Expert Answer

Step 1

Given below are the errors found in the code send by you along with an error free code.

Step 2

First of all, you need to use import.java.util.Scanner; to import any class in java. Then we need to write String [] args inside public static void main and it should not be closed with semicolon. Next error is that to print any statement, we need to write that statement in double quotes “Please enter two numbers: ”. After this we need to create new Scanner instance that will point to the input stream passed as argument with Scanner in=new...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A
add
question_answer

Q: need help with understanding how to do the SQL code for the following question:  These are the heade...

A: As the table name is not shown in the picture, we are assuming the table name as Product. There are ...

question_answer

Q: Programming in C language.

A: Note:The below given program has been compiled using "repl.it" online compiler.

question_answer

Q: Consider the languages below. For each, make a conjecture whether or not it is regular. Then prove y...

A: The given language L = {anbl : n/l is an integer} is not regular language because a DFA cannot be co...

question_answer

Q: Write two scnr.nextInt statements to get the input values into birthMonth and birthYear.Then write a...

A: Given below is the program to get input values for month and year and write the output value as a mo...

question_answer

Q: Design a Turing machine that computes the function f(w) = 1 if w is even   = 0 if w ...

A: To discover whether a string is even or odd, just examine the LSB (least significant bit).If LSB is ...

question_answer

Q: write a program in c++. You work for a box company, and have been asked to write a program to compar...

A: Click to see the answer

question_answer

Q: Develop the ‘Shape’ application such that: ‘Rectangle’, ‘Ellipse’, and ‘Triangle’ classes inherit f...

A: Program plan:Define a class named “Shape”.Define a default constructor to print constructor invoked ...

question_answer

Q: Knapsack Problem This exercise is due Tuesday, May 14. It has to be turned in on time in order to ge...

A: Instructions for completing the table:Enter 0 where objects and weights are zero.For each row assume...

question_answer

Q: Consider the following procedure: procedure mystery (x, y, z); integer x, y, z;beginz = 2; y= z+x;en...

A: Pass by value copies the value of argument and passes it to the parameter. Hence, the final value of...