this is the homework I have to do
This homework is due in week 3.
You must work on the program outside the formal laboratory sessions. The program must be ready to be executed at the start of the scheduled laboratory session. Remember you may be asked to explain your program!Write a class called Module to represent a University’s teaching module. The attributes of each module are:
Module name : a string, e.g. Programming 2
Module ID : a string, e.g. CG0048
Lecture Room : a string, e.g. Pandon S1
Module Tutor : a string, e.g. Alan MaughuanThe class should include:
Constructors:
Module() : sets all values to empty strings
Module(String inName, String inModuleID)
Module(String inName, String inModuleID, String inRoom, String inModuleTutor)Methods:
String getModuleName()
String getModuleID()
String getRoom()
void setRoom(String inRoom)
String getModuleTutor()
void setModuleTutor(String inModuleTutor)
String toString()You should also write a separate class with a main method to test the Module class. This driver must execute all the constructors and methods defined above.
MarkingMark Criteria
5 0.5 For each correct constructor or method as specified above
5 For a driver that clearly demonstrates the correct operation of Module
This is the code I have for it at the moment. I keep getting return type required errors. can you help?
class Homeworkone
{
private String moduleName = "Programming 2";
private String moduleId = ". CG0048";
private String lectureRoom = "Pandon S1";
private String moduleTutor = "Alan Maughuan";
// constructors
Module()
{
moduleName="";
moduleId="";
lectureRoom="";
muduleTutor="";
}
Module (String inName,String inModuleId )
{
moduleName=inName;
moduleId= inModuleId;
}
Module (String inName, String inModuleId, String inRoom, String inModuleTutor)
{
moduleName=inName;
moduleID= inModuleId;
lectureRoom=inRoom;
moduleTutor=inModuleTutor;
}
// mutator methods
void setRoom(String inRoom)
{
inName = inRoom; // sets value of name
}
void setModuleTutor(String inModuleTutor)
{
moduleTutor = inModuleTutor; // sets value of hwkMark
}
String getInName()
{
return inName;
}
String getModuleTutor()
{
return moduleTutor;
}
int getRoom()
{
return lectureRoom;
}
}
// other methods
public String toString()
{
return inName +" " + inRoom +" " +lectureroom+ " " + moduleTutor;
}
}