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
222 changes: 84 additions & 138 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,138 +1,84 @@
# Creative-Cli-Project
## The Mission

You and your partner are going to **build a Java command-line application** based on a real-world system.

There is **no step-by-step instruction manual**.

Instead, you will take everything you’ve learned so far and **design your own solution**.

Think of this as your opportunity to prove:

* You can design software
* You can structure Java programs
* You can collaborate with a partner
* You can explain your technical decisions

Your goal is to build something that **works, is organized, and shows your understanding of Java.**

---

# Theme: EveryDay Appliication

Your project must represent a **system people use in real life**

You are encouraged to **get creative and build something interesting.**

---

# Team Structure

You will work **in pairs**.

Because everyone recently earned their **Certified Scrum Master certification**, you will organize your work into **three sprint phases**.

Your README must document what happened in each sprint.

---

# Sprint Documentation

Your README must include these three sections.

---

## Sprint 1 — The Plan

Before writing code, explain:

* What problem your program solves
* What features you want to build
* What classes you expect to create
* How you divided the work between partners

Think of this as your **project blueprint**.

---

## Sprint 2 — The Build

Explain:

* What you actually implemented
* What changed from your original plan
* Challenges you encountered
* How you solved them

Real software projects **never go exactly as planned** — document your journey.

---

## Sprint 3 — The Reflection

Explain:

* What works well in your program
* What you would improve with more time
* What Java concepts you used the most
* What you learned from the experience

---

# Code Explanation Requirement

Your code must contain **comments explaining your technical decisions**.

The goal is to show **why you used certain Java concepts**, not just that the code runs.

Explain things like:

* Why you created certain classes
* Why you used specific collections
* Why you used loops or conditionals
* Why methods are structured a certain way

Example:

```java
// Using ArrayList because the number of tasks can grow dynamically
ArrayList<String> tasks = new ArrayList<>();

// Loop used to display all tasks stored in the system
for (String task : tasks) {
System.out.println(task);
}
```

Your comments should help someone understand **how your program works and why it was designed that way**.

---

# Technical Expectations

Your project should demonstrate the core Java skills we have practiced:

* Classes and Objects
* Constructors
* Methods
* Encapsulation (getters/setters)
* Loops
* Conditional statements
* Collections (`ArrayList`, `HashMap`, etc.)
* User input using `Scanner`
* Clean program organization

Your application must run **in the command line**.

---

# Final Goal

This project is about demonstrating that you can:

* Design software without step-by-step instructions
* Apply Java concepts to a real problem
* Work effectively with a partner
* Explain your code and decisions

Build something that helps reinfornce knowledge for the final java exa!
# Employee Management System

A Java console application for basic employee tracking. The program allows users to log in by ID, review employee hours, update hours, add new hires, and view all employee summaries.

## Sprint 1 - The Plan

### Problem the Program Solves
Small teams often need a simple way to track employee records and work hours without a full database or web app. This project solves that by providing a lightweight command-line system for employee management tasks.

### Planned Features
- ID-based login flow
- Menu-driven actions for managers/employees
- View an employee's current hours
- Update employee hours
- Add a new employee with a random 3-digit ID
- Print a list of all employees

### Planned Classes
- `Person` (abstract base class for shared identity/contact fields)
- `Employee` (extends `Person`, stores hours worked)
- `siteManager` (extends `Person`, tracks employees on site)
- `SiteSystem` (main workflow/menu logic)
- `Main` (application entry point)

### Work Division Between Partners
- Partner A: Domain model and inheritance structure (`Person`, `Employee`, `siteManager`)
- Partner B: Console flow and feature implementation (`SiteSystem`, menu options, input handling)
- Shared: Testing flows, bug fixes, and output formatting

## Sprint 2 - The Build

### What Was Implemented
- Created an OOP structure with inheritance (`Person` -> `Employee` / `siteManager`)
- Built a menu-based system in `SiteSystem`
- Implemented:
- Option 2: lookup employee and display hours
- Option 3: add hours to existing employee total
- Option 4: add new hire and generate random ID (`100-999`)
- Option 5: display all employee summaries
- Added validation messaging such as "Employee ID not found"

### What Changed from the Original Plan
- Employee lists needed synchronization between manager tracking and the main `people` list
- Print logic was adjusted to use summaries instead of object references
- Input handling was refined to avoid scanner newline issues

### Challenges Encountered
- New hires were not appearing in all views because they were added to only one list
- Scanner input sequencing (`nextInt()` and `nextLine()`) caused skipped fields
- Incorrect method usage when updating hours (getter vs setter)

### How Challenges Were Solved
- Added new hires to both relevant collections where needed
- Used proper newline consumption before string input
- Switched to `setHoursWorked(getHoursworked() + hourAdd)` pattern
- Added clearer loop logic and not-found messages

## Sprint 3 - The Reflection

### What Works Well
- Clear class separation and inheritance-based design
- Menu options cover core employee management tasks
- Hours update and employee lookup workflows function as expected
- Program compiles and runs as a clean console app

### What to Improve with More Time
- Replace in-memory lists with persistent storage (file or database)
- Add stronger input validation and exception handling
- Implement role-based permissions (manager vs employee actions)
- Refactor naming/style (`siteManager` -> `SiteManager`) and add unit tests

### Java Concepts Used Most
- Classes and objects
- Inheritance and abstract classes
- Method overriding
- ArrayLists and loops
- Type checking/casting (`instanceof`)
- User input with `Scanner`

### What Was Learned
- Planning helps, but implementation details always evolve
- Data consistency between collections matters in real features
- Input handling in console apps requires careful sequencing
- OOP design makes code easier to extend as requirements grow
31 changes: 31 additions & 0 deletions src/main/java/org/codedifferently/Employee.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.codedifferently;

// Concrete Person type used for employees whose work hours are tracked.
public class Employee extends Person {
// Running total of employee hours.
private double hoursworked;

// Builds an employee with profile data plus starting hour balance.
public Employee(int id, String firstname, String lastname, String email, double hoursworked){
super(id, firstname, lastname, email);
this.hoursworked=hoursworked;
}

@Override
// Returns a formatted, multi-line summary used by the menu print options.
public String getSummary(){
return "[Employee]" + " " + getFirstname() + " " + getLastname() + "\n"
+ "ID: " + getId() + "\n" + "Hours Worked" + " " + hoursworked;
}

// Replaces the current hour total with a new total.
public void setHoursWorked(double hoursworked) {
this.hoursworked = hoursworked;
}

// Returns the current hour total.
public double getHoursworked() {
return hoursworked;
}
}

10 changes: 1 addition & 9 deletions src/main/java/org/codedifferently/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
public static void main(String[] args) {
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
// to see how IntelliJ IDEA suggests fixing it.
System.out.printf("Hello and welcome!");

for (int i = 1; i <= 5; i++) {
//TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint
// for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>.
System.out.println("i = " + i);
SiteSystem siteSystem = new SiteSystem();
}
}
}
56 changes: 56 additions & 0 deletions src/main/java/org/codedifferently/Person.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package org.codedifferently;

// Base abstraction for every person record in the system.
// Shared identity/contact fields live here, while child classes define custom summaries.
public abstract class Person {
// Unique identifier used for login/lookup.
private int id;
// Basic profile values shared by all roles.
private String firstname;
private String lastname;
private String email;

// Constructor initializes all shared Person data at object creation time.
public Person(int id, String firstname, String lastname, String email){
this.id=id;
this.firstname=firstname;
this.lastname=lastname;
this.email=email;

}
// Setters allow future updates to profile data.
public void setLastname(String lastname) {
this.lastname = lastname;
}

public void setId(int id) {
this.id = id;
}

public void setFirstname(String firstname) {
this.firstname = firstname;
}

public void setEmail(String email) {
this.email = email;
}
// Getters expose read-only access to stored profile values.
public String getLastname() {
return lastname;
}

public String getFirstname() {
return firstname;
}

public int getId() {
return id;
}

public String getEmail() {
return email;
}

// Each subclass provides its own summary.
public abstract String getSummary();
}
Loading