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 13:30
1. technician a says horsepower information can be used by consumers to compare the power of different automobile engines. technician b says that manufacturers will often list the horsepower output of their engines in the online service information. who is right?
Answers: 2
question
Computers and Technology, 22.06.2019 15:30
What is a costume plot? why is it important to a film or theater production?
Answers: 2
question
Computers and Technology, 23.06.2019 00:30
Quick pl which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
What can a word user do with the customize ribbon dialog box? check all that apply. minimize the ribbon add a new tab to the ribbon remove a group from a tab add a group to a tab choose which styles appear choose which fonts appear choose tools to appear in a 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.05.2021 21:40
question
Mathematics, 10.05.2021 21:40
question
Mathematics, 10.05.2021 21:40
question
Mathematics, 10.05.2021 21:40
question
Mathematics, 10.05.2021 21:40
Questions on the website: 13722360