X Tutup
Skip to content

Commit 504a72c

Browse files
committed
checkpoint
1 parent fc14733 commit 504a72c

File tree

15 files changed

+68
-12
lines changed

15 files changed

+68
-12
lines changed

reader/ReadingJava/Programs/Bookstore.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Level 1
12

23
// Make Bookstore class a "collection" class. It should have an array of Books.
34
// Add a method to add a Book to the array.

reader/ReadingJava/Programs/Deal.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Level 1
2+
13
/******************************************************************************
24
* Compilation: javac Deal.java
35
* Execution: java Deal PLAYERS

reader/ReadingJava/Programs/Dungeon.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
// A Text based dungeon game.
3-
//
3+
// Level-3
4+
45
// it is all in one method, so it is not a good practice to write code like this.
56
// break up this code into smaller methods, and use objects to represent the game state.
67
// maybe even some smaller classes to encapsulate the different parts of the game.

reader/ReadingJava/Programs/EmployeeMgmt.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
/******************** Importing Essential Libraries ************************/
2-
3-
import java.util.*;
4-
import java.io.*;
5-
6-
7-
/*************************** MENU OF EMS ****************************/
1+
// Level-2
82

93
// What's the problem with this program?
104
// How should it be organized?
@@ -14,6 +8,14 @@
148

159
// reduce the number of printlns scattered thru the code, how could you
1610
// make more use of templates
11+
12+
/******************** Importing Essential Libraries ************************/
13+
14+
import java.util.*;
15+
import java.io.*;
16+
17+
18+
/*************************** MENU OF EMS ****************************/
1719
class MainMenu
1820
{
1921
public void menu()

reader/ReadingJava/Programs/Encryption.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import java.util.*;
1+
2+
// Level 1
23

34
/*
45
* This program is used to encrypt and decrypt data.
@@ -20,6 +21,9 @@
2021
*/
2122

2223

24+
import java.util.*;
25+
26+
2327
public class Encryption {
2428

2529
public static void main(String args[])

reader/ReadingJava/Programs/ExpenseTracker.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
// Level-1
2+
// make a Main class, and move the main method from this class to the Main class.
3+
// add some methods to ExpenseTracker class to make it more modular and reusable.
4+
// add a method to save the expenses to a file.
5+
// add a method to load the expenses from a file.
6+
// add a method to display the total expenses.
7+
// add a method to display the expenses.
8+
// add a method to add an expense.
9+
// add a method to display the menu.
10+
// add a method to exit the program.
11+
12+
113
import java.util.ArrayList;
214
import java.util.List;
315
import java.util.Scanner;

reader/ReadingJava/Programs/GenericStack.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// Level-1
2+
3+
// Use this class by testing all its methods in the main method of the Main class.
4+
// (as in move the main method from this class to the Main class)
5+
// yes, you need to make a Main class.
6+
17
/******************************************************************************
28
* Compilation: javac Stack.java
39
* Execution: java Stack < input.txt

reader/ReadingJava/Programs/IntegerToBinary.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// Level-2
2+
// Make this program into a much more useful class.
3+
// make main method into a method that takes a string array as an argument.
4+
5+
// but make the convert method into a static method that takes an int as an argument and returns a string.
6+
17
/******************************************************************************
28
* Compilation: javac IntegerToBinary.java
39
* Execution: java IntegerToBinary n

reader/ReadingJava/Programs/Knapsack.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Level-4
2+
// Research this problem and understand what the `knapsack` problem is.
3+
// Explain it to a 5th grader. :-)
4+
// build a test class that tests the `knapSack` method.
5+
16
import java.util.*;
27
public class Knapsack {
38

reader/ReadingJava/Programs/OnlineVotingSystem/src/main/java/vote/com/servlet/DBUtilR.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
import java.sql.SQLException;
66

77
public class DBUtilR {
8-
static Connection conn = null;
8+
static Connection conn = null;
9+
910
static
1011
{
1112
try {
@@ -24,7 +25,6 @@ public class DBUtilR {
2425
}
2526

2627
public static Connection getDBConnection() {
27-
// TODO Auto-generated method stub
2828
return conn;
2929
}
3030
}

0 commit comments

Comments
 (0)
X Tutup