Public Class Book (Int Price, Pages Public Book (
Public Class Book (Int Price, Pages Public Book (
NPM : 14402426
Kelas : MIF K-42/14
1. Class Diagram
softwarebook.java
public class softwarebook extends book{
String softwareName, softwareVersion;
public softwarebook (){
super();
this.softwareName = "Software Has Not been set";
this.softwareVersion = "Software Version Has Not been set";
}
public softwarebook(String softwareName, String softwareVersion, int
price, int pages){
super(price, pages);
this.softwareName = softwareName;
this.softwareVersion = softwareVersion;
}
CPlus.java
public class CPlus extends softwarebook{
String author, title;
public CPlus (){
super();
this.softwareName = "Author Has Not been set";
this.softwareVersion = "Title Has Not been set";
}
public CPlus(String author, String title, String softwareName, String
softwareVersion, int price, int pages){
super(softwareName, softwareVersion, price, pages);
this.author = author;
this.title = title;
}
BookApp. .java
public class BookApp{
public static void main(String args[]){
CPlus c1 = new CPlus();
CPlus c2 = new CPlus("Juliansyah","OOP BOOK", "ZRZ Application", "V-
01", 150000, 150);
c2.showData();
c1.setAuthor("Darmawan");
c1.setTitle("Easy way to learn java");
c1.setSoftwareName("ZRZ Software Book");
c1.setSoftwareVersion("V-02");
c1.setPrice(200000);
c1.setPages(50);
c1.showData();
}
}