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, 24.06.2019 00:30
Setting up a home network using wireless connections is creating a a. vpn b. lan c. wan d. mini-internet
Answers: 2
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe what
Answers: 1
question
Computers and Technology, 24.06.2019 07:00
Jean has kept the content of her website limited to what is important; she has also ensured that the text follows a particular style and color all throughout her website. which website features has jean kept in mind? jean has limited the content of her website to what is important; this ensures (clarity, simplicity, harmony and unity) of the content. she has also formatted the text in a particular style and color throughout her website, ensuring (balance, simplicity, consistency)
Answers: 2
question
Computers and Technology, 24.06.2019 11:00
Under the home tab, where can a user find options to change the bullet style of an outline? in the slides group in the font group in the paragraph group in the drawing group
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
Mathematics, 10.12.2020 21:10
question
English, 10.12.2020 21:10
Questions on the website: 13722363