Categories

Site Information

 Loading... Please wait...
  • My Account
  • Gift Certificates
  • Image 1

What is wrong with the following variable declarations? (1 Mark). int Km*h = 90; String double = student1; int int1 = "50";

$15.00
Quantity:
The Best Essay Writing Service - EssayBox.org

Product Description

Q1. What is wrong with the following variable declarations? (1 Mark).
int Km*h = 90;
String double = student1;
int int1 = "50";
String newCourse = "CS-140"
int y = x;
String 1_Car = "BMW";
Q2. What does this sequence of statements print? (1 Mark).
String msg = "The number of characters in the title of this course is: ";
String newCourse = "Computer Programming I";
int numberOfCharacters = newCourse.length();
String courseUpperCase = newCourse.toUpperCase();
System.out.print(newCourse);
System.out.println(courseUpperCase);
System.out.print(msg);
System.out.println(newCourse.length());
System.out.print("Welcome to : ");
System.out.println(newCourse);
newCourse.replace("I", "II");
System.out.print("Good luck ");
//System.out.println(“to all students”);
System.out.print("for the course ");
System.out.println(newCourse); Ministry of Higher Education
Saudi Electronic University
College of Computing and Informatics Q3. Given the following Java code segment, answer the three questions below:
public class BankAccount
{
private double balance;
public BankAccount()
{
balance = 0;
} } public BankAccount(double initialBalance)
{
balance = initialBalance;
System.out.print("Balance is: ");
System.out.println(balance + 10);
}
1- Is “public BankAccount()” considered as a constructor? Why?
2- What is the output of "new BankAccount(10.5) ";
3- Write a method that may be used to withdraw an amount? (1 Mark).
Q4. Implement a class Employee. An employee has a name (string) and a salary
(double).
1- Write a default constructor.
2- Write a constructor with two parameters (name and salary).
3- Write methods to return the name and salary.
(1 Mark). Q5. In the 2- dimensional plane, a point is described by its two coordinates x and y.
It supports these operations:
- A constructor allowing initialization of coordinates
- 4 methods to set and get the values of the coordinates x and y
- Translation of a point
1- Write a class, called MyPoint that corresponds to an abstraction of points in
the dimensional plane.
2- Provide a tester class that creates one point, then translate and display the
new coordinates.

Product Reviews

Write Review

This product hasn't received any reviews yet. Be the first to review this product!

Find Similar Products by Category

Click the button below to add the What is wrong with the following variable declarations? (1 Mark). int Km*h = 90; String double = student1; int int1 = "50"; to your wish list.