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
Create a program that will make ask the user to input an integer then display the equivalent day of the week. 1 is Sunday, 2 is Monday and so on. If the inputted number is not within 1-7m output is ''Day is not available!''.
Use nested While loops to produce the following pattern:
! ! ! ! ! ! ! ! ! ! ! !
\ \ ! ! ! ! ! ! ! ! / /
\ \ \ \ ! ! ! ! / / / /
\ \ \ \ \ ! ! / / / / /
Write nested for c++ loops to produce the following output.
×××× / / / / / / / / ××××
××× / / / / / / \ \ ×××
×× / / / / \ \ \ \ ××
× / / \ \ \ \ \ \ ×
\ \ \ \ \ \ \ \
Write and run a 8086 assembly language program that finds the factorial of first N natural numbers. The value of N is input to the assembly program. The factorial value is stored in AX register. Assume that the value of N is between 1 and 5 only.