This application is a command-line application that will parse accounting information and output user-readable reports.
The goal of this Challenge is to reinforce your knowledge of Git, GitHub, and Java. Specifically, you will do the following:
-
Iterate through collections using fundamental Java concepts.
-
Convert raw data into Java classes.
-
Print specific data using control flow statements or streams.
-
Commit code to a Git repository.
-
Push your local repository to a remote repository.
In the starter code, you will find a partially completed application that contains a hardcoded List<String[]> of Customer information.
Requirements:
-
Update the
main()method in theMainclass. -
Iterate through a
List<String[]>that contains multiple records for eachCustomer, converting it intoList<Customer>where there is only one copy of each customer (Integer.parseInt()converts aStringto an integer). -
Update the
getBalance()method in theCustomerclass to sum all charges. -
Update the
toString()method in theCustomerclass to print the customer ID, customer name, and customer balance. -
Add JUnit test cases to test your newly added
getBalance()andtoString()functionality.
You must also complete the following user stories:
-
As a user, I would like to access a list of all accounts that are positive. (Use
System.out.println.) -
As a user, I would like to access a list of all accounts that are negative. (Use
System.out.println.)
The submission process might seem intimidating, but it will become second nature in no time. Follow these steps to submit your Challenge:
-
Create and clone a working Java repo: On the GitHub website, create a repository called
YourFirstName_YourLastName_Java. Clone the repository onto your machine. -
Copy your folder: When you have completed your Challenge assessment, copy your completed
M1-Challenge-Lastname-Firstnamefolder (located inside in your Working Folder Java) into your personal GitHub repository folder located on your desktop. -
Complete the commands: Once the
M1-Challenge-Lastname-Firstnamefolder has been copied into the GitHub repository folder, navigate into your GitHub repository in either your terminal (macOS) or Git Bash (Windows). Once you have navigated to the appropriate repository, complete the following commands (which should be familiar):-
git add -A -
git commit-m"< commit message >"(where< commit message >is your commit message for the commit) -
git push origin master
-
-
Navigate: Open your personal GitHub account. Navigate to the
YourFirstName_YourLastName_Javarepository. -
Confirm: Select the
M1-Challenge-Lastname-Firstnamefolder that you created and uploaded. Confirm that ALL of the expected projects have been included inside that folder. Again, the folder name should be related to the module associated with the Challenge.
Finally, make sure to double-check that you've completed your submission!
In this Challenge, your grade will consist of a combination of general setup and formatting requirements and your actual code. Refer to the following criteria for more detailed information.
-
Your solution must reside in an IntelliJ project called
M1-Challenge-Lastname-Firstname—5% -
Code is clean (follows general patterns as presented in class)—5%
- Find all of the unique customers
-
Add the charges to the balance for each customer—10%
-
Sum the charges to get the balance for a customer—10%
- Print customer information
- Find and display all accounts with a positive balance
- Find and display all accounts with a negative balance
-
Verification of
getBalance()functionality—5% -
Verification of
toString()functionality—5%
© 2023 2U. All Rights Reserved.