update,
This commit is contained in:
47
_resources/it114105/itp4510/extra/SpecialLab/Main.java
Normal file
47
_resources/it114105/itp4510/extra/SpecialLab/Main.java
Normal file
@@ -0,0 +1,47 @@
|
||||
interface Payable {
|
||||
public double getPayAmt();
|
||||
}
|
||||
|
||||
class Invoice implements Payable{
|
||||
private String invid;
|
||||
public double getPayAmt(){
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
class Employee extends Person implements Payable {
|
||||
private String empid;
|
||||
public Employee(String empid){
|
||||
this.empid = empid;
|
||||
}
|
||||
public double getPayAmt(){
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
abstract class Person {
|
||||
private String name;
|
||||
public String getName(){
|
||||
return name;
|
||||
}
|
||||
public void setName(String name){
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
||||
class Customer extends Person {
|
||||
private String custid;
|
||||
public Address address;
|
||||
|
||||
public Customer(){
|
||||
this.address = new Address();
|
||||
}
|
||||
}
|
||||
|
||||
class Address {
|
||||
private String room;
|
||||
private String street;
|
||||
public String getAddress(){
|
||||
return "";
|
||||
}
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
# Special Lab
|
||||
Question: create java code (in one file) for the below class diagram
|
||||
|
||||
<img src="./class_diagram.png"/>
|
||||
* There are some mistake, you need to fix it.
|
BIN
_resources/it114105/itp4510/extra/SpecialLab/class_diagram.png
(Stored with Git LFS)
Normal file
BIN
_resources/it114105/itp4510/extra/SpecialLab/class_diagram.png
(Stored with Git LFS)
Normal file
Binary file not shown.
Reference in New Issue
Block a user