Java | JSP | JSF Answers

Questions answered by Experts: 3 611

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

Build a class Department having id(int), address(String) and Project(array list of projects) and Worker(array list of members). Provide a method addProject(int id, String description, double budget) that creates project and adds it to project list. Provide method addWorkerToProject(int projId, int wId) that searches for project with projId from projects list and worker with wId from members lists and adds member to project (you will call appropriate method of project class that will add member to project. Provide a method getProjectCost(int pid) which searches for project with given id from projects list and returns its total cost (you can call method from project class to get total cost) . Provide a method getDepartmentTotalBudget() that calculates total cost of each project of the department and adds it up to get total budget (call appropriate method of Project instances for project costs) .Provide toString of department so that it outputs all details including each project and members in each project.


Build a class Worker having id(int), name(Sting), hoursWorked(int), salRate (double) 

a. Provide a constructor Worker(int id, String name, double salRate). The hoursWorked will 

be initially 0 

b. Provide getters for each but setters for only salRate 

Provide a method addHours(int h) that increase the number of hoursWorked by the 

provided value. 

d. Provide a method getCurrentSalary() that calculates and returns the current salary i.e. 

the hoursWorked times the salRate. 

e. Override the toString to get appropriate output


Build a class Department having id (int), address (String) and projects (array list of projects) and 

workers (array list of workers) 

Provide parameterized constructor Department (String address) which initialized id randomly & array lists as empty array lists. Provide method addWorker(int id, String name, double salRate) that adds instance of Worker to workers list. Provide a method addProject(int id, String description, double budget) that creates project & adds it to the project list. Provide method addWorkerToProject(int projId, int wId) that searches for the project with projId from projects list and worker with wId from members lists & adds member to project (you will call appropriate method of the project class that'll add member to project.

Provide method getProjectCost(int pid) which searches for project with given id from projects list and then returns its total cost (you call method from the project class to get total cost. Provide toString of department to outputs all details.


Provide a method addProject(int id, String description, double budget) that creates a project and adds it to the project list e. Provide method addWorkerToProject(int projId, int wId) that searches for the project with projId from the projects list and worker with wId from the members lists and then adds the member to the project (you will call appropriate method of the project class that will add the member to the project. See blow the project class for details. f. Provide a method getProjectCost(int pid) which searches for the project with the given id from the projects list and then returns its total cost (you can call a method from the project class to get the total cost… see the project class for details) g. Provide a method getDepartmentTotalBudget() that calculates the total cost of each project of the department and adds it up to get the total budget (You will call appropriate method of the Project instances to get the project costs) h.


The workers work for some hours on each assigned projects which adds to the total number of hours and the salary is calculated according to the salary rate of each worker. The project duration is the total number of hours worked by each member of the project. Each project has some budget but the total cost of the project is the sum of budget and the salary of each project member. Follow these steps to build your application. 1. Build a class Department having id (int), address (String) and projects (array list of projects) and workers (array list of workers) a. Provide parameterized constructor Department (String address) which initialized id randomly and array lists as empty array lists b. Provide getters for id and address and setter for address only c. Provide a method addWorker(int id, String name, double salRate) that creates an instance of Worker and adds it to the workers list d.


Provide a method addMemberHours(int wId, int h) that finds the Worker with the wID in the members list and then adds worker hours to the instance. (You can call an appropriate method of the worker class for this. See details in the above section). These many hours should also be added to the duration of this project. E.G. if this method is called with arguments 2, 5, this would mean that you find the worker with id 2 in the members list and then call an appropriate method of the instance to add 5 hours to the hoursWorked of this worker. Also add 5 to the duration of this project. f. Provide a method getTotalCost() that calculates the total cost of the project by summing the budget and the salary of each member of the project. The salary of each m ember can be found by calculating an appropriate method of the Worker class g. Override the toString method to get appropriate output.  


Build a class Project with id(int) , desc (String), duration (int) , budget (double) and members (ArrayList of Workers). a. Provide a parameterized constructor Project (int id, String desc, double budget). The member array will be initialized as empty array and the initial duration of the project will be 0 b. Provide setters for description and budget and getters for all except members list c. Provide a method addMember(Worker m) that adds the worker instance to the members array list d. Provide a method Worker getMember(int wId) that searches for the worker with the given id in the members list and returns instance.  


Build a class Worker having id(int), name(Sting), hoursWorked(int), salRate (double) a. Provide a constructor Worker(int id, String name, double salRate). The hoursWorked will be initially 0 b. Provide getters for each but setters for only salRate c. Provide a method addHours(int h) that increase the number of hoursWorked by the provided value. d. Provide a method getCurrentSalary() that calculates and returns the current salary i.e. the hoursWorked times the salRate. e. Override the toString to get appropriate output  


Write a Java GUI application that will keep track of sport vehicle details. The application must contain the vehicle name, vehicle price, 0 – 100 in seconds and the engine size.


Q.3.1 On the form create three radio buttons and a list box to display the vehicle details. Also create a submit button that when clicked will display the vehicle name, vehicle price, 0 – 100 in seconds and engine size.


Q.3.2 Create a sequential file (cars.txt) that contains data for the following fields: • The vehicle name • The vehicle price • The speed from 0 to 100 in seconds • The engine size


Write a Java application and use a Two dimensional array to store five Dutch, French and Italian translated words. Use a single array to store the English words.  Your program must:

Q.2.1 Contain a single array to contain the following five English words and a Two dimensional array to store the following Dutch, French and Italian translated words. ENGLISH WORD  sky, run, study, music

 DUTCH WORD hemel, rennen, studie, muziek

FRENCH WORD ciel, courir, etude, musique

ITALIAN WORD   cielo, correre, studia, musica

                 

Q.2.2 Print out each English word with the translated Dutch, French and Italian word.


LATEST TUTORIALS
APPROVED BY CLIENTS