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

1/Write java application with the following information:


- Class Name ; Student


- Method1: AddStudent


- Method2: Print Students


- Method 3: totalStudent


- Method 4: Delete Student

Create a program that will display the corresponding remark of a given input grade. The range of grades and its corresponding remark are given below:



Note: Use switch case statement



Range of Grades Remarks


90-10 Excellent


80-89 Good


75-7 Fair


50-74 Poor


Other grades Out-of-range



Create an EMPLOYEE class having First Name, Last Name, socialSecurityNumber(SSN). Class SalariedEmployee extends class Employee having weeklySalary as a member. An overloaded method CalculateEarnings to calculate a SalariedEmployee’s earnings. Class HourlyEmployee also extends Employee and have hourlyWage and hoursWorked as data members with overloaded method CalculateEarnings. Class CommissionEmployee having commissionRate and grossSales as data members extends class Employee with overloaded method CalculateEarnings.

In main class make ArrayList of Employees to display:

1)Employee with highest Earning.2)Employee with Lowest Earning.3)Average Earnings of all employees.4)Earning of employees on odd positions.5)Display Earning according to alphabetical order.


A member class has id, name and payment rate. In member class make abstract method: calculateSalary(): that calculates Salary of each member in arraylist. Write another class ContractMember that extends Member

a. Provide a data member contractStart and contractEnd (LocalDateTime) 

b. Provide a static constant TAXRATE and initialize it to 0.07

d. Override the method calculateSalary which calculates the salary by finding the number of days between the start and end of the contract and callculating the salary for these days @ of the rate defined earlier. The method then deducts tax from this amount @ the TAXRATE and returns the net payable amount as salary.

Build a class AdHocMember which extends the ContractMember

a. Add an instance variable status (booelan).

b.Provide getter,setter and appropriate constructor. The status of an AdHocMember is true by default

c.Override the calcualteSalary method so that it calculates the salary as done in the ContractEmployee if the status is true and returns 0 otherwise. 


Create a simple text-based console game that implements at least three (3) interfaces. 


Which is the output of the below code fragment:

System.out.print(“The result is: “ + (3+2))

System.out.println(“You did a great job!”)

A. The result is + (3+2)You did a great job!

B. The result is + 5You did a great job!

C. The result is 5You did a great job!

D. The result is 5 You did a great job


5. In the following code, what is the final value of b

int a =0, b;

for (int i = 20; i>0; i=i-5)

{

b=a++;

}

a. 3

b. 4

c. 5

d. 20


Write a program to calculate the voltage when the value of electric current and resistance

 Consider the following program, what is the output? (2 marks)

 class overload

 {

 int x;

 double y;

 void prod(int n)

 {

 for (int i=1;i<n;i++)

 x=x*i

 }

 void prod(int n, int m)

 {

 for (int i=n;i<m;i++)

 y=y*i

 }

 overload()

 {

 this.x = 1;

 this.y = 1;

 }


}

 class Overload_methods

 {

 public static void main(String args[])

 {

 overload obj = new overload();

 int n = 2;

 int m = 4;

 obj.prod(n);

 obj.prod(n,m);

 System.out.println(obj.x + " " + obj.y);

 }

 }


Which is the following is the correct format for: sum = sum*2? A. sum=*2

B. sum*2

C. sum*=2

D. sum*2=sum


LATEST TUTORIALS
APPROVED BY CLIENTS