0% found this document useful (0 votes)
91 views

Upsisys

The document defines four Java classes - UPSISYSTEM, StudREG, LibREG, and Payment. The UPSISYSTEM class contains a main method that declares and initializes objects of the other three classes. It sets properties on the objects and outputs their values. The StudREG, LibREG, and Payment classes define data members and getter/setter methods to manage student registration, library registration, and payment information respectively.

Uploaded by

Chai Jin Ying
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views

Upsisys

The document defines four Java classes - UPSISYSTEM, StudREG, LibREG, and Payment. The UPSISYSTEM class contains a main method that declares and initializes objects of the other three classes. It sets properties on the objects and outputs their values. The StudREG, LibREG, and Payment classes define data members and getter/setter methods to manage student registration, library registration, and payment information respectively.

Uploaded by

Chai Jin Ying
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

package upsisystem;

/**
*
* @author Jin Ying
*/
public class UPSISYSTEM {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
//Delare + Create Object
StudREG reg = new StudREG();
LibREG lib = new LibREG ();
Payment p1 = new Payment ();
//Method - Input
reg.setName("Jane");
reg.setNoMatric("D20151067777");
reg.settel(5751338);
p1.setSem(3);
p1.setAmount(0.50);
lib.setBook("Java");
lib.setISSN("9-785063");
lib.setStudREG(reg);
p1.setStudREG(reg);
//Method - Output
System.out.println(" ");
System.out.println("Name
System.out.println("No. Matric

: " +lib.getStudREG().getName());
: " +lib.getStudREG().getNoMatric

());
System.out.println("No. Tel
: " +p1.getStudREG().gettel());
System.out.println("Semester
: " +p1.getSem());
System.out.println("Outstanding Amount : RM " +p1.getAmount());
System.out.println("Book
: " +lib.getBook());
System.out.println("ISSN
: " +lib.getISSN());
}
}

----------------------------------------------------------------------------------------------package upsisystem;
/**
*
* @author Jin Ying
*/
public class StudREG {

//Data Member
private String StdName;
private String NoMatric;
private long tel;
//Constructor
public void StudREG(){};
//Method - Input
public void setName(String s){
StdName = s;
}
public void setNoMatric(String z){
NoMatric = z;
}
public void settel(long y){
tel = y;
}
//Method - Output
public String getName(){
return StdName;
}
public String getNoMatric(){
return NoMatric;
}
public long gettel(){
return tel;
}
}
------------------------------------------------------------------------------------------package upsisystem;
/**
*
* @author Jin Ying
*/
public class LibREG {
//Data Member
private String Book;
private String ISSN;
private StudREG ss;
//Constructor
public void LibREG(){};
//Method - Input
public void setBook(String t){
Book = t;
}
public void setISSN(String h){
ISSN = h;
}
public void setStudREG(StudREG s1)

{
ss=s1;
}
//Method - Output
public String getBook(){
return Book;
}
public String getISSN (){
return ISSN;
}
public StudREG getStudREG()
{
return ss;
}
}
----------------------------------------------------------------------------------------package upsisystem;
/**
*
* @author Jin Ying
*/
public class Payment {
//Data Member
private int Sem;
private double Amount;
private StudREG ss;
//Constructor
public void Payment(){};
//Method - Input
public void setSem (int t){
Sem = t;
}
public void setAmount(double h){
Amount = h;
}
public void setStudREG(StudREG s1)
{
ss=s1;
}
//Method - Output
public int getSem(){
return Sem;
}
public double getAmount (){
return Amount;
}
public StudREG getStudREG()
{
return ss;
}

You might also like