Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions nbproject/build-impl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ is divided into following sections:
<property file="${user.properties.file}"/>
<!-- The two properties below are usually overridden -->
<!-- by the active platform. Just a fallback. -->
<property name="default.javac.source" value="1.4"/>
<property name="default.javac.target" value="1.4"/>
<property name="default.javac.source" value="1.6"/>
<property name="default.javac.target" value="1.6"/>
</target>
<target depends="-pre-init,-init-private,-init-user" name="-init-project">
<property file="nbproject/configs/${config}.properties"/>
Expand Down Expand Up @@ -76,7 +76,7 @@ is divided into following sections:
<and>
<isset property="javac.profile"/>
<length length="0" string="${javac.profile}" when="greater"/>
<matches pattern="1\.[89](\..*)?" string="${javac.source}"/>
<matches pattern="((1\.[89])|9)(\..*)?" string="${javac.source}"/>
</and>
</condition>
<condition property="do.archive">
Expand Down Expand Up @@ -156,6 +156,7 @@ is divided into following sections:
<property name="application.args" value=""/>
<property name="source.encoding" value="${file.encoding}"/>
<property name="runtime.encoding" value="${source.encoding}"/>
<property name="manifest.encoding" value="${source.encoding}"/>
<condition property="javadoc.encoding.used" value="${javadoc.encoding}">
<and>
<isset property="javadoc.encoding"/>
Expand Down Expand Up @@ -840,7 +841,7 @@ is divided into following sections:
</chainedmapper>
</pathconvert>
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
<copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
<copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" manifestencoding="UTF-8" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
<fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
<manifest>
<attribute name="Class-Path" value="${jar.classpath}"/>
Expand All @@ -852,7 +853,7 @@ is divided into following sections:
</target>
<target name="-init-presetdef-jar">
<presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
<jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
<jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifestencoding="UTF-8">
<j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
</jar>
</presetdef>
Expand Down Expand Up @@ -975,23 +976,23 @@ is divided into following sections:
</target>
<target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
<tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
<copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
<copy encoding="${manifest.encoding}" file="${manifest.file}" outputencoding="UTF-8" tofile="${tmp.manifest.file}"/>
</target>
<target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
<manifest file="${tmp.manifest.file}" mode="update">
<manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</target>
<target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
<manifest file="${tmp.manifest.file}" mode="update">
<manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
<attribute name="Profile" value="${javac.profile}"/>
</manifest>
</target>
<target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
<basename file="${application.splash}" property="splashscreen.basename"/>
<mkdir dir="${build.classes.dir}/META-INF"/>
<copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
<manifest file="${tmp.manifest.file}" mode="update">
<manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
<attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
</manifest>
</target>
Expand Down Expand Up @@ -1186,7 +1187,7 @@ is divided into following sections:
<target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
<startprofiler/>
<antcal target="run-test-with-main"/>
<antcall target="run-test-with-main"/>
</target>
<target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
Expand Down
4 changes: 2 additions & 2 deletions nbproject/genfiles.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=8064a381@1.79.1.48
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=54a4877c
nbproject/build-impl.xml.script.CRC32=900c20ae
nbproject/build-impl.xml.stylesheet.CRC32=05530350@1.79.1.48
nbproject/build-impl.xml.script.CRC32=83312238
nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48
2 changes: 1 addition & 1 deletion nbproject/private/private.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
compile.on.save=true
user.properties.file=C:\\Users\\ANDITYAARIFIANTO\\AppData\\Roaming\\NetBeans\\8.1\\build.properties
user.properties.file=C:\\Users\\Guntur Fatmawan\\AppData\\Roaming\\NetBeans\\8.2\\build.properties
9 changes: 8 additions & 1 deletion nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group/>
<group>
<file>file:/D:/Telkom%20University/Semester%204/PBO/Task_3/src/task3exercise1/SmartPhone.java</file>
<file>file:/D:/Telkom%20University/Semester%204/PBO/Task_3/src/task3exercise2/Project.java</file>
<file>file:/D:/Telkom%20University/Semester%204/PBO/Task_3/src/task3exercise1/AppStore.java</file>
<file>file:/D:/Telkom%20University/Semester%204/PBO/Task_3/src/task3exercise1/Driver.java</file>
<file>file:/D:/Telkom%20University/Semester%204/PBO/Task_3/src/task3exercise1/Application.java</file>
<file>file:/D:/Telkom%20University/Semester%204/PBO/Task_3/src/task3exercise1/Appstore_1.java</file>
</group>
</open-files>
</project-private>
14 changes: 14 additions & 0 deletions src/task3exercise1/Appstore_1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package task3exercise1;

/**
*
* @author Guntur Fatmawan
*/
class Appstore {

}
77 changes: 52 additions & 25 deletions src/task3exercise1/SmartPhone.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,92 @@
public class SmartPhone{
//
// 1. Declare your private attributes here:
// NIM : ..........................,
// NAMA : .........................,
// NIM : 1301154343
// NAMA : Guntur Fatmawan Widodo
//
//------------------- your code here-----------------------

private Application[] appList = new Application [10];
private int totalApp, memory, n;
//---------------------------------------------------------


//
// 2. Declare your Setter and Getter method here:
// NIM : ..........................,
// NAMA : .........................,
// NIM : 1301154343
// NAMA : Guntur Fatmawan Widodo
//
//------------------- your code here-----------------------
public void setMemory(int memory) {
this.memory = memory;
}

public int getMemory() {
return memory;
}

public int getTotalApp() {
return totalApp;
}

public void setTotalApp(int totalApp) {
this.totalApp = totalApp;
}

public Application[] getAppList() {
return appList;
}

public void setAppList (Application[] AppList) {
this.appList = appList;
}
//---------------------------------------------------------


//
// 3. method addApplication( appStore , appId ) here:
// NIM : ..........................,
// NAMA : .........................,
// NIM : 1301154343
// NAMA : Guntur Fatmawan Widodo
//
// get an Application object from array appList of an appStore
// get an Application object from array appList of an appStore
// with array index = appId, an Application can be installed
// if Application size is less than remaining memory size
//
//------------------- your code here-----------------------

public void addApplication (Appstore appStore, int appId) {
if (n < 10) {
this.applist[n] = appStore.getApp(appId)
n++;
}
}
//---------------------------------------------------------


//
// 4. method method getRemainingSize() : integer here:
// NIM : ..........................,
// NAMA : .........................,
// NIM : 1301154343
// NAMA : Guntur Fatmawan Widodo
//
// returns the remaining memory size of the smart phone
//
//------------------- your code here-----------------------

//---------------------------------------------------------

public int getRemainingSize () {
return memory-appList.length;
}

//
// 5. Create method toString() : String here:
// NIM : ..........................,
// NAMA : .........................,
//
// returns String that contains the smart phone total memory size,
// number of application installed, and remaining memory size
//
// NIM : ..........................,
// NAMA : .........................,
//
// returns String that contains the smart phone total memory size,
// number of application installed, and remaining memory size
//
// example : "memory size 100MB, 5 application installed,
// remaining memory size: 60MB"
//
public String toString() {
//------------------- your code here-----------------------
return null;

//---------------------------------------------------------
//------------------- your code here-----------------------
return "Memory Size" +memory+ "," +getTotalApp() + "Application Installed, Remaining memory Size: " + getRemainingSize();
//---------------------------------------------------------
}
}
54 changes: 37 additions & 17 deletions src/task3exercise2/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,75 @@
public class Project {

// 1. Declare your private attributes here:
// NIM : ..........................,
// NAMA : .........................,
// NIM : 1301154343
// NAMA : Guntur Fatmawan Widodo
//
// Constructor initialize project name,
// instantiate array member with size of [5],
// and set release status = false
//
//------------------- your code here-----------------------
private String projectName;
private Member teamMember[];
private int nTeam = 0;
private boolean releaseStatus = false;

//---------------------------------------------------------

// 2. Declare your Constructor here:
// NIM : ..........................,
// NAMA : .........................,
// NIM : 1301154343
// NAMA : Guntur Fatmawan Widodo
//
//------------------- your code here-----------------------

public void project (String projectName) {
teamMember = new Member [5];
this.releaseStatus = false;
}
//---------------------------------------------------------


// 3. Declare your Setter and Getter method here:
// NIM : ..........................,
// NAMA : .........................,
// NIM : 1301154343
// NAMA : Guntur Fatmawan Widodo
//
//------------------- your code here-----------------------

public boolean isRelease() {
return releaseStatus;
}
//---------------------------------------------------------


// 4. Declare method addMember( m : Member ) here:
// NIM : ..........................,
// NAMA : .........................,
// NIM : 1301154343
// NAMA : Guntur Fatmawan Widodo
//
// add an object Member m into array team member, then
// increment integer nTeam+1
//
//------------------- your code here-----------------------

public void addMember (Member m) {
this.teamMember[nTeam] = m;
nTeam ++;
}
//---------------------------------------------------------


// 5. Declare method releaseApp() here:
// NIM : ..........................,
// NAMA : .........................,
// NIM : 1301154343
// NAMA : Guntur Fatmawan Widodo
//
// set release status = true
//
//------------------- your code here-----------------------

public void releaseApp() {
releaseStatus = true;
}
//---------------------------------------------------------


// 6. Create method toString() : String here:
// NIM : ..........................,
// NAMA : .........................,
// NIM : 1301154343
// NAMA : Guntur Fatmawan Widodo
//
// returns String that contains Project name, number of team member,
// and release status
Expand All @@ -67,7 +81,13 @@ public class Project {
//
public String toString() {
//------------------- your code here-----------------------
return null;
if(releaseStatus = true) {
System.out.println("Progress");
}
else
System.out.println ("Not Onn Progress");
String project = (projectName+ "Status is in"+ releaseStatus+" with team member of"+nTeam);
return project;

//---------------------------------------------------------
}
Expand Down