I need a program coded in Java please. I'll provide instructions and some parts of code that will be used in the program

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

I need a program coded in Java please. I'll provide instructions and some parts of code that will be used in the program

Post by answerhappygod »

I need a program coded in Java please. I'll provide instructions and some parts of code that will be used in the program then I'll need you to add additional code as instructed in the images provided. Need ASAP. If done correctly I'll give a thumbs up. Please follow instructions.
There are multiple tasks that must be completed for each class of this program..Make sure to complete these tasks in the program.
I Need A Program Coded In Java Please I Ll Provide Instructions And Some Parts Of Code That Will Be Used In The Program 1
I Need A Program Coded In Java Please I Ll Provide Instructions And Some Parts Of Code That Will Be Used In The Program 1 (97.65 KiB) Viewed 16 times
I Need A Program Coded In Java Please I Ll Provide Instructions And Some Parts Of Code That Will Be Used In The Program 2
I Need A Program Coded In Java Please I Ll Provide Instructions And Some Parts Of Code That Will Be Used In The Program 2 (182.46 KiB) Viewed 16 times
(6 tasks to complete in Score class)
Score Class code:
package assignment;
public class Score {/*** Score cannot be less than zero or higher *than 100*Score name cannot be null. If null, set name to ""*@param scoreName*@param Score*/public Score(String score Name, double scoreVal) {}/*** @return the score*/public double getScoreValue() {return -1.0;}/*** Score cannot be less than zero or higher than 100.00* @param score scoreVal the score to set* @return true if score within range*/public boolean setScoreValue(double scoreVal) {return false;}/*** @return the scoreName*/public String getScoreName() {return "";}/*** Score name cannot be null. If null, set name to ""* @param scoreName the scoreName to set*/public void setScoreName(String scoreName) {
}
/*** toString method* Examples of return:* "Score [scoreName=qu12, score=96.0]"* "Score [scoreName=Quiz1, scoreValue=100.0]"* "Score [scoreName=Quiz23, scoreValue=23.33]"* @return String representation of Score object*/@Overridepublic String toString() {return "";}}
Score Driver code:
package assignment;
public class A3ScoreDriver {
public static void main(String[] args) {//NOTE: BELOW IS A STARTER SET OF TEST FOR YOUR ASSIGNMENT.//IT IS NOT THE ONLY SET OF TESTS YOU SHOULD DO FOR YOUR ASSIGNMENT!
//Score classScore s1 = new Score("Quiz1", 95.5);// display score nameSystem.out.println("display score name -> "+s1.getScoreName());System.out.println("display score value -> "+s1.getScoreValue());
s1.setScoreName("qu12");System.out.println("set and display new score name -> "+s1.getScoreName());
s1.setScoreValue(96.0);System.out.println("set and display new score value -> "+s1.getScoreValue());
System.out.println("Call toString method of Score -> "+s1);
Score s2 = new Score("qu12", 99.99);System.out.println("Is s2 and s1 equal? -> "+s1.equals(s2));}}
I Need A Program Coded In Java Please I Ll Provide Instructions And Some Parts Of Code That Will Be Used In The Program 3
I Need A Program Coded In Java Please I Ll Provide Instructions And Some Parts Of Code That Will Be Used In The Program 3 (250.24 KiB) Viewed 16 times
I Need A Program Coded In Java Please I Ll Provide Instructions And Some Parts Of Code That Will Be Used In The Program 4
I Need A Program Coded In Java Please I Ll Provide Instructions And Some Parts Of Code That Will Be Used In The Program 4 (162.32 KiB) Viewed 16 times
(9 tasks to be completed for Student class)
Student Class code:
package assignment;
public class Student {
/*** Use an array to store Scord objects for the quizzes* A student has at most 10 Quiz scores*/
/*** Constructor * A student has at most 10 Quiz scores* @param id the student's ID.* @param stuName The student's name.*/public Student(String stuName, int stuID) {}
/*** @return the array with all My Quiz Scores*/public Score[] getAllMyScores() {return null;}
/*** @param an array with Quiz Scores used to set my current Quiz scores*/public void setAllMyScores(Score[] arrayOfScores) {
}
/*** toString method* Example return:* "Bugsy 123456"* @return A string with the student's ID number* and name.*/public String toString() {return "";}
/*** equals method* @param another Student object (remember to cast)* @return A boolean - true if this student's ID number and name matches this student's ID number and name.*/public boolean equals(Object that) {return false;}
/*** updateScore method* @param scoreName - name of the Score object to search for and update* @param newScoreVal - new value for the searched quiz. * @return A boolean - true if the quizName already exist for this student* and the score is valid and the score array was successfully updated.*/public boolean updateAScore(String scoreName, double newScoreVal) {return false;}
/*** AddScore method* @param newScore - the Score object to Add.* @return A boolean - true if the quizName didn't exist for this student* and the score is valid and the score array was successfully updated.*/public boolean AddScore( Score newScore) {return false;}
/*** @param scoreName - name of quiz to get score* @return the score for the quiz or -1 if quizName is invalid*/public double getAScore(String scoreName) {return -1.0;}
/*** computeMyAverage method* Computes the average of the valid scores in this student's array* e.g. - Student array -> {50, null, 100, null, 150}, the average would be 100* @return this student's average score*/public double computeMyAverage() {return -1.0;}
/*** getNumberOfStudentsCreated method* Keeps track of the number of Student instances * @return the total number of Student objects instantiated */public static int getNumberOfStudentsCreated() {return -1;}
/*** @return the stuName*/public String getStuName() {return "";}
/*** @param stuName the stuName to set*/public void setStuName(String stuName) {
}
/*** @return the id */public int getID() {return -1;}}
Student Driver code:
package assignment;
public class A3StudentDriver {
public static void main(String[] args) {//NOTE: BELOW IS A STARTER SET OF TEST FOR YOUR ASSIGNMENT.//IT IS NOT THE ONLY SET OF TESTS YOU SHOULD DO FOR YOUR ASSIGNMENT!
//Score classScore s1 = new Score("Quiz1", 80.09);Score s2 = new Score("qu12", 70.3333);
//Student ClassStudent stu1 = new Student("Bugsy", 123456);System.out.println("Call toString method of Student -> "+stu1);
System.out.println("Add a Score to student -> "+stu1.AddScore(s2));
System.out.println("Get a score from student -> "+stu1.getAScore("qu12"));System.out.println("Update a Score from student -> "+stu1.updateAScore("qu12", 99.91));
stu1.AddScore(s1);System.out println("Compute average for student -> "+stu1.computeMyAverage());
Student stu2 = new Student("Daisy", 321);System.out.println("Display number of Student Objects created -> "+Student.getNumberOfStudentsCreated());
System.out.println("Check if Student stu1 and stu2 are the same -> "+stu1.equals(stu2));
Student stu3 = new Student("Daisy", 321);System.out.println("Check if Student stu2 and stu3 are the same -> "+stu2.equals(stu3));
Score[] testSetOfScores2 = {null, new Score("q1", 10), null, new Score("q2", 20), null, new Score("q3", 30), null, new Score("q4", 40), null, new Score("q5", 50)};stu2.setAllMyScores(testSetOfScores2);System.out.println("Compute average for student -> "+stu2.computeMyAverage());}}
I Need A Program Coded In Java Please I Ll Provide Instructions And Some Parts Of Code That Will Be Used In The Program 5
I Need A Program Coded In Java Please I Ll Provide Instructions And Some Parts Of Code That Will Be Used In The Program 5 (257.47 KiB) Viewed 16 times
(5 tasks to complete in Course class)
Course class code:
package assignment;
import java.util.ArrayList;
public class Course {
/*** @return the allStudents */public ArrayList<Student> getAllStudents() {return null;}
/*** @param allStudents the allStudents to set*/public void setAllStudents(ArrayList<Student> allStudents) {
}
public boolean addStudent(Student stu) {return false;}
public boolean removeStudent(Student stu) {return false;}
public boolean updateStudent(Student stu) {return false;}
/**** @return the average of all the student's quizzes*/public double computeCourseAverage() {return -1.0;}}
Course Driver class:
package assignment;
public class A3CourseDriver {
public static void main(String[] args) {//NOTE: BELOW IS A STARTER SET OF TEST FOR YOUR ASSIGNMENT.//IT IS NOT THE ONLY SET OF TESTS YOU SHOULD DO FOR YOUR ASSIGNMENT!
//Score class
//Student classStudent stu1 = new Student("Bugsy", 521);stu1 AddScore(new Score("qu12", 10));stu1.getAScore("qu12");stu1.updateAScore("qu12", 99.9);stu1.AddScore(new Score("q2", 90.1));
Student stu2 = new Student("Daisy", 321);
Student stu3 = new Student("Daisy", 321);
//Course class Course cou = new Course();System.out.println("Add Student to course successfully -> "+cou.addStudent(stu1));System.out.println("Add Student to course successfully -> "+cou.addStudent(stu2));System.out.println("Add Student to course successfully -> "+cou.addStudent(stu3));
Score[] testSetOfScores2 = {null, New Score("q1", 90), null, new Score("q2", 80), null, new Score("q3", 90), null, new Score("q4", 80), null, new Score("q5", 90)};stu2.setAllMyScores(testSetOfScores2);
Score[] testSetOfScores1 = {null, new Score("q1", 100), null, new Score("q2", 80), null, new Score("q3", 70), null, new Score("q4", 90), null, new Score("q5", 90)};stu1.setAllMyScores(testSetOfScores1);
System.out.println("Course average for all students -> "+cou.computeCourseAverage());
System.out.println("Number of Students in the Course -> "+cou.getAllStudents().size());
System.out.println("Attempt to remove a Student that is in the course -> "+cou.removeStudent(stu2));
System.out.println("Number of Students in the Course -> "+cou.getAllStudents().size());
System.out.println("Attempt to remove a Student that is NOT in the course -> "+cou.removeStudent(new Student("Mikey", 987)));}}
(I sent all the sample codes for this program in text so you can easily copy/paste them into the program to make it easier on you)
If you have any questions feel free to ask. Reminder: Follow the instructions in the images, create the classes using the sample codes I provided, adding some extra where needed, and complete the tasks for each class. I appreciate it. Thank you.
We are tasked with developing a system that represents a simple classroom grade tracking system. The My Simple Course System allows an instructor to manage Students and their Scores in a Course. Some major requirements are listed here: ● ● Each implemented class must be in separate file. Only the specified contractors should be included for the classes Score objects contains a name and a value (e.g Quiz1, 100). o The value cannot be less than 0.0 or more than 100.0. .. ● o The name cannot be null. Student objects contain name, id and an array of Score objects. o A student can have at most 10 scores (use an Array). o A Student objects can compute and return the average score of all its score objects. o The Student class can tell the number of Student objects instantiated. • The Course object can contain zero or more Student objects (use an ArrayList). The course can compute the average score of all the students' in the course.
Tasks - Score Class • Task 1: A Score object can be created by giving as an argument a name as a String, followed by a score as a double. Complete the method public Score(String scoreName, double score Val) to complete this task. See the method comments for more detail. • Task 2: The user will be able to ask for the value of a Score instance. The method will return the double representing the score's value. Complete the method public double getScoreValue() to complete this task. See the method comments for more detail. • Task 3: The user will be able ask for the name of a Score instance. The method will return the String representing the score's name. Complete the method public String getScoreName() to complete this task. See the method comments for more detail. • Task 4: The user will be able to set the value of the Score instance by giving a double as argument to the method. The method will return a boolean, true if the argument is at least 0.0 and no more than 100.0 and the value was updated in the Score instance. The method will return false if the argument is less than 0.0 or greater than 100.0 and the value will not be updated in the Score instance. Complete the method public boolean setScore Value (double score Val) to complete this task. See the method comments for more detail. ● Task 5: The user will be able to set the name of the Score instance by giving a String as argument to the method. The method will return a boolean, true if the argument is not null and the name was updated in the Score instance. The method will return false if the argument is null and the name will not be updated to the empty string in the Score instance. Complete the method public boolean setScoreName(String scoreName) to complete this task. See the method comments for more detail. • Task 6: The user will be able to ask for the textual representation of this Score instance. The method will return a String in the form specified in the example below. Complete the method public String toString() to complete this task. See the method comments for more detail. o Score [scoreName Quiz1, score Value-100.00] o Score [scoreName-Quiz23, score Value-22.33]
Tasks - Student Class • Task 1: A Student object can be created by giving as an argument a name as a String, followed by a ID as a int. Complete the method public Student(String stuName, int stulD) to complete this task. See the method comments for more detail. • Task 2: The user can add a Score object to the Student object by giving the Score object as an argument to the method. The method will return a boolean, true if the argument is not already in the Student's array and the array was updated in the Student instance and the count of Score objects in the array is incremented by 1. The method will return false if the argument is null or the Score object already exist in the Student's array and the array will not be updated in the Student instance. Complete the method public boolean AddScore(Score newScore) to complete this task. See the method comments for more detail. • Task 3: The user can update a Score object in the Student object by giving the Score name as a String and the new value as a double as argumenta to the method. The method will return a boolean, true if the Score object with that name is already in the Student's array and the array was updated with the new value in the Student instance. The method will return false if the name argument is null or the Score object does not exist in the Student's array and the array will not be updated in the Student instance. Complete the method public boolean update AScore(String scoreName, double newScore Val) to complete this task. See the method comments for more detail. • Task 4: The user will be able to ask for a specific Score's value by providing the score name as a String to the method. The method will return the double representing the score's value if a Score object with that name exist in the array. The method will return -1 if the argument is null or if the Score name does not exist in the array. Complete the method public double getAScore(String scoreName) to complete this task. See the method comments for more detail. • Task 5: The user will be able to ask for the average of all the Score object values in the array of the Student instance. The method will return the average as a double. Empty or null positions in the array should not be included in computing the average Complete the method public double computeMyAverage() to complete this task. See the method comments for more detail.
• Task 6: The user will be able to ask how many Student instances were created so far by calling the method. The method will return a int, the total number of Student instances. Complete the method public static int getNumberOfStudents Created() to complete this task. See the method comments for more detail. • Task 7: The user will be able to ask for the textual representation of this Student instance. The method will return a String in the form specified in the example below. Complete the method public String toString() to complete this task. See the method comments for more detail. O Bugs 1234567 Gus 87654320 Task 8: The user will be able to ask if this Student object equals other Student object which is given as an argument to the method. The method will return a boolean, true if this Student object's name and ID matches other Student object's name and ID. The method will return false if the names don't match or the IDs don't match or the argument is null. Complete the method public boolean equals(Object other) to complete this task. See the method comments for more detail. • Task 9: Complete the get and set methods public String getStuName(), public int getId(), public Score[] getAllMyScores(),public void setAllMyScores (Score[] arrayOfScores) to complete this task. See the method comments for more detail.
Tasks - Course Class Task 1: The user can add a Student object to the Course instance by giving the Student object as an argument to the method. The method will return a boolean, true if the argument is not already in the Course's ArrayList and the ArrayList was updated in the Course instance. The method will return false if the argument is null or the Student object already exist in the Course's ArrayList and the ArrayList will not be updated in the Course instance. Complete the method public boolean addStudent(Student stu) to complete this task. See the method comments for more detail. • Task 2: The user can remove a Student object from the Course instance by giving the Student object as an argument to the method. The method will return a boolean, true if the argument is an existing Student object in the Course's ArrayList and the Student object was removed from the ArrayList in the Course instance. The method will return false if the argument is null or the Student object does not exist in the Course's ArrayList and the ArrayList will not be updated in the Course instance. Complete the method public boolean removeStudent(Student stu) to complete this task. See the method comments for more detail. • Task 3: [EXTRA CREDIT] The user can update a Student object in the Course instance by giving the updated Student object as an argument to the method. The method will return a boolean, true if the argument matches an existing Student object in the Course's ArrayList and the existing Student object was replaced by the argument in the ArrayList in the Course instance. The method will return false if the argument is null or the Student object does not exist in the Course's ArrayList and the ArrayList will not be updated in the Course instance. Complete the method public boolean update Student(Student stu) to complete this task. See the method comments for more detail. Task 4: The user will be able to ask for the average of all the Student objects in the Course instance. The method will ask each Student object for its' average of Scores and use that to compute the average of the course which will return the average as a double. Complete the method public double compute Course Average() to complete this task. See the method comments for more detail. • Task 5: Complete the get and set methods public ArrayList<Student getAllStudents(), public void setAllStudents (ArrayList<Student allStudents) to complete this task. See the method comments for more detail.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply