Question: I am getting Wrong answer evem though i have the right input/output look in compiler message - please help me fix it CODE IS BELOW
I am getting Wrong answer evem though i have the right input/output look in compiler message - please help me fix it
CODE IS BELOW
Your code did not pass this test case.
Input (stdin)
1 10 0
Your Output (stdout)
Priority: Outstanding:10 Complete:0 Hours Aval:0 Tot. Points:0.0
Expected Output
====================== -----TODAY'S PLAN----- ---------------------- Priority: Assignments:10 Completed:0 Hours Avail:0 Tot. Points:0.0
Compiler Message
Wrong Answer
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;
class AssignPlan { private String highPriorityItem=""; private int numAssignment,numComplete,hoursAvailable; private double totalPoints; private String gethighPriorityItem() { return highPriorityItem; } public int getnumAssignment() { return this.numAssignment; } public int getnumComplete() { return this.numComplete; } public int gethoursAvailable() { return this.hoursAvailable; } public double gettotalPoints() { return this.totalPoints; } public String toString() { return "Priority:"+gethighPriorityItem()+" "+ "Outstanding:"+getnumAssignment()+" "+ "Complete:"+getnumComplete()+" "+ "Hours Aval:"+gethoursAvailable()+" "+ "Tot. Points:"+gettotalPoints()+" "; } AssignPlan() { } AssignPlan(int numAssigns) { numAssignment=numAssigns; } AssignPlan(String highPriorityItem,int numAssigns,int numComplete,int hoursAvailable,double totalPoints) { this.highPriorityItem=highPriorityItem; this.numAssignment=numAssigns; this.numComplete=numComplete; this.hoursAvailable=hoursAvailable; this.totalPoints=totalPoints; } public void setPriorityTo(String aname) { this.highPriorityItem=aname; } void handleUrgentAssignment(String name,int efforts,int resources, int difficulty) { Assignment newAssignment=new Assignment(name,efforts,resources,difficulty); this.highPriorityItem=name; this.numAssignment=this.numAssignment+1; this.numComplete=this.numComplete+1; this.hoursAvailable=this.hoursAvailable-efforts; this.totalPoints=this.totalPoints+newAssignment.getScore(); }
}
class Assignment{ private String name; private int efforts; private int numResources; private int estDifficulty; private double expScore; public Assignment(String name,int efforts,int numResources,int estDifficulty) { this.name=name; this.efforts=efforts; this.numResources=numResources; this.estDifficulty=estDifficulty; this.expScore=0.1*(this.efforts*estDifficulty+Math.pow(this.efforts*numResources,2)/(Math.PI*Math.sqrt(estDifficulty))); } public String getName() { return name; } public int getEfforts() { return efforts; } public int getResources() { return numResources; } public int getDifficulty() { return estDifficulty; } public double getScore() { return expScore; } }
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; test
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
