Java | JSP | JSF Answers

Questions: 4 418

Answers by our Experts: 3 943

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write an "Employee" class that keeps data attributes for the following pieces of information:
• Employee name
• Employee number
Next, write a class named "Software_Developer" that is a subclass of the "Employee" class. The "Software_Developer" class should keep data attributes for the following information:
• Shift number (an integer, such as 1, 2, or 3)
• Hourly pay rate
The workday is divided into two shifts: day and night. The shift attribute will hold an integer value representing the shift that the employee works. The day shift is shift 1 and the night shift is shift 2. Write the appropriate accessor and mutator methods for each class.
Once you have written the classes, write a program that creates an object of the "Software_Developer" class and prompts the user to enter data for each of the object’s data attributes. Store the data in the object and then use the object’s accessor methods to retrieve it and display it on the screen
Consider the following declarations:
public class XClass
{
private int u;
private double w;
public XClass()
{
}
public XClass(int a, double b)
{
}
public void func()
{
}
public void print()
{
}
}
XClass x = new XClass(10, 20.75);
Write a Java statement that creates the XClass object t and initializes
the instance variables of t to 20 and 35.0, respectively.
Write the definition of a class that has the following properties:
d. Write the definitions of the methods and constructors of the class
Stock as described in part c.
Write the definition of a class that has the following properties:
a. The name of the class is Stock.
b. The class Stock has four instance variables: name of type String,
previousPrice and closingPrice of type double, and
numberOfShares of type int.
Consider the following declarations:
public class XClass
{
private int u;
private double w;
public XClass()
{
}
public XClass(int a, double b)
{
}
public void func()
{
}
public void print()
{
}
}
XClass x = new XClass(10, 20.75);
a. How many members does class XClass have?
b. How many private members does class XClass have?

Ahmad sent 16 December at 09:43
c. How many constructors does class XClass have?
d. Write the definition of the member func so that u is set to 10 and w is
set to 15.3.
e. Write the definition of the member print that prints the contents of u
and w.
f. Write the definition of the default constructor of the class XClass so
that the instance variables are initialized to 0.
g. Write the definition of the constructor with parameters of the class
XClass so that the instance variable u is initialized to the value of a and
the instance variable w is initialized to the value of b.
h. Write a Java statement that prints the values of the instance variables of x.
Consider the definition of the following class:
class CC
{
private int u;
private int v;
private double w;
public CC() //Line 1
{
}
public CC(int a) //Line 2
{
}
Ahmad sent 16 December at 09:42
public CC(int a, int b) //Line 3
{
}
public CC(int a, int b, double d) //Line 4
{
}
}
. Find the syntax errors in the definition of the following class:
public class BB
{
private int one;
private int two;
public boolean equal()
{
return (one == two);
}
public print()
{
System.out.println(one + " " + two);
}
public BB(int a, int b)
{
one = a;
two = b;
}
}
. Find the syntax errors in the definition of the following class:
public class BB
{
private int one;
private int two;
public boolean equal()
{
return (one == two);
}
public print()
{
System.out.println(one + " " + two);
}
public BB(int a, int b)
{
one = a;
two = b;
}
}

Miss Smith has 10 students in her class. Give Alex random marks between 55 and 95 foreach assessment.

Alex gets feedback based on the following criteria: If the average is below 65, tell Alex to complete all the homework and display the average. If the average is more than 85, take away 2 from each mark above 90 and then display the average. In all other situations give Alex the option to have two more assessment marks, and recalculate the average in a new way that places more weight on the 2 new marks.

In the part of the program that give Alex the option to have another assessment:

- Describe how did you decide to set up this option

- Discuss why you went with this approach


cs 1102 unit 5
LATEST TUTORIALS
APPROVED BY CLIENTS