subject

Status: Not Submitted In this lesson, we are going to create an Assignment superclass with a Test and Project subclass.
Assignment class
The Assignment class should have the following three instance variables:
String name
double availablePoints
double earnedPoints
The constructor heading should be:
public Assignment(String name, double availablePoints, double earnedPoints)
Test class
The Test class should have the following instance variable:
String testDate
The constructor heading should be:
public Test(String name, double availablePoints,
double earnedPoints, String testDate)
Project class
The Project class should have the following instance variables:
String dueDate
boolean groups
The constructor heading should be:
public Project(String name, double availablePoints,
double earnedPoints, String dueDate, boolean groups)
Each class should have getters and setters for each of its instance variables.
AssignmentRunner class
The AssignmentRunner should loop and prompt users for an assignment name until they enter exit. After getting the name, it should prompt the user for each of the pieces of information needed to create either a test or a project.
Once the user has finished entering information, the program should call a static method to calculate the average (total points earned / total points available * 100).
Note: Remember that the Scanner nextInt(), nextBoolean(), and nextDouble() lines only read part of the line. Don’t forget to use a nextLine() before reading a new string! Check out the slides for lesson 1.6 starting on slide 21 for more details.
Lesson 1.6 Slides
Sample Output
Please enter an assignment name (exit to quit): Array Test
Please enter the available points: 100
Please enter the earned points: 95
Is this a (t)est or (p)roject: t
Please enter the test date: 4/25
Please enter an assignment name (exit to quit): MadLibs Project
Please enter the available points: 75
Please enter the earned points: 75
Is this a (t)est or (p)roject: p
Please enter the due date: 4/15
Group project? true or false: true
Please enter an assignment name (exit to quit): exit
Your average: 97.14285714285714

##AssignementTester
import java. util.*;
public class AssignmentRunner {
public static void main(String[] args) {
// Start here
}
public static double average(ArrayList assignments) {
}
}
###Assignment
public class Assignment
{
private String name;
private double availablePoints;
private double earnedPoints;
public Assignment(String name, double availablePoints, double earnedPoints)
{
this. name = name;
this. availablePoints = availablePoints;
this. earnedPoints = earnedPoints;
}
}
###Test
public class Test extends Assignment {
private String testDate;
public Test(String name, double availablePoints, double earnedPoints, String testDate)
{
super(name, availablePoints, earnedPoints);
this. testDate = testDate;
}
}
###project
public class Project extends Assignment {
private String dueDate;
private boolean groups;
public Project(String name, double availablePoints, double earnedPoints, String dueDate, boolean groups)
{
super(name, availablePoints, earnedPoints);
this. dueDate = dueDate;
this. groups=groups;
}
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 21:30
How do you take a green screen out of the video while editing?
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the
Answers: 1
question
Computers and Technology, 24.06.2019 14:30
Ahousehold consists of a married couple and their twin five-year old daughters. the couples children had no income and lived with their parents all of last year. how many exemptions can the couple claim on last years tax return or they file with the “ married filing jointly “ status? a. 4 b. 5 c. 3 d. 2
Answers: 1
question
Computers and Technology, 24.06.2019 18:20
The following if statement contains a logic error, not a syntax error. rewrite it so that it is correct. assume the variable age already exists and holds a valid number. if (age == 18 & & age == 19) {
Answers: 1
You know the right answer?
Status: Not Submitted In this lesson, we are going to create an Assignment superclass with a Test a...
Questions
question
Biology, 03.11.2021 02:00
question
History, 03.11.2021 02:00
question
Chemistry, 03.11.2021 02:00
question
Mathematics, 03.11.2021 02:00
question
Mathematics, 03.11.2021 02:00