Find three run-time errors in the program

Assignment Help JAVA Programming
Reference no: EM131395118

1. What is the value of mystery after this sequence of statements?
int mystery = 1;
mystery = 1 - 2 * mystery;
mystery - mystery + 1;

2. What is wrong with the following sequence of statements?
int mystery 1;
mystery - mystery + 1;
int mystery 1 - 2 * mystery;

3. Write the following mathematical expressions in Java.

s = so + vot + 1/2 gt2

G = 4 Π2.a3/p2(m1 + m2)

FV = PV.(1 + INT/100)YRS

c = √(a2 + b2 - 2abcosγ)

4. Write the following Java expressions in mathematical notation.
a. dm . m * (Math.sqrt(1 + v / c) / Math.sqrt(1 - v / c) - 1);
b. volume = Math.PI * r * r * h;
c. volume = 4* Math.PI * Math.pow(r, 3) / 3;
d. z = Math.sqrt(x * x + y * Y);

5. What are the values of the following expressions? In each line, assume that

double x = 2.5;
double y = -1.5;

int m = 18;
int n = 4;

a. x + n * y- (x + n) * y
b. m /n + m%n
c. 5 * x - n / 5
d. 1 - (1 - (1 - (1 - (1 - n))))
e. Math.sqrt(Math.sqrt(n))

6. What are the values of the following expressions, assuming that n is 17 and m is 18?
a. n / 10 + n % 10
b. n % 2 + m % 2
C. (m + n) / 2
d. (m + n) / 2.0
e. (int) (0.5 * (m + n))
f. (int) Math.round(0.5 * (m + n))

7. What are the values of the following expressions? In each line, assume that
String s - "Hello";
String t "World";
a. s.length() + t.length()
b. s.substring(1, 2)
C. s.substring(s.length() / 2, s.length())
d.s + t
e. t + s

8. Find at least five compile-time errors in the following program.
public class HasErrors
public static void main();
{
System.out.print(Please enter two numbers:)
x in.readDouble;
y in.readDouble;
System.out.printline("The sum is " + x + y);
}
}

9. Find three run-time errors in the following program.
public class HasErrors
public static void main(String[] args)
{
int x - 0;
int y 0;
Scanner in - new Scanner("System.in");
System.out.print("Please enter an integer:");
x in.readInt();
System.out.print("Please enter another integer: ");
x in.readInt();
System.out.println("The sum is " + x + y);

}

Reference no: EM131395118

Questions Cloud

Really about serving the bottom of the pyramid : Was the Internet.org initiative really about serving the bottom of the pyramid or was it more about Facebook trying to expand its reach? Analyze.
Analyze two career options in the health care industry : Analyze two career options in the health care industry, in terms of the educational requirements, job responsibilities, and average salaries.Using the following Bureau of Labor Statistics Healthcare Occupations Website research two differences betwe..
What are the basic and non basic variables : Consider the partial simplex tableau shown below: In the tableau, what are the non basic variables? In the optimal tableau, what are the basic variables
Determine the absolute weight and the weight : determine the absolute weight and the weight relative to the rotating earth of a 9o-kg man if he is standing on the surfsce of the earth at a latitude of 40 degrees
Find three run-time errors in the program : Find three run-time errors in the program - What are the values of the following expressions and what is the value of mystery after this sequence of statements?
Form of argumentation - humans have feet : Determine whether each is strong or weak, and note the relationship between your answer and the truth or falsity of the premise(s) and conclusion.- Unlike monkeys, today's humans have feet that are not suited for grasping objects.
Companies in different industries : Going to google.com internet search to identify at least 2 companies in different industries that have entered into outsourcing agreements with firms with specialized services. In addition, describe what value chain activities the companies have ..
Determine the combined moment of the two 20-lb forces : The flexible shaft AB of the wrench is bent into a horizontal arc with a radius of 24 in. The two 20-lb forces, which are parallel to the z-axis, are applied to the handle CD, as shown.
Ethics and corporate scandal : In this assignment, you will analyze a corporate scandal by considering the leadership skills and competencies that were lacking in corporate leadership, and looking closely at the way the scandal was handled by leadership. Your work in this assig..

Reviews

len1395118

2/16/2017 12:09:07 AM

trying to do these qustions No of Pages/Words : 2 STANDARD LIBRARY ITEMS - java.io.PrintStream printf java.lang.Double parseDouble java.lang.Integer MAX_VALUE MIN_VALUE parselnt java.lang.Math PI abs cos exp log log10 max min pow round sin sqrt tan toDegrees toRadians java.lang.String charAt length substring java.lang.System in java.math.BigDecimal add multiply subtract java.math.Biglnteger add multiply subtract java.util.Scanner next nextDouble nextlnt javax.swing.)OptionPane showlnputDialog showMessageDialog

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd