Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a CS102 class that stores student information and marks, and calculates a

ID: 3668164 • Letter: W

Question

Write a CS102 class that stores student information and marks, and calculates a student's final mark. Your class must implement the attached Student interface. interface Student { public void setName ( String name ); public String getName (); public void setMark ( String category, int mark ); public float getFinal (); } The 4 methods in Student are as follows: setName() sets the name of the student. getName() returns the name of the student. setMark() sets one of 4 marks, depending on the category parameter, which is one of {"pracs", "practests", "tests", "exam"}. getFinal() returns the final mark using the formula from the notes to students. All calculations are done with floats. There is no test program. Instead a technique called unit testing will be used. Unit testing is an automatic testing technique for individual modules of a large software system. Tests are defined and executed automatically to rapidly test and re-test a class during development without user intervention. This helps to scale up testing when a program gets very large. It also ensures the correctness of each individual class within the system. JUnit is one of the most popular unit testing frameworks for Java. The advantage of a framework (rather than writing small programs to test each class) is that there is a standard API, common understanding of the testing approach among Java programmers and integrated support in many IDEs. Write JUnit tests for your CS102 class in a class called CS102Test, stored in the file CS102Test.java. These 4 tests must be included. 1. A test that getName() returns the value set using setName(). 2. A test that, if all marks are 0, the final mark is 0. 3. A test that, if all marks are 100, the final mark is 100. 4. A test that the final mark is correctly calculated for all marks being between 0 and 100.

Explanation / Answer

#include #include #include float total_marks(float []); main() { clrscr(); float marks[10][4]={0}; cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote