IF YOU DO NOT HAVE THE UML and PSEUDO-CODE, YOU HAVE TO READ THEBELOW REQUIREMENT THEN CREATE UML OF DATA TYPE CLASS AND WRITE THEPSEUDO-CODE BEFORE WRITING THE CODE
You must use Object Oriented Programming toprovide this project.
The project has two classes:
DATA TYPE CLASS
Class SU2022_StudenttDoHomework_yourLastName
This class holds:
-data members as private: student ID(typeString), last name (type String), first name (type String), chararray answers size 20
-constructors as public: no-argumentconstructor and parameterized constructor to initialize values forstudent ID, last name, first name, and arrayanswers
-method to evaluate Homework accepts char array key size 20 andint array result size 20 as parameters
In the method evaluate Homework:
At each the same index of 3 arrays, array answers, array key andarray result, based on the result from comparing the value inelement of array answers to the value in element of array key; theelement of the array result will be 1 if these values are equal orwill be 0.
-method toString() to create the output stringas below and return the output string
File: SU2022_EvaluateHomework_White
STUDENT HOMEWORK RESULT - McKINLEY WHITE
-----------------------------------------------
Student's name: Mary Lane
Student ID: 1122334
Homework date: 05/30/2022
-----------------------------------------------
Homework: 20 questions - Max score = 10 points
-method printResutl() to print result acceptsarray key as a parameter
In the method print result:
*declare the int array named result size 20 and initialize eachelement to 0
*call the method evaluate the Homework to pass array key andarray result as parameter to update value of array result.
*Create the variable score (type float) - initialize to 0
*Create the variable to store the wrong questions (type String)– initialize to null
*based on the values stored in the array result, you will createthe string to store the list of wrong question and calculate thescore of the test where each correct answer gets 0.5 points and thestring of the wrong questions in the format, for example: if thelist of wrong questions is “3, 5, 8” means 3 wrong questions arequestion 3, question 5, question 8
*Combine with the output of method toString(), the method printresult will provide the final output:
File: SU2022_EvaluateHomework_White.java
STUDENT HOMEWORK RESULT - McKINLEY WHITE
Student's name: Mary Lane
Student ID: 1122334
Homework date: 05/30/2022
-----------------------------------------------
Homework: 20 questions - Max score = 10 points
Homework score: 8.5
Wrong questions: 2, 8, 20
DRIVER CLASS
Class SU2022_EvaluateHomework_yourLastName
The application read information of the student from thekeyboard for student ID(type String), last name (type String),first name (type String), and read 20 answers to store to arrayanswers size 20
Then, create the object of data type classSU2022_StudentDoHomework_yourLastName to pass all these informationto the object
Use the object to access the method of data type classSU2022_StudentDoHomework_yourLastName to print out the output asrequired.
IF YOU DO NOT HAVE THE UML and PSEUDO-CODE, YOU HAVE TO READ THE BELOW REQUIREMENT THEN CREATE UML OF DATA TYPE CLASS AN
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am