subject

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: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:50
Match the personality traits with their description
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
Write a grading program for a class with the following grading policies: a. there are two quizzes, each graded on the basis of 10 points. b. there is one midterm exam and one final exam, each graded on the basis of 100 points. c. the final exam counts for 50% of the grade, the midterm counts for 25%, and the two quizzes together count for a total of 25%. (do not forget to normalize the quiz scores. they should be converted to a percentage before they are averaged in.) any grade of 90 or more is an a, any grade of 80 or more (but less than 90) is a b, any grade of 70 or more (but less than 80) is a c, any grade of 60 or more (but less than 70) is a d, and any grade below 60 is an f. the program will read in the student’s scores and output the student’s record, which consists of two quiz and two exam scores as well as the student’s average numeric score for the entire course and final letter grade. define and use a structure for the student reco
Answers: 2
question
Computers and Technology, 23.06.2019 21:00
Uget brainliest if accurate mary has been given the responsibility of hiring a person for the position of a software testing officer. which management function would mary achieve this responsibility?
Answers: 1
question
Computers and Technology, 24.06.2019 01:30
Write a program that asks the user to enter the name of an input file. if the file does not exist, the program should prompt the user to enter the file name again. if the user types quit in any uppercase/lowercase combinations, then the program should exit without any further output.
Answers: 3
You know the right answer?
In this lesson, we are going to create an Assignment superclass with a Test and Project subclass. A...
Questions
question
Social Studies, 28.08.2019 19:30
question
Mathematics, 28.08.2019 19:30
Questions on the website: 13722362