Asked Jan 20, 2019

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,

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,


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; 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


Computer Science

Related Computer Science Q&A

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

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 ...


Q: Programming in C language.

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


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...


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...


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 ...


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


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 ...


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...


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...