In Lab Exercise - 01
In Lab Exercise - 01
Implement a Java-main-method that prints out the multiplication table for all numbers from 1 to 10. Use the tabulator
character '\t' to align the values. The output of your method should be as follows:
Exercise-2 (4-point)
A class called Author (as shown in the class diagram) is designed to model a book's author. It contains:
Three private instance variables: name (String), email (String), and gender (char of either 'm' or 'f');
One constructor to initialize the name, email and gender with the given values;
(There is no default constructor for Author, as there are no defaults for name, email and gender.)
public getters/setters: getName(), getEmail(), setEmail(),and getGender();
(There are no setters for name and gender, as these attributes cannot be changed.)
A toString() method that returns "Author[name=?,email=?,gender=?]", e.g., "Author[name=Tan Ah
Teck,[email protected],gender=m]".
Exercise-3 (2-point)