Your first project should demonstrate your knowledge of the following topics: Java SQL JDBC Basic Data Structures Basic File I/O You will be building a console application that persists data in a...

1 answer below »

Your first project should demonstrate your knowledge of the following topics:



  • Java

  • SQL

  • JDBC

  • Basic Data Structures

  • Basic File I/O


You will be building a console application that persists data in a database with at least 3 tables which adhere to 3rd normal form (3NF). The basic form of this project should be that of a console-based banking app. If you want to mix it up a bit and can come up with a project idea that meets all the same requirements, contact your trainer to discuss and develop user stories. If you decide to go with the bank app, it should implement all of the required user stories listed below.


You will be expected to complete the minimum viable product by the deadline and give a brief 5 minute presentation demonstrating your project and answering questions from the QC team.



Minimum Requirements



  1. Basic validation (no negative deposits/withdrawals, malformed emails, names with numbers, etc.)

  2. All exceptions are properly caught and handled

  3. Proper use of OOP principles

  4. Documentation (all classes and methods have basic inline documentation)

  5. Use of custom data structures (do not use java.util Collection types! Implement your own List)

  6. SQL Data Persistance (at least 3 tables; all 3NF (normal form))



Bonus Features



  1. Unit tests for service-layer classes

  2. Logging messages and exceptions to a file



Banking App User Stories


These are user stories to describe the banking app.



Minimum Viable Product



  • As a user, I can register for an account.

  • As a user, I can login to my account.

  • As a user, I can create one or more bank accounts.

  • As a user, I can deposit funds into my account(s).

  • As a user, I can withdraw funds from my account(s).

  • As a user, I can display all of my accounts in a list which includes current balance.

  • All monetary amounts should be displayed in a proper currency format ($1,234.56).



Tech Stack


You should be employing the following technologies in your project.



  • Java 8

  • Apache Maven

  • MariaDB deployed on AWS RDS

Answered 3 days AfterSep 29, 2021

Answer To: Your first project should demonstrate your knowledge of the following topics: Java SQL JDBC Basic...

Swapnil answered on Oct 03 2021
147 Votes
92370/Code/Code/main/com/bank/BankDriver.java
92370/Code/Code/main/com/bank/BankDriver.java
package com.revature.bank;
import java.io.IOException;
import java.util.Scanner;
import java.sql.Connection;
import java.sql.SQLException;
import com.revature.dao.*;
import com.revature.model.*;
import com.revature.util.ConnectionUtil;
import org.apache.log4j.Logger;
public class BankDriver 

    public static final String NOT_CUSTOMER = "You are not yet a customer with us.";
    public static final String NO_ACCOUNT = "Account not in our records.";
    private static Logger log = Logger.getRootLogger();
    public static void main(String[] args) 
    {
        Scanner sc = new Scanner(System.in);
        int numUsers = 10;
        boolean loggedIn = fals
e;
        boolean isCustomer = false;
        try 
        {
            Connection con = ConnectionUtil.getConnection();
            log.info(con.getMetaData().getDriverName());
        } 
        catch (SQLException | IOException e) 
        {
            log.error(e.getMessage());
        }
        UserDao udi = new UserDaoImpl();
        User client = new User();
        String usernameEntered = "";
        while(true) 
        {
            log.info("Please select a number for one of the options:");
            log.info("1: Sign up (new users)");
            log.info("2: Deposit Money"); 
            log.info("3: Withdraw Money");
            log.info("4: Check my Balance");
            log.info("5: Exit");
            try 
            {
                int choice = Integer.parseInt(sc.nextLine());
                switch(choice) 
                {
                    case 1:
                        log.info("Thank you for choosing to bank with us.");
                        log.info("\nPlease Enter a username: ");
                        usernameEntered = sc.nextLine();
                        if(udi.getUser().contains(udi.getUserById(usernameEntered))) 
                        {
                            log.info("Unfortunately, this username is already taken. Try again.");
                            break;
                        }
                        log.info("Please Enter a new password: ");
                        String pw = sc.nextLine();
                        log.info("Please Enter an initial amount for this account: ");
                        float depAmt = Float.parseFloat(sc.nextLine());
                        log.info("Thank you. Make sure to keep this password somewhere safe.");
                        client = new User(usernameEntered, pw, depAmt);
                        udi.createUser(client);
                        numUsers++;
                        loggedIn = true;
                        isCustomer = true;
                        break;
                    case 2:
                        if (!loggedIn) 
                        {
                            log.info("\nPlease Enter your username: ");
                            usernameEntered = sc.nextLine();
                        }
                        log.info("Please Enter your password: ");
                        pw = sc.nextLine();
                        if(udi.getUser().contains(udi.getUserById(usernameEntered))&& udi.getUserById(usernameEntered).getPassword().equals(pw)) 
                        {
                            isCustomer = true;
                            log.info("Please Enter the amount you want to deposit: ");
                            depAmt = Float.parseFloat(sc.nextLine());
                            udi.getUserById(usernameEntered).deposit(udi.getUserById(usernameEntered),usernameEntered, depAmt);
                        }
                        if (numUsers == 0 || !udi.getUser().contains(udi.getUserById(usernameEntered)) || !udi.getUserById(usernameEntered).getPassword().equals(pw)) 
                        {
                            log.info(NOT_CUSTOMER);
                            isCustomer = false;
                            loggedIn = false;
                            break;
                        }
                        if(!isCustomer) log.info(NO_ACCOUNT);
                        break;
                    case 3:
                        if (!loggedIn) 
                        {
                            log.info("\nPlease Enter your username: ");
                            usernameEntered = sc.nextLine();
                        }
                        log.info("Please Enter your password: ");
                        pw = sc.nextLine();
                        if(udi.getUser().contains(udi.getUserById(usernameEntered))&& udi.getUserById(usernameEntered).getPassword().equals(pw)) 
                        {
                            isCustomer = true;
                            log.info("Please Enter the amount you want to withdraw: ");
                            depAmt = Float.parseFloat(sc.nextLine());
                            udi.getUserById(usernameEntered).withdraw(udi.getUserById(usernameEntered),usernameEntered, depAmt);
                        }
                        if (numUsers == 0 || !udi.getUser().contains(udi.getUserById(usernameEntered)) || !udi.getUserById(usernameEntered).getPassword().equals(pw)) 
                        {
                            log.info(NOT_CUSTOMER);
                            isCustomer = false;
                            loggedIn = false;
                            break;
                        }
                        if(!isCustomer) log.info(NO_ACCOUNT);
                        break;
                    case 4:
                        if (!loggedIn) 
                        {
                            log.info("\nPlease Enter your username: ");
                            usernameEntered = sc.nextLine();
                        }
                        log.info("Please Enter your password: ");
                        pw = sc.nextLine();
                        if(udi.getUser().contains(udi.getUserById(usernameEntered))&& udi.getUserById(usernameEntered).getPassword().equals(pw)) 
                        {
                            isCustomer = true;
                            log.info("Your current balance is: $" + udi.getUserById(usernameEntered).getBalance());
                        }
                        if (numUsers == 0 || !udi.getUser().contains(udi.getUserById(usernameEntered)) || !udi.getUserById(usernameEntered).getPassword().equals(pw)) 
                        {
                            log.info(NOT_CUSTOMER);
                            isCustomer = false;
                            loggedIn = false;
                            break;
                        }
                        if(!isCustomer) log.info(NO_ACCOUNT);
                        break;
                    case 5:
                        log.info("You have chosen to exit. Thank you for banking with us. You are a valued customer. Goodbye :)");
                        System.exit(0);
                        break;
                    default:
                        break;
                } 
            } 
            catch (NumberFormatException e) 
            {
                log.error(e.getMessage());
            } 
        } 
    } 

92370/Code/Code/main/com/dao/UserDao.java
92370/Code/Code/main/com/dao/UserDao.java
package com.revature.dao;
import java.sql.Connection;
import java.util.List;
import com.revature.model.User;
public interface UserDao 

    public List getUser();
    public User getUserById(String id);
    public User getUserById(String id, Connection con);
    public int create...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here