/** * Write a description of class Student here. * * @author (Landon L.) * @version (a version number or a date) */ public class Student { // instance variables - replace the example below with your own private String name; private int qz1; private int qz2; private int qz3; private int qz4; private int qz5; private int qzn; /** * Constructor for objects of class Student */ public Student(String name, int q1, int q2, int q3, int q4, int q5) { // initialise instance variables name = name; qz1 = q1; qz2 = q2; qz3 = q3; qz4 = q4; qz5 = q5; } //Given these rules, how would I be able to create these methods(below)??? I mean you cant use an array and only certain instance variables //are allowed. // Student will need instance variables name , qz1, qz2, qz3, qz4, and //qz5 (of types String and int, respectively). // Student will need appropriate methods and constructors. To make things //interesting, create a getQuiz() method that takes in a quiz number as input and //then returns the appropriate quiz value. Likewise, setQuiz() will take as input //a quiz number and quiz score, and then put the value into the right variable. Make //sure to have a toString() method that prints the name of the student along //with the quiz scores. public int getQuiz() { //? } public void setQuiz(int num, int grade ) { //? } public void setName(String s) { name = s; } public String getName() { return name; } public String toString() { return name + " " + qz1 + " " + qz2 + " " + qz3 + " " + qz4 + " " + qz5; } }
--- Update ---
anyone