├── .gitignore ├── README.md ├── pom.xml └── src └── main └── java └── my └── zhamri ├── hello └── HelloWorld.java ├── if_else └── ContohIfElse.java ├── method ├── MethodWithParameter.java ├── SimpleMethod1.java └── SimpleMethod2.java ├── printf └── Example_printf.java ├── switchcase └── ContohSwitch.java ├── userInput └── MyUserInput.java └── variable ├── Example_Increment.java ├── StaticVariable1.java └── StaticVariable2.java /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea/ 3 | *.iml 4 | *.ipr 5 | *.iws 6 | .classpath 7 | .project 8 | .settings/ 9 | .DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # STIA1113-Programming 1 2 | 3 | ## Syllabus 4 | 5 | |No.| Topic | 6 | |---|----------| 7 | |1. | Introduction to Computer and Programming Language | 8 | |2. | Problem Solving Concepts | 9 | |3. | Numerical Computation & Expression | 10 | |4. | Selection Control Structures | 11 | |5. | Looping Control Structures | 12 | |6. | Modularity using Methods | 13 | |7. | Arrays | 14 | 15 | ## Assessment Methods 16 | 17 | |Methods | Percentage | 18 | |---------------------- |-----------:| 19 | |Quiz 1 | 5% | 20 | |Quiz 2 (lab test) | 5% | 21 | |Midterm Test | 15% | 22 | |Assignment 1 | 7% | 23 | |Assignment 2 | 8% | 24 | |Project (Development) | 12% | 25 | |Project (Presentation) | 5% | 26 | |Project (Report) | 3% | 27 | |Total | 60% | 28 | |Final Examination | 40% | 29 | 30 | ## Assessment Methods A201 (100% Coursework) 31 | 32 | |Methods | Percentage | 33 | |---------------------- |-----------:| 34 | |Quiz 1 | 5% | 35 | |Quiz 2 | 5% | 36 | |Quiz 3 | 5% | 37 | |Lab Test 1 | 5% | 38 | |Lab Test 2 | 5% | 39 | |Assignment 1 | 15% | 40 | |Assignment 2 | 15% | 41 | |Assignment 3 | 15% | 42 | |Project (Development) | 20% | 43 | |Project (Presentation) | 6% | 44 | |Project (Report) | 4% | 45 | |Total | 100% | 46 | 47 | ## GitHub Classroom 48 | https://classroom.github.com/classrooms 49 | 50 | ## Main Issues 51 | https://github.com/STIA1113-A201/Main-Issues/issues 52 | 53 | ## List of related videos 54 | https://github.com/zhamri/STIA1113-Programming1/wiki/MyNotes 55 | 56 | ## YouTube Channel 57 | [MyNotes](https://bit.ly/JNotes) 58 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | my.zhamri 8 | stia1113 9 | 1.0-SNAPSHOT 10 | 11 | stia1113 12 | 13 | http://www.example.com 14 | 15 | 16 | UTF-8 17 | 1.7 18 | 1.7 19 | 20 | 21 | 22 | 23 | junit 24 | junit 25 | [4.13.1,) 26 | test 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | maven-clean-plugin 36 | 3.1.0 37 | 38 | 39 | 40 | maven-resources-plugin 41 | 3.0.2 42 | 43 | 44 | maven-compiler-plugin 45 | 3.8.0 46 | 47 | 48 | maven-surefire-plugin 49 | 2.22.1 50 | 51 | 52 | maven-jar-plugin 53 | 3.0.2 54 | 55 | 56 | maven-install-plugin 57 | 2.5.2 58 | 59 | 60 | maven-deploy-plugin 61 | 2.8.2 62 | 63 | 64 | 65 | maven-site-plugin 66 | 3.7.1 67 | 68 | 69 | maven-project-info-reports-plugin 70 | 3.0.0 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /src/main/java/my/zhamri/hello/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package my.zhamri.hello; 2 | 3 | /** 4 | * Hello world! 5 | */ 6 | public class HelloWorld { 7 | public static void main(String[] args) { 8 | System.out.println("Hello World"); 9 | } 10 | } -------------------------------------------------------------------------------- /src/main/java/my/zhamri/if_else/ContohIfElse.java: -------------------------------------------------------------------------------- 1 | package my.zhamri.if_else; 2 | 3 | public class ContohIfElse { 4 | 5 | public static void main(String[] args) { 6 | 7 | int x = 20; 8 | if (x == 1) { 9 | System.out.println("x adalah 1"); 10 | } else if (x == 3) { 11 | System.out.println("x adalah 3"); 12 | } else if (x == 5) { 13 | System.out.println("x adalah 5"); 14 | } else { 15 | System.out.println("x bukan no. ganjil dari 1 hingga 5"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/my/zhamri/method/MethodWithParameter.java: -------------------------------------------------------------------------------- 1 | package my.zhamri.method; 2 | 3 | public class MethodWithParameter { 4 | 5 | public static void main(String[] args) { 6 | String myName = "zhamri"; 7 | int myAge = 25; 8 | sayHello(myName); 9 | 10 | displayInfo(myName, myAge); 11 | 12 | String name1 = "Cristiano"; 13 | String name2 = "Ronaldo"; 14 | displayFullName(name1, name2); 15 | } 16 | 17 | public static void sayHello(String name) { 18 | System.out.println("Hello " + name); 19 | } 20 | 21 | public static void displayFullName(String firstName, String lastName) { 22 | System.out.println(firstName + " " + lastName); 23 | } 24 | 25 | public static void displayInfo(String name, int age) { 26 | System.out.println("Name: " + name); 27 | System.out.println("Age: " + age); 28 | } 29 | } -------------------------------------------------------------------------------- /src/main/java/my/zhamri/method/SimpleMethod1.java: -------------------------------------------------------------------------------- 1 | package my.zhamri.method; 2 | 3 | public class SimpleMethod1 { 4 | 5 | public static void main(String[] args) { 6 | 7 | System.out.println("one"); 8 | method_A(); 9 | System.out.println("three"); 10 | System.out.println("four"); 11 | System.out.println("five"); 12 | method_B(); 13 | System.out.println("seven"); 14 | } 15 | 16 | public static void method_A(){ 17 | System.out.println("two"); 18 | } 19 | 20 | public static void method_B(){ 21 | System.out.println("six"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/my/zhamri/method/SimpleMethod2.java: -------------------------------------------------------------------------------- 1 | package my.zhamri.method; 2 | 3 | public class SimpleMethod2 { 4 | 5 | public static void main(String[] args) { 6 | method_A(); 7 | method_A(); 8 | method_A(); 9 | } 10 | 11 | public static void method_A(){ 12 | System.out.println("one"); 13 | System.out.println("two"); 14 | System.out.println("three"); 15 | sayHello(); 16 | } 17 | 18 | public static void sayHello(){ 19 | System.out.println("Hello World"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/my/zhamri/printf/Example_printf.java: -------------------------------------------------------------------------------- 1 | package my.zhamri.printf; 2 | 3 | public class Example_printf { 4 | 5 | public static void main(String[] args) { 6 | 7 | System.out.println("abcdefghijklmnopqrstuvwxyz"); 8 | 9 | String myFormat = "%-7s%-13s%6.2f\n"; 10 | 11 | String x1 = "Item1", x2 = "Item2", x3 = "Item3"; 12 | String desc1 = "Milo", desc2 = "Kopi 3 in 1", desc3 = "Teh"; 13 | double price1 = 30.99, price2 = 50.75, price3 = 112.20; 14 | 15 | System.out.printf(myFormat, x1, desc1, price1); 16 | System.out.printf(myFormat, x2, desc2, price2); 17 | System.out.printf(myFormat, x3, desc3, price3); 18 | } 19 | } 20 | 21 | //Contoh output: 22 | // 23 | //abcdefghijklmnopqrstuvwxyz 24 | //Item1 Milo 30.99 25 | //Item2 Kopi 3 in 1 50.75 26 | //Item3 Teh 112.20 -------------------------------------------------------------------------------- /src/main/java/my/zhamri/switchcase/ContohSwitch.java: -------------------------------------------------------------------------------- 1 | package my.zhamri.switchcase; 2 | 3 | public class ContohSwitch { 4 | 5 | public static void main(String[] args) { 6 | 7 | int x = 3; 8 | switch (x) { 9 | case 1: 10 | System.out.println("x adalah 1"); 11 | break; 12 | 13 | case 3: 14 | System.out.println("x adalah 3"); 15 | break; 16 | 17 | case 5: 18 | System.out.println("x adalah 5"); 19 | break; 20 | 21 | default: 22 | System.out.println("x bukan no. ganjil dari 1 hingga 5"); 23 | 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/my/zhamri/userInput/MyUserInput.java: -------------------------------------------------------------------------------- 1 | package my.zhamri.userInput; 2 | 3 | import java.util.Scanner; 4 | 5 | /* 6 | This example shows how to input a string and numbers from the keyboard. 7 | */ 8 | public class MyUserInput { 9 | 10 | public static void main(String[] args) { 11 | 12 | // Create a scanner object 13 | Scanner input = new Scanner(System.in); 14 | 15 | // Input a string. For example your name. 16 | System.out.print("Please input your name: "); 17 | String name = input.nextLine(); 18 | 19 | // Input a number. For example your age. 20 | System.out.print("Please input your age: "); 21 | int age = input.nextInt(); 22 | 23 | // Input a decimal number. For example your salary. 24 | System.out.print("Please input your salary: "); 25 | double salary = input.nextDouble(); 26 | 27 | // Display all your inputs. 28 | System.out.println("Name: " + name); 29 | System.out.println("Age : " + age); 30 | System.out.println("Salary : " + salary); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/my/zhamri/variable/Example_Increment.java: -------------------------------------------------------------------------------- 1 | package my.zhamri.variable; 2 | 3 | public class Example_Increment { 4 | 5 | public static void main(String[] args) { 6 | 7 | int x = 10; 8 | int i = 2; 9 | 10 | x = i++; 11 | 12 | System.out.println("x = " + x); 13 | System.out.println("i = " + i); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/my/zhamri/variable/StaticVariable1.java: -------------------------------------------------------------------------------- 1 | package my.zhamri.variable; 2 | 3 | public class StaticVariable1 { 4 | 5 | static int a = 10; 6 | static int x = 15; 7 | 8 | public static void main(String[] args) { 9 | method_A(); 10 | method_X(); 11 | } 12 | 13 | public static void method_A(){ 14 | System.out.println("a = " + a); 15 | int b = a + x; 16 | System.out.println("b = " + b); 17 | } 18 | 19 | public static void method_X(){ 20 | System.out.println("x = " + x); 21 | int y = x + a; 22 | System.out.println("y = " + y); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/my/zhamri/variable/StaticVariable2.java: -------------------------------------------------------------------------------- 1 | package my.zhamri.variable; 2 | 3 | public class StaticVariable2 { 4 | 5 | static int a = 15; 6 | static int x = 100; 7 | 8 | public static void main(String[] args) { 9 | method_X(); 10 | method_X(); 11 | method_X(); 12 | method_X(); 13 | System.out.println("x = " + x); 14 | } 15 | 16 | public static void method_X(){ 17 | x = x + a; 18 | } 19 | } 20 | --------------------------------------------------------------------------------