Complier error and run time error

Assignment Help JAVA Programming
Reference no: EM13846491

Q1. What do you understand by complier error and run time error? Explain by example.

Q2. What is wrong with the following variable declarations?

int Km/h = 120;
String Newcar = GMC;
int Adouble = "50";
String newCar = "GMC"
int x = 5, y = "x";
String new Car = "GMC";

Q3. What does this sequence of statements print?

String msg = "The number of characters in newCar is";
String newCar = "GMC";
int numberOfCharacters = newCar.length();
String carUpperCase = newCar.toUpperCase();
System.out.print(newCar);
System.out.println(carUpperCase);
System.out.print(msg);
System.out.println(newCar.length());
newCar.replace("C","U");
newCar.replace("M","E");
newCar.replace("G","S");
System.out.print("Welcome to : ");
System.out.println(newCar);
/*System.out.println("Good luck");
System.out.println("to all students");*/

Q4. Consider the following class:

public class IdentifyMyParts
{
private int x = 7;
private int y = 3;
}

a. What are the instance variables?

b. What is the output from the following code:

IdentifyMyParts a = new IdentifyMyParts();
IdentifyMyParts b = new IdentifyMyParts();
a.y = 5;
b.y = 6;
a.x = 1;
b.x = 2;
System.out.println("a.y = " + a.y);
System.out.println("b.y = " + b.y);
System.out.println("a.x = " + a.x);
System.out.println("b.x = " + b.x); Q5. What is the output of the following code:

a.
int num1 = 6;
int num2 = 10;
num1 = num1 + num2;
num2 = num1 + num2;
System.out.println(num1 + ", " + num2);

b.
int a = 10;
int b = 20;
int c = 2;
int x = b / a /*c*/;

Q6. Write a Java program that performs the following: [6 Points]
1. Identify the radius of the circle. (radius = 3)
2. Calculate circumference and area of the circle.
3. Print the results.

Reference no: EM13846491

Questions Cloud

What additional information you learned : Review the material at http://www.nami.org/Content/ContentGroups/Helpline1/Teenage_Suicide.htm. Choose two of the points made on this website to research further, using academic published sources. Tell us which two you chose and why, and tell u..
Gantt chart-project log : Morris Wildlife Services deals with the humane removal of wildlife from places it does not belong (such as removing bats from attics and trapping coyotes for release in more suitable habitat).
What is amount of support provided by eliza to her father : Eliza purchased a new television for $900 which she placed in the living room for both her father and her use. What is the amount of support provided by Eliza to her father?
Compute sams taxable income : In 2014, Sam is single and rents an apartment for which he pays $800 per month and makes charitable contributions of $1,000. Sam's adjusted gross income is $47,000. Required: Compute his taxable income. Show all calculations.
Complier error and run time error : Q1. What do you understand by complier error and run time error? Explain by example.
Compute sean and marthas taxable income : Their total income in 2014 from part-time jobs and interest income from a bank savings account is $60,000. Their itemized deductions are $12,000. Required: Compute Sean and Martha taxable income.
What do you think is going through billy mind : It seems to be unlocked, and no one is around. Using Kohlberg's work as a guide, what do you think is going through Billy's mind? What action(s) do you think he will do next
Correlation and simple regression : Correlation and Simple Regression
Compute steves taxable income : Steve Greene, age 66, is divorced with no dependents. In 2014 Steve had income and expenses as follows: Gross income from salary $80,000 Total itemized deductions 5,500 Compute Steve's taxable income for 2014.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Java program that computes a ride you took in taxi

Write a java program that computes a ride you took in taxi. The bill computed based on an initial cost plus the taxi charges 0.5 dirham every 0.3 km.

  Program that allows a user to input coordinates

In Java make a program that allows a user to input coordinates as to make a Hexagon via an array, and my professor has set the standards of: Write a class Polygon which draws a hexagon for a set of numbers given by the user.

  Digital image processing using java

Digital image processing using java ..create plugin using Jedit and run it in imageJ

  What was in mind of the coder in each part of the code

Need a video that goes through all this java code - as if it was a tutorial showing it line by line - and explain in detail the structure of it all as if you code it yourself.

  Create a complete java application that meets these

create a complete java application that meets these requirements1. the program has an opening comments section using

  Create a complete java application

Create a complete Java application that meets these requirements and the program has an opening comments section (using block comments) with the file name, date, your name, and purpose of the program.

  Create a java application that contains methods to display

Create a Java application that contains methods to display statistics for the numbers in an array. The main method has been written and it's attached. complete the program by writing the following methods.

  How much more that person needs to spend to qualify

Program that takes the amount a person has spent and determines the discount ($15 per $175 spent).

  Your task in this assignment is to develop a graphical user

your task in this assignment is to develop a graphical user interface based java program that can communicate with a

  Create at least two vectors and demonstrate the use of each

Create a separate class, VectorTest, that will demonstrate the use of your Vector class. You must create at least two vectors, and demonstrate the use of each method. When you demonstrate the use of each method, print the results to the console ..

  Representing a topographic map

Consider a grid of size N x N that represents a topographic map. Each tile describes the characteristics of its terrain, which could be of two types: normal or mountainous. ROBBIE the robot must navigate from a starting position (xs, ys) to a goal..

  You need to prepare a java program using class

You need to prepare a java program using class and method to calculate commission of sales person with fix salary of $75,000 and 25% sales commission. Program should prompt for amount of total sales

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