PROGRAMMING CONCEPTS:
Week 12 Activity
Group Project Task List
Student Name Student Id Role
Israel E.A. Korwa 001202300225 Team Leader
Rayvangga chayen salindeho 00168394902 Member 1
Reza rahmat saputra 00168394989 Member 2
Karaka Clothing
Chapter 1: Introduction
The KarakaClothing program is designed to provide a simple and interactive shopping
experience for T-shirts. This Java-based application allows users to browse through a menu
of available T-shirts, make purchases, view payment history, and exit the program. The goal
is to create a user-friendly platform that facilitates the buying process while maintaining a
clear and organized structure.
Enable user to choose purchase actions
- Enable user to choose T-shirt
- Enable user to re-entry if wrong input is given - Enable to choose the exit option
- Enable to input name
Chapter 2. Flowchart
Chapter 3: The Program
Line Code
1 package CLOTHING;
2
3 import java.util.Scanner;
4 public class KarakaClothing {
5 public static void main(String[] args) {
6 Scanner scanner = new Scanner(System.in);
7 String[] menu = {"ERIGO", "ADIDAS", "New Balance",};
double[] prices = {100000, 160000, 155000, };
8
int[][]ClothDetails= {
9
{10,5},
10 {12,3},
11 {8,6},
12 };
13 boolean[] selectedTshirt = new boolean[menu.length];
14 StringBuilder paymentHistory = new StringBuilder();
15 System.out.println("Welcome to the KarakaClothing Shop!");
16 int option = 0;
17 while (option != 3) {
18 System.out.println("\nMenu:");
19 System.out.println("1. Buy Tshirt");
20 System.out.println("2. Payment History");
21 System.out.println("3. Exit");
System.out.print("Enter your choice: ");
22
while (!scanner.hasNextInt()) {
23
System.out.println("Invalid input. Please enter a number.");
24 System.out.print("Enter your choice: ");
25 scanner.next(); // consume the invalid input
26 }
27 option = scanner.nextInt();
28 switch (option) {
29 case 1:
30 char choice = 'y';
31 while (choice == 'y' || choice == 'Y') {
32 System.out.println("\nTshirt Menu:");
33 int i = 0;
34 while (i < menu.length) {
35 System.out.println((i + 1) + ". " + menu[i] +
36 " - Rp" + prices[i] + "(Available Cloth: " + ClothDetails[i][1] + ")");
37 i++;
38 }
System.out.print("Enter your name: ");
39
scanner.nextLine(); // consume the newline
40 character
41 String customerName = scanner.nextLine();
42 int tshirtNumber;
43 while (true) {
44 System.out.print("Enter the number of the
45 Tshirt you want to buy: ");
46 while (!scanner.hasNextInt()) {
47 System.out.println("Invalid input.
48 Please enter a valid Tshirt number.");
49 scanner.next(); // consume the
50 invalid input
51 }
52 tshirtNumber = scanner.nextInt();if
53 (tshirtNumber >= 1 && tshirtNumber <= menu.length) {
54 break;
} else {
55
System.out.println("Invalid input.
56
Please enter a valid Tshirt number.");
57 }
58 }
59 int quantity;
60 while (true) {
61 System.out.print("Enter the quantity you
62 want to buy: ");
63 while (!scanner.hasNextInt()) {
64 System.out.println("Invalid input.
65 Please enter a valid quantity.");
66 scanner.next(); // consume the
67 invalid input
68 }
69 quantity = scanner.nextInt();
70 if (quantity > 0) {
71 break;
72 } else {
System.out.println("Invalid input.
73
Please enter a valid quantity.");
74
}
75 }
76 selectedTshirt[tshirtNumber - 1] = true;
77 paymentHistory.append("Customer:
78 ").append(customerName).append("\n");
79 paymentHistory.append("Tshirt:
80 ").append(menu[tshirtNumber - 1]).append(" -Rp").append(prices[tshirtNumber -
81 1]).append("\n");
82 paymentHistory.append("Quantity:
83 ").append(quantity).append("\n");
84 double totalPrice = prices[tshirtNumber - 1] *
85 quantity;
86 paymentHistory.append("Total Price:
87 $").append(totalPrice).append("\n\n");
88 System.out.println(menu[tshirtNumber - 1] + "
89 (Quantity: " + quantity + ") added to your selection!");
System.out.print("Do you want to buy more Tshirt?
90
(y/n): ");
91 choice = scanner.next().charAt(0);
92 }
93 break;
94 case 2:
95 System.out.println("Payment History:\n" +
96 paymentHistory.toString());
97 break;
98 case 3:
99 System.out.println("\nThank you for Buy on
100 KarakaClothhig !");
101 break;
102 default:
103 System.out.println("Invalid choice. Please enter a valid
104 option.");
105 }
}
106
scanner.close();
107
}
108 }
Chapter 4: The Screenshot
Then, list potential features that you and your team can develop as a case study
- Enable user to select multiple T-shirt
- Enable user for a re-entry if wrong input is given
- Enable the user to receive the total amount to be paid
- Enable user to pay with 100.000 bills. 50.000 bills,
Chapter 5: Requirement checks
No Requirements Yes/No, Line No X - Y
1 Have at least one if / if-else and Yes, line number 30-39
one nested if-else
2 Have at least one while and one Yes, line number 33-35
nested while
3 Have at least one 1 Dimensional Yes, line number 7-8
Array
4 Have at least one mathematical Yes, line number 74
operator calculation
5 Have at least one Boolean Yes, line number 1-108
expression
Chapter 6: Log Hours
1. Israel ezra Augustine korwa:
- Research Concept: 2 hours
- Program Development: 6 hours
- Testing and Debugging: 3.5 hours
- Reporting: 1.5 hour
- Total: 13 hours
2. Rayvangga chayen salindeho:
- Research Concept: 3hours
- Program Development: 4 hours
- Testing and Debugging: 3 hours
- Reporting: 2 hour
- Total: 12 hours
3. Reza rahmat saputra:
- Research Concept: 4 hours
- Program Development: 3 hour
- Testing and Debugging: 2.5 hours
- Reporting: 3 hrs
- Total: 12.5 hours