Question: why am i getting wrong answer for the test cases even though the output is correct? public String tostring() { return priority: +gethighpriorityItem()+ +





public String tostring() \{ return "priority: "+gethighpriorityItem()+" " + "outstanding: "+ getnumAss fgnment()+" + "Complete:" +getnumComplete()+" + "Hours Aval:"+gethoursAvalable ()+ " + "Tot. Points:"+gettotalpoints()+" "; 3 AssignPlan() \{ AssignP Lan(int numAssigns) 1 numAssignment=numAssigns; 3 AssignPlan(String highpriorityItem, int numAssigns, int numComplete, int hot t this.highPriorityItem=highPriorityItem; this, numAssignment=numAssigns; this. numComp lete=numComplete; this. hoursAvailable=hoursAvailable; this . totalPoints=totalPoints; 3. public void setPriorityTo(String aname) . this.highPriority I tem=aname; j void handleUrgentAssignment(String name, int efforts, int resources, int di \{. Assignment newAssignment=new Assignment (name, efforts, resources, difficu this.highPriorityItem=name; this. numAss ignment=this. numAssignment +1; this. numComplete=this. numComplete+1; this. hoursAvai lable=this, hoursAvai lable-efforts; this. totalPoints=this. totalPoints +newAssigninent. get Score (); rclass Assignment \{ private String name; private int efforts; private int numResources; private int estDifficulty; private double expscore; public Assignment(String name, int efforts, int numResources, \{ this . name=name; this. efforts=efforts; this. numResources=numResources; this. estDifficulty=estDifficulty; this. expscore =0.1 (this. efforts*estDifficulty+Math. pow(this. efforts*numResources, 3 public string getName() I. return name; ] public int getefforts() f. return efforts; \} public int getresources() return numResources; 7) public int getdifficulty (f) I return estDifficulty; J public double getscore() 1 return expscore; pubtic class Tester public static void main(String[] args) throws IoException {, BufferedReader bufferedReader = new BufferedReader (new InputstreamReader (System. in)); int t= Integer , parseInt (bufferedReader, readtine (),trim() ); for (int test =0; test sts", " ").s if (firstMultipleinput. Length ==5 ) \{ String highestPriorityItem = firstMultipleInput [0]; int numoutstanding = Integer.parseInt(firstMultipleInput[1]); int numComplete = Integer.parseInt (firstMultipleInput [2]); int hoursAvailable = Integer.parseInt (firstMultipleInput[3]); double totalPoints = Double.parseDouble(firstMultipleInput [4] ); AssignPlan a = new AssignPlan(highestPriorityItem, numoutstanding, numComplete, hoursAvat lable, totalPoints); aplan =a; 1 if (firstMultipleInput. length ==1 ) Int numoutstanding = Integer. parseInt(firstMultipleInput [] ); AssignPlan a = new AssignPlan(numoutstanding); aptan =a; ] String aname = bufferedReader. readLine(); if (aname, length() >0) Int assan, setPriorityTo(aname); Int assigns = Integer.parseInt (bufferedReader, readhine(), trim()); for (int anum=0; anum(1 (secondinput=anut1)) 1 if (secondMultipleTnput. length =44 ) Your code did not pass this test case. Input (stdin) 1100 Your Output (stdout) Priority: outstanding:10 complete: 0 Hours Aval:0 Tot. Points:0.0 Expected Output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
