Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- project3.cpp
- Andre Fecteau
- CSC135-101
- October 29, 2013
- This program prints a bank's service fees per month depending on account type
- */
- /*start Must Haves*/
- #include <iostream>
- using namespace std;
- /*End Must Haves*/
- /*
- Basic Function for Copy Paste
- <function type> <function name> (){
- // Declarations
- // Initalizations
- // Input
- // Process
- // Output
- // Prolouge
- }
- */
- /*Start Display Instructions*/
- void displayInstructions (){
- // Declarations
- // Initalizations
- // Input
- // Process
- // Output
- cout <<"| -------------------------------------------------------------- |" << endl;
- cout <<"| ---------- Welcome to the bank fee calculator ---------------- |" << endl;
- cout <<"| -------------------------------------------------------------- |" << endl;
- cout <<"| This Program wil ask you to eneter your account number. |" << endl;
- cout <<"| Then it will ask for your account type Personal or Commercial. |" << endl;
- cout <<"| Then ask for the amount of checks you have written. |" << endl;
- cout <<"| Lastly it will output how much your fees are for this month. |" << endl;
- cout <<"| -------------------------------------------------------------- |" << endl;
- cout << endl;
- // Prolouge
- }
- /*End Display Instructions*/
- /*Start Account Number Input*/
- int readAccNumb(){
- // delarations
- int accNumber;
- // intitalizations
- accNumber = 0.0;
- // input
- cout << "Please Enter Account Number:";
- cin >> accNumber;
- // Procesas
- // output
- // prolouge
- return accNumber;
- }
- /*End Account Number Input*/
- /*Start Check written input*/
- int checksWritten (){
- // Declarations
- int written;
- // Initalizations
- written = 0.0;
- // Input
- cout <<"Please input the amount of checks you have written this month:";
- cin >> written;
- // Output
- // Prolouge
- return written;
- }
- /*End Check written input*/
- /*Start Account Type*/
- char accType (){
- // Declarations
- char answer;
- int numberBySwitch;
- // Initalizations
- numberBySwitch = 1;
- // Input
- while (numberBySwitch == 1){
- cout << "Please Enter the acount type (C for Comerical and P for Personal):";
- cin >> answer;
- // Process
- switch (answer){
- case 'p':
- answer = 'P';
- numberBySwitch += 2;break;
- case 'P':
- numberBySwitch += 2;break;
- case 'c':
- answer = 'C';
- numberBySwitch += 3;break;
- case 'C':
- numberBySwitch += 3;break;
- default:
- if(numberBySwitch == 1) {
- cout << "Error! Please enter a correct type!" <<endl;
- }
- }
- }
- // Output
- // Prolouge
- return answer;
- }
- /*End Account Type*/
- /*Being Commercial Account*/
- int commericalCalc(int checksWritten){
- // Declarations
- int written;
- int checkPrice;
- // Initalizations
- checkPrice = 0.0;
- // Input
- // Process
- if(written < 20){
- checkPrice = 0.10;
- }
- // Output
- // Prolouge
- return checkPrice;
- }
- /*End Commerical Account*/
- /*begin personal account*/
- int personalCalc(int checksWritten){
- }
- /*end personal calc*/
- /*begin personal*/
- /*end personal*/
- /*begin commerical*/
- /*end commerical*/
- /*Being split*/
- double pricePerCheck(char accType, int checksWritten){
- // Declarations
- double price;
- // Initalizations
- price = 0.0;
- // Input
- // Process
- if(accType == 'P'){
- }
- if(accType == 'C'){
- if(checksWritten < 20){
- price = 0.10;
- }
- }
- // Output
- // Prolouge
- return price;
- }
- /*End split*/
- /*Start Main*/
- int main(){
- // Declarations
- int accountNumb;
- char theirAccType;
- int writtenChecks;
- double split;
- // Initalizations
- accountNumb = 0.0;
- writtenChecks = 0.0;
- split = 0.0;
- theirAccType = ' ';
- // Input
- displayInstructions();
- accountNumb = readAccNumb();
- theirAccType = accType();
- pricePerCheck(accType(), checksWritten());
- // Output
- cout << endl;
- cout << "Account Type: " << theirAccType << endl;
- cout << "Check Price: " << endl;
- // Prolouge
- return 0;
- }
- /*End Main*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement