Computers and Technology
Computers and Technology, 24.03.2021 19:00, SmokeyRN

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;
}
}

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 01:50, bessieyounger1211
Click on this link toopens a new window. bring up a flowchart in a new browser window. based on this flowchart, would a d-link 3347 gateway with an xbox 360 multiplayer problem be in scope or out of scope
Answers: 2
image
Computers and Technology, 22.06.2019 18:10, AdoNice
How can i delete permalinks from a word press site?
Answers: 1
image
Computers and Technology, 23.06.2019 07:30, Morganwing1019
To check spelling errors in a document, the word application uses the to determine appropriate spelling. internet built-in dictionary user-defined words other text in the document
Answers: 2
image
Computers and Technology, 23.06.2019 08:30, Calirose
When you interpret the behavior of others according to your experiences and understanding of the world your evaluation is
Answers: 1
Do you know the correct answer?
Status: Not Submitted In this lesson, we are going to create an Assignment superclass with a Test a...

Questions in other subjects:

Konu
Social Studies, 16.05.2020 09:57
Konu
Mathematics, 16.05.2020 09:57
Konu
Mathematics, 16.05.2020 09:57