Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Imagine a guideline is developed that advises students on how to manage assignments. A student who uses guideline will create an AssignPlan each day, that

Imagine a guideline is developed that advises students on how to manage assignments. A student who uses guideline will create an AssignPlan each day, that will manage summarized data about the set of assignments. The student will then create each Assignment to be done that day. For this lab, we will make the simplifying assumption that all assignments can be done within a day (ie. No assignment will be carried forward to another day). Also, note that while a real implementation may associate each Assignment with an AssignPlan, for this lab we are not concerned with coding the associations.

Create accessor methods for the private variables numAssignments, numComplete, totalPoints, hoursAvailable and highestPriorityItem.

Create an alternative constructor that accepts and sets numAssignments, numComplete, totalPoints, and highestPriorityItem.

Implement a mutator function to set highestPriorityItem

Implement a class to represent an Assignment. i. The Assignment class will privately store information on it's name(String), effort (hours required to complete)(int), the number of resources to be referenced (int), the estimated difficulty(int), and the expected score(double). ii. Create a constructor for a Assignment, that accepts the effort, resources and difficulty. The constructor then evaluates and stores the cost of an assignment, using the formula below, which was supplied by a well paid consultant. (If the formula isunclear, look at the associated PDF which should have a nicer rendering)

= . ( + ( )^/(*) ) (Note: Use the PI attribute of the Math class

c.The Assignment has acccessors for all private attributes

Complete the getUrgentAssignment method of the AssignPlan object so that it

a. Creates an Assignment with knowledge of it's name, difficulty, resources and effort

b. Set's the name of the highest priority item to the new assignment

c. Increments the number of outstanding assignments, as well as the number of completed assignments by 1

d. Update the hoursAvailable by subtracting the effortHours (NOTE!!! A full implementation would test if there were sufficient hours available, but you may ignore that concern for this lab)

e. Update the total points by adding the score calculated on the assignment .

Output Format

.

Sample Input 0

1 10 0 

Sample Output 0

====================== -----TODAY'S PLAN----- ---------------------- Priority: Assignments:10 Completed:0 Hours Avail:0 Tot. Points:0.0 

Sample Input 1

1 EasyCheesy 10 20 12 50 0 

Sample Output 1

====================== -----TODAY'S PLAN----- ---------------------- Priority:EasyCheesy Assignments:10 Completed:20 Hours Avail:12 Tot. Points:50.0 

Sample Input 2

1 EasyCheesy 10 20 12 50 Getting_interesting 0 

Sample Output 2

====================== -----TODAY'S PLAN----- ---------------------- Priority:Getting_interesting Assignments:10 Completed:20 Hours Avail:12 Tot. Points:50.0 

Sample Input 3

1 EasyCheesy 10 20 12 50 1 A_Wha_Dis??? 0 0 1 

Sample Output 3

====================== -----TODAY'S PLAN----- ---------------------- Priority:A_Wha_Dis??? Assignments:11 Completed:21 Hours Avail:12 Tot. Points:50.0 

Sample Input 4

1 EasyCheesy 10 20 12 50 2 A_Wha_Dis??? 2 0 1 Sas_Crise_Mi_A_Ded!!! 3 0 1 

Sample Output 4

====================== -----TODAY'S PLAN----- ---------------------- Priority:Sas_Crise_Mi_A_Ded!!! Assignments:12 Completed:22 Hours Avail:7 Tot. Points:50.5 

Sample Input 5

1 EasyCheesy 10 20 12 50 3 A_Wha_Dis??? 2 2 1 Sas_Crise_Mi_A_Ded!!! 3 3 1 Ow_Im_Suh_Wikid?!?! 4 2 5 

Sample Output 5

====================== -----TODAY'S PLAN----- ---------------------- Priority:Ow_Im_Suh_Wikid?!?! Assignments:13 Completed:23 Hours Avail:3 Tot. Points:56.5

import java.io.*; import java.math.*; import java.security.*; import java.text.*; import java.util.*; import java.util.concurrent.*; import java.util.function.*; import java.util.regex.*; import java.util.stream.*; import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.toList;

//Implement the AssignPlan class here

class AssignPlan{ private String highestPriorityItem=""; private int numAssignments, numComplete, hoursAvailable; private double totalPoints;

//Question 1. Properly implement accessor methods for the private variables highestPriorityItem, numAssignments, numComplete, hoursAvailable, totalPoints. private String getHighestPriorityItem(){return highestPriorityItem;} public int getNumAssignments(){return 0;} public int getNumComplete(){return 0;} public int getHoursAvailable(){return 0;} public double getTotalPoints(){return 0.0;} public String toString(){

return "====================== " + "-----TODAY'S PLAN----- " + "---------------------- " + "Priority:"+getHighestPriorityItem()+" " + "Assignments:"+getNumAssignments()+" " + "Completed:"+getNumComplete()+" " + "Hours Avail:"+getHoursAvailable()+" " + "Tot. Points:"+getTotalPoints()+" "; }

public AssignPlan(){ }

public AssignPlan(int numAssigns){ numAssignments = numAssigns; } //Question 2. Implement an alternate constructor for DailySchedule public AssignPlan(String hPriorityItem, int nAssigns, int nComplete, int hAvailable, double tPoints){ //complete this constructor }

//Question 3. Implement a mutator function to set the highestPriorityItem public void setPriorityTo(String aname){} public void handleUrgentAssignment (String name, int effort, int resources, int difficulty){} //Question 5. Complete the getUrgentAssignment method of the AssignPlan object so that it // a. Updates the highest priority item to the value of the incoming name // b. Creates an Assignment with knowledge of the difficulty, resources and effort // c. Increments the number of assignments in the AssignPlan by 1 // d. Increments the number complete by 1 // e. Update the hoursAvailable by subtracting the effortHours // f. Update the total points by adding the points calculated on the assignment. }

class Assignment{ //Question 4. //The Assignment class will privately store information on the effort (hours required to complete)(int), the number of resources to be referenced (int), the estimated difficulty(int), and the expected score(double). //Create a constructor for an Assignment, that accepts the name, effort, resources and difficulty. The constructor then evaluates and stores the expected score of the asignment, //The Assignment returns accessors for all private variables //The method that returns the score should round to 1 decimal point

}

public class Tester { public static void main(String[] args) throws IOException { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(bufferedReader.readLine().trim()); for(int test =0; test0) aplan.setPriorityTo(aname); int assigns = Integer.parseInt(bufferedReader.readLine().trim()); for (int anum=0; anum

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

More Books

Students also viewed these Databases questions

Question

2. Are you varying your pitch (to avoid being monotonous)?

Answered: 1 week ago

Question

3. Are you varying your speaking rate and volume?

Answered: 1 week ago