Question: Please assist me with code for this task. Compulsory Task 2 Follow these steps: Code a Java program that will meet part of the clients

Please assist me with code for this task.

Compulsory Task 2 Follow these steps: Code a Java program that will meet part of the clients specifications. You dont have to meet all the clients specifications at this stage. This Capstone project will be your first deliverable for Poised. You will build upon this program in later Capstone projects. For this program, you should: o Create a class that will be used to create a project object. o Create a class that will be used to create person (e.g. architect, building contractor, etc.) objects. o Write a program that will allow a user to: Capture the details that are used to create a new project object. Change the due date of the project. Change the total amount of the fee paid to date. Update a contractors contact details. Finalise the project (but dont worry about saving it to a text file yet).

Attempted Code

//PoisedManager.java import java.io.BufferedReader; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.text.DateFormat; import java.text.ParseException; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.Scanner; public class PoisedManager { public PoisedManager() { } public static void main(String[] args) { ArrayList ProjectArray = new ArrayList(); System.out.println("************Welcome to poised your Project Management Software*************"); while(true) { System.out.println("Please make a selection from the menu: 1. Create a new project: 2. Change the due date of the project: 3. Change the total number of the fee paid: 4. Update contractors contact details 5. Finalise Project: 6. Exit Program"); Scanner input = new Scanner(System.in); String userChoice = input.nextLine(); int typedProjectNumber; String typedProjectName; String typedBuildingType; if (userChoice.equals("1")) { while(true) { try { System.out.println("Enter Project Number:"); typedProjectNumber = input.nextInt(); input.nextLine(); break; } catch (Exception var43) { System.out.println("Please enter correct format"); input.next(); } } System.out.println("Enter Project Name: "); typedProjectName = input.nextLine(); System.out.println("Enter building type: "); typedBuildingType = input.nextLine(); System.out.println("Enter project physical address: "); String typedProjectAddress = input.nextLine(); int typedErfNumber; while(true) { try { System.out.println("Enter Erf Number: "); typedErfNumber = input.nextInt(); input.nextLine(); break; } catch (Exception var42) { System.out.println("Please enter correct format"); input.next(); } } double typedTotalFee; while(true) { try { System.out.println("Enter project total fee (numbers only): "); typedTotalFee = input.nextDouble(); input.nextLine(); break; } catch (Exception var41) { System.out.println("Please enter correct format"); input.next(); } } double typedTotalPaid; while(true) { try { System.out.println("Enter amount paid by customer (number only): "); typedTotalPaid = input.nextDouble(); input.nextLine(); break; } catch (Exception var40) { System.out.println("Please enter correct format"); input.next(); } } System.out.println("Enter due date for example 12 July 2019: "); String typedProjectDeadline = input.nextLine(); String projectCompleted = "No"; Date defaultDate = null; System.out.println("Enter Architect name:"); String architectName = input.nextLine(); System.out.println("Enter Architect surname:"); String architectSurname = input.nextLine(); int architectPhoneNumber; while(true) { try { System.out.println("Enter Architect phone number"); architectPhoneNumber = input.nextInt(); input.nextLine(); break; } catch (Exception var39) { System.out.println("Please enter correct format"); input.next(); } } System.out.println("Enter Architect email address:"); String architectEmail = input.nextLine(); System.out.println("Enter Architect address:"); String architectAddress = input.nextLine(); System.out.println("Enter Customer name:"); String customerName = input.nextLine(); System.out.println("Enter Customer surname:"); String customerSurname = input.nextLine(); int customerPhoneNumber; while(true) { try { System.out.println("Enter Customer number:"); customerPhoneNumber = input.nextInt(); input.nextLine(); break; } catch (Exception var38) { System.out.println("Please enter correct format"); input.next(); } } System.out.println("Enter Customer email address"); String customerEmail = input.nextLine(); System.out.println("Enter Customer address"); String customerAddress = input.nextLine(); System.out.println("Enter Contractor name"); String contractorName = input.nextLine(); System.out.println("Enter Contractor surname:"); String contractorSurname = input.nextLine(); int contractorNumber; while(true) { try { System.out.println("Enter Contractor number:"); contractorNumber = input.nextInt(); input.nextLine(); break; } catch (Exception var37) { System.out.println("Please enter correct format"); input.next(); } } System.out.println("Enter Contractor email address:"); String contractorEmail = input.nextLine(); System.out.println("Enter Contractor address:"); String contractorAddress = input.nextLine(); Person Architect = new Person(architectName, architectSurname, architectPhoneNumber, architectEmail, architectAddress); Person Customer = new Person(customerName, customerSurname, customerPhoneNumber, customerEmail, customerAddress); Person Contractor = new Person(contractorName, contractorSurname, contractorNumber, contractorEmail, contractorAddress); Project newProject = new Project(typedProjectNumber, typedProjectName, typedBuildingType, typedProjectAddress, typedErfNumber, typedTotalFee, typedTotalPaid, typedProjectDeadline, projectCompleted, (Date)defaultDate, Architect, Customer, Contractor); ProjectArray.add(newProject); System.out.println(" New project has been created!"); System.out.println(newProject); if (typedProjectName.equals("")) { newProject.setProjectName(typedBuildingType + " " + customerSurname); } } else if (userChoice.equals("2")) { while(true) { try { System.out.println("Please enter project you want to edit by index:"); typedProjectNumber = input.nextInt(); input.nextLine(); --typedProjectNumber; break; } catch (Exception var44) { System.out.println("Enter correct format:"); input.next(); } } System.out.println("Enter new project deadline date for example 15 July 2020:"); typedProjectName = input.nextLine(); ((Project)ProjectArray.get(typedProjectNumber)).setDeadline(typedProjectName); System.out.println(((Project)ProjectArray.get(typedProjectNumber)).toString()); } else if (userChoice.equals("3")) { while(true) { try { System.out.println("Please enter project you want to edit by index:"); typedProjectNumber = input.nextInt(); input.nextLine(); --typedProjectNumber; break; } catch (Exception var46) { System.out.println("Enter correct format:"); input.next(); } } while(true) { try { System.out.println("Enter new fee paid by the customer:"); double newFeePaid = input.nextDouble(); input.nextLine(); ((Project)ProjectArray.get(typedProjectNumber)).setAmountPaid(newFeePaid); break; } catch (Exception var45) { System.out.println("Please enter correct format"); input.next(); } } System.out.println(((Project)ProjectArray.get(typedProjectNumber)).toString()); } else if (userChoice.equals("4")) { while(true) { try { System.out.println("Please enter project you want to edit by index:"); typedProjectNumber = input.nextInt(); input.nextLine(); --typedProjectNumber; break; } catch (Exception var48) { System.out.println("Enter correct format:"); input.next(); } } while(true) { try { System.out.println("Enter new contractors phone number:"); int newPhoneNumber = input.nextInt(); input.nextLine(); ((Project)ProjectArray.get(typedProjectNumber)).Contractor.setTelephoneNumber(newPhoneNumber); break; } catch (Exception var47) { System.out.println("Please enter correct format"); input.next(); } } System.out.println("Enter new contractors email address:"); typedBuildingType = input.nextLine(); ((Project)ProjectArray.get(typedProjectNumber)).Contractor.setEmailAddress(typedBuildingType); System.out.println(((Project)ProjectArray.get(typedProjectNumber)).Contractor.toString()); } else if (!userChoice.equals("5")) { if (userChoice.equals("6")) { return; } System.out.println("Incorrect selection made try again"); } else { while(true) { try { System.out.println("Please enter project you want to edit by index:"); typedProjectNumber = input.nextInt(); input.nextLine(); --typedProjectNumber; break; } catch (Exception var49) { System.out.println("Please enter correct format"); input.next(); } } Date currentDate = new Date(); double Difference = ((Project)ProjectArray.get(typedProjectNumber)).totalFee - ((Project)ProjectArray.get(typedProjectNumber)).amountPaid; if (Difference == 0.0) { System.out.println("No invoice is needed marking project as completed"); ((Project)ProjectArray.get(typedProjectNumber)).setProjectCompleted("Yes"); ((Project)ProjectArray.get(typedProjectNumber)).setDateCompleted(currentDate); } else { System.out.println("Invoice generated"); System.out.println(((Project)ProjectArray.get(typedProjectNumber)).Customer.toString()); System.out.println("Your amount owed is R" + Difference); } } input.close(); } } } 

// Person.java

// // Source code recreated from a .class file by IntelliJ IDEA // (powered by FernFlower decompiler) // public class Person { String name; String surname; int telephoneNumber; String emailAddress; String physicalAddress; public Person(String name, String surname, int telephoneNumber, String emailAddress, String physicalAddress) { this.name = name; this.surname = surname; this.telephoneNumber = telephoneNumber; this.emailAddress = emailAddress; this.physicalAddress = physicalAddress; } public void setTelephoneNumber(int telephoneNumber) { this.telephoneNumber = telephoneNumber; } public void setEmailAddress(String emailAddress) { this.emailAddress = emailAddress; } public String toString() { String output = ""; output = output + " Name: " + this.name + " " + this.surname; output = output + " Telephone Number: " + this.telephoneNumber; output = output + " Email Address: " + this.emailAddress; output = output + " Physical Address: " + this.physicalAddress; return output; } } 

// Project.java

// // Source code recreated from a .class file by IntelliJ IDEA // (powered by FernFlower decompiler) // import java.util.Date; public class Project { int projectNumber; String projectName; String buildingType; String physicalAddress; int erfNumber; Double totalFee; Double amountPaid; String deadline; String projectCompleted; Date dateCompleted; Person Architect; Person Customer; Person Contractor; public Project(int projectNumber, String projectName, String buildingType, String physicalAddress, int erfNumber, Double totalFee, Double amountPaid, String deadline, String projectCompleted, Date dateCompleted, Person Architect, Person Customer, Person Contractor) { this.projectNumber = projectNumber; this.projectName = projectName; this.buildingType = buildingType; this.physicalAddress = physicalAddress; this.erfNumber = erfNumber; this.totalFee = totalFee; this.amountPaid = amountPaid; this.deadline = deadline; this.projectCompleted = projectCompleted; this.dateCompleted = dateCompleted; this.Architect = Architect; this.Customer = Customer; this.Contractor = Contractor; } public void setProjectName(String projectName) { this.projectName = projectName; } public void setDeadline(String deadline) { this.deadline = deadline; } public void setAmountPaid(Double amountPaid) { this.amountPaid = amountPaid; } public void setProjectCompleted(String projectCompleted) { this.projectCompleted = projectCompleted; } public void setDateCompleted(Date dateCompleted) { this.dateCompleted = dateCompleted; } public String toString() { String output = ""; output = output + " Project Number: " + this.projectNumber; output = output + " Project Name: " + this.projectName; output = output + " Building Type: " + this.buildingType; output = output + " Physical Address: " + this.physicalAddress; output = output + " Erf Number: " + this.erfNumber; output = output + " Total Fee: " + this.totalFee; output = output + " Amount Paid: " + this.amountPaid; output = output + " Deadline: " + this.deadline; output = output + " Is Project Completed: " + this.projectCompleted; output = output + " Completed Date: " + String.valueOf(this.dateCompleted); return output; } } 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!