Question
Question 1
Write a program called StudentMarks that inputs names into an array called "students" and to input 10 marks into an array called "marks". Next, output the name of the students with the corresponding mark alongside it. For example, if the first name in the array students is "Alfred", and the first mark is "95", then your program should output the following:
Alfred 95.

Question 2
2.1 Create a class called Person that has encapsulated variables: id, firstname, surname, cellphone, email. Create appropriate getter and setter methods for the variables. (10 marks)
2.2 Create a subclass of Person called Student that has 2 variables of its own: studentNumber and yearOfStudy. These variables should be declared private with the appropriate getter and setter methods to access them.
2.3 Create a subclass of Person called Lecturer that has 2 variables of its own: employeeNumber and salary. As in the above scenario, these variables should be declared private with the appropriate getter and setter methods to access them.
Solution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references.
Students may use these solutions for personal skill-building and practice.
Unethical use is strictly forbidden.

*
* Person class
*/
public class Person {
   
    // Instance variables
    private int id;
    private String firstname;
    private String surname;
    private String cellphone;
    private String email;
   
    // Constructor
    public Person(int id, String firstname, String surname, String cellphone, String email) {
       setId(id);
       setFirstname(firstname);
       setSurname(surname);
       setCellphone(cellphone);
       setEmail(email);
    }
   
    // Method to set id
    public void setId(int id) {
       this.id = id;
    }
   
    // Method to get id
    public int getId() {
       return this.id;
    }
   
    // Method to set firstname
    public void setFirstname(String firstname) {
       this.firstname = firstname;
    }
   
    // Method to get firstname
    public String getFirstname() {
       return this
This is only a preview of the solution.
Please use the purchase button to see the entire solution.
By purchasing this solution you'll be able to access the following files:
Solution.zip
Purchase Solution
$30.00
Google Pay
Amazon
Paypal
Mastercard
Visacard
Discover
Amex
View Available Computer Science Tutors 641 tutors matched
Ionut
(ionut)
Master of Computer Science
Hi! MSc Applied Informatics & Computer Science Engineer. Practical experience in many CS & IT branches.Research work & homework
5/5 (6,803+ sessions)
1 hour avg response
$15-$50 hourly rate
Pranay
(math1983)
Doctor of Philosophy (PhD)
Ph.D. in mathematics and working as an Assistant Professor in University. I can provide help in mathematics, statistics and allied areas.
4.6/5 (6,660+ sessions)
1 hour avg response
$40-$50 hourly rate
Leo
(Leo)
Doctor of Philosophy (PhD)
Hi! I have been a professor in New York and taught in a math department and in an applied math department.
4.9/5 (6,421+ sessions)
2 hours avg response

Similar Homework Solutions