100% found this document useful (1 vote)
140 views

Phase 1

The document describes phase 1 of a C++ programming assignment to create an ATM machine simulation. It outlines the required functionality, including allowing users to create an account, log in, deposit and withdraw money, check their balance, and quit the program. It provides sample output of the program in use. The code section includes function prototypes and outlines the starter code, explaining that students need to write the printIntroMenu(), printMainMenu(), and start() functions to display menus, get user input, and direct program flow based on that input.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
140 views

Phase 1

The document describes phase 1 of a C++ programming assignment to create an ATM machine simulation. It outlines the required functionality, including allowing users to create an account, log in, deposit and withdraw money, check their balance, and quit the program. It provides sample output of the program in use. The code section includes function prototypes and outlines the starter code, explaining that students need to write the printIntroMenu(), printMainMenu(), and start() functions to display menus, get user input, and direct program flow based on that input.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

C++ Programming Assig

ATM Machine Phase 1

In this assignment you will create a program that allows a user to do the
following:

1) Create a bank account by supplying a user id and password.


2) Login using their id and password.
3) Quit the program.

Now if login was successful the user will be able to do the following:

1) Withdraw money.
2) Deposit money.
3) Request balance.
4) Quit the program.

If login was not successful (for example the id or password did not match)
then the user will be taken back to the introduction menu.

This is what your program in action will look like:

Hi! Welcome to Mr. Zamar’s ATM Machine!

Please select an option from the menu below:

l -> Login
c -> Create New Account
q -> Quit

>l

Please enter your user id: 12


Please enter your password 2345

******** LOGIN FAILED! ********

Please select an option from the menu below:

l -> Login
c -> Create New Account
q -> Quit

>c

Please enter your user name: 12


Please enter your password: 2345

Thank You! Your account has been created!

l -> Login
c -> Create New Account
q -> Quit

>l
Please enter your user id: 12
Please enter your password: 2345

Access Granted!

d -> Deposit Money


w -> Withdraw Money
r -> Request Balance

>d

Amount of deposit: $20

d -> Deposit Money


w -> Withdraw Money
r -> Request Balance

>r

Your balance is $20.

d -> Deposit Money


w -> Withdraw Money
r -> Request Balance

>w

Amount of withdrawal: $2.5

d -> Deposit Money


w -> Withdraw Money
r -> Request Balance

>r

Your balance is $17.5.

d -> Deposit Money


w -> Withdraw Money
r -> Request Balance

>q

Thanks for stopping by!

Phase 1 of this project will require you complete the code found on the next page.
// CODE STARTS HERE

#include <iostream.h>
#include <stdlib.h>

// function prototypes
void printIntroMenu();
void printMainMenu();
void start();
void login();
void createAccount();

// global variable (use this variable to store the user’s menu selection)
char menuInput;

// the main function


int main()
{
// TO WRITE A WELCOME MESSAGE HERE

// call the function start


start();

return 0;
}

void printIntroMenu()
{
// WRITE CODE HERE
}

void printMainMenu()
{
// WRITE CODE HERE
}

void start()
{
// EXPLANATION OF CODE THAT GOES HERE IS BELOW
}

void createAccount()
{
// PHASE 2
}

void login()
{
// PHASE 2
}

// CODE ENDS HERE


The function printIntroMenu() displays the following:

Please select an option from the menu below:

l -> Login
c -> Create New Account
q -> Quit

>

The function printMainMenu() displays the following menu:

d -> Deposit Money


w -> Withdraw Money
r -> Request Balance
q -> Quit

>

The function start() does the following:

1) Displays the following message, “Please select an option from the menu below: ”

2) Displays the introduction menu. Do this by calling the function you created
earlier, printIntroMenu()

3) Program halts and waits for the user to make their selection. Use the cin >>
function to accomplish this step.

4) Now use a switch statement to do the following:


If the user types the character ‘l’ then the function login() is called
If the user types the character ‘c’ then the function createAccount() is called.
If the user types ‘q’ your program will terminate by calling the function exit(0)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy