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

Create a thread pool of 1000 threads. Name this thread pool as myPool. Create an integer variable sum, and the purpose of each thread in this pool will be to add 1 to this variable sum. Print the final value of sum in the console.


Write a program that does the following:


a. Prompts the user to input five decimal numbers.

b. Prints the five decimal numbers.

c. Converts each decimal number to the nearest integer.

d. Adds the five integers.

e. Print the sum and the average of the five integers


Write a java program named MyInsurance that uses an Interface Classes named FamilyInsurance and IndividualInsurance and at least TWO (2) subclasses of health plan for each that provides a comprehensive medical coverage (eg, Critical Ilness plan, BabyCare plan, Hospitalised plan and etc). Your program also able to calculate the starter insurance fees for the first timer for one year during the entry, the calculation for the plan may be vary depends on age, category. And provide as well the monthly fee for the coming years depends on the annual rate of the health plan insurers, age and renew insurance (if any).


Apply encapsulation and abstraction (Interface and Abstraction) concepts.


WAP that create a class for representing a complex variable consisting the following information

1.    Two instance hidden variable real and imaginary.

2.    Two constructor’s i.e 1 default and other 2 augmented constructor.

3.    Two get methods for accessing the values of instance variable.

4.    Add methods that returns (object) the addition of two complex object.

5.    Add methods that returns (object) the subtraction of two complex object.

6.    Add methods that returns (object) the multiply of two complex object.




Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (and hopefully funny) ways.

Write a program that takes a string and an integer as input, and outputs a sentence using the input values as shown in the example below. The program repeats until the input string is quit and disregards the integer input that follows.

Ex: If the input is:

apples 5

shoes 2

quit 0

the output is:

Eating 5 apples a day keeps you happy and healthy.

Eating 2 shoes a day keeps you happy and healthy


Answers the question below:



1. What do you call the 1st array/index in two dimensional array?



2. What do you call the 2nd array/index in two dimensional array?



3. What is the output of the given code?



double[] sales = {12.5, 32.50, 16.90, 23, 45.68,


9, 10.5};



for(int i=0; i<sales.length; i++)



{ } System.out.print(sales.length);




4. What is the output of the given code?



double[][] sales = {



{12.5, 32.50}, (16.90, 23, 45.68}, {1, 2, 3, 4},


};



System.out.print(sales[2][1]);




5. What is the output of the given code?



double[][] sales = {



(12.5, 32.50), (16.90, 23, 45.68}, {1, 2, 3, 4),



}; System.out.print(sales[1][1]);




Calculate interest of bank using interface in java

Jaya Jusco (JJ) Sdn Bhd needs you to develop an application to calculate their customer JJ point’s reward. Define a class named Customer with the following variables declarations:


String CustName;

String CustAddress;

int pointRewards;

 

a)  Provide a default constructor and another constructor with three parameters. The constructor with parameters will assign the three values (String CustomerName, String CustomerAddress, int point). Define a public instance method named calculatePoint()to calculate the customer rewards if the point is greater than 300 points. The formula indicates that if the point is greater than 300 points, the system will add up extra 50 points.


b)Define another class named Testing to test the Customer class. Use the Scanner method to get the CustomerName, CustomerAddress and point values from the user. Declare class and create object Customer. Call the calculatePoint( ) method to display the current customer points reward.



In this project, students are to use Java to develop a payroll software to assist in paying the salary of employee/staff of a certain university named XYZ University. Assume we have three employees in the university with ranks -  Programmer, Admin and Librarian, write a Java program to calculate and printout the total salary of these three employees in the institution. The program should have the following features: 1) 2) 3) 4) 5) 6) 7) Create a public class named: Employee that would get the firstname and lastname of each employee from the keyboard/user Create three objects: prog, adm and lib, for programmer, admin and librarian respectively to access the properties in Employee class. Create EmployeeSalary as parent interface to store basic_sal, housing_all and transport_all. The values for these three items are fixed for all Employee and has abstract function calculateSalary.


Greedy Businesssman:





Sam is a greedy businessman who has opened N stores in a city.at various locations.





The locations of stores are stored in 1 2-Dimensional array.the coordinates of ith store are defined as follows:





starting point would be input[0][i] and ending location would be input[1][i].





for example:when i=0,input[0][0]=2 and input [1][0]=5,it means that the 0th store spans from 2 uniits to 5 units.





The greedy businessman wants to set up warehouse =s which can supply goods to these stores.





A warehouse can only be set up at a good location.A location is said to be good location if it is lying in the ranfe of [a,b],where a denotes the starting unit of a store and b denotes the end unit of any store S(a,b).





for example: a location ‘X’ is a good location with respect to the store (a,b) ifa<==X<=b.





Note:there can be more than one stores located at a particular.





Example1:





input1:2





input2:{{1,2},{3,5}}





output1:1

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS