|
Web design and Programming Discuss website creation and other programming topics. |
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||
|
![]()
posted below is a C++ program that will manage you checking account...
// this is a simple C++ program..try finding a compiler and give this code a go! for keeping track of your dough #include (iostream) #include (iomanip) #include (cstdlib) using namespace std; int main() { // DECLARE VARIABLES double ACCOUNT_BALANCE, FINAL_BALANCE, DEPOSIT, CHECK, WITHDRAWAL, TOTAL_DEPOSIT, TOTAL_CHECK, TOTAL_WITHDRAWAL; int MENU_RESPONSE; // INITIALIZE ACCOUNT_BALANCE = FINAL_BALANCE = DEPOSIT = CHECK = WITHDRAWAL = TOTAL_DEPOSIT = TOTAL_CHECK = TOTAL_WITHDRAWAL = 0; // set precision to 2 cout << setprecision(2) << setiosflags(ios::fixed) << setiosflags(ios::showpoint); // get user inout cout << "\nEnter opening balance: "; cin >> ACCOUNT_BALANCE; // OBTAIN INPUT DATA cout << "\n\nENTER:"; cout << "\nD or d for DEPOSIT"; cout << "\nC or c for CHECK"; cout << "\nW or w for WITHDRAWAL"; cout << "\nQ or q to QUIT"; cout << "\n "; MENU_RESPONSE = cin.get(); // PERFORM SWITCH switch (MENU_RESPONSE) { case 'D': case 'd': cout << "\nEnter DEPOSIT: "; cin >> DEPOSIT; ACCOUNT_BALANCE += DEPOSIT; TOTAL_DEPOSIT += DEPOSIT; cout << "\n\nENTER:"; cout << "\nD or d for DEPOSIT"; cout << "\nC or c for CHECK"; cout << "\nW or w for WITHDRAWAL"; cout << "\nQ or q to QUIT"; cout << "\n "; break; case 'C': case 'c': cout << "\nEnter CHECK: "; cin >> CHECK; ACCOUNT_BALANCE -= CHECK; TOTAL_CHECK += CHECK; cout << "\n\nENTER:"; cout << "\nD or d for DEPOSIT"; cout << "\nC or c for CHECK"; cout << "\nW or w for WITHDRAWAL"; cout << "\nQ or q to QUIT"; cout << "\n "; break; case 'W': case 'w': cout << "\nEnter WITHDRAWAL: "; cin >> WITHDRAWAL; ACCOUNT_BALANCE -= WITHDRAWAL; TOTAL_WITHDRAWAL += WITHDRAWAL; cout << "\n\nEnter:"; cout << "\nD or d for DEPOSIT"; cout << "\nC or c for CHECK"; cout << "\nW or w for WITHDRAWAL"; cout << "\nQ or q to QUIT"; cout << "\n "; break; case 'Q': case 'q': cout << "\n\nOPENING BALANCE: " << setw(12) << "$" << ACCOUNT_BALANCE; cout << "\nTOTAL DEPOSIT: " << setw(12) << "$" << TOTAL_DEPOSIT; cout << "\nTOTAL CHECKS: " << setw(12) << "$" << TOTAL_CHECK; cout << "\nTOTAL WITHDRAWALS: " << setw(12) << "$" << TOTAL_WITHDRAWAL; cout << "\n ---------------"; FINAL_BALANCE = ACCOUNT_BALANCE + TOTAL_DEPOSIT - TOTAL_CHECK - TOTAL_WITHDRAWAL; cout << "\nFINAL BALANCE: " << setw(12) << "$" << FINAL_BALANCE; break; default: cout << "\nInvalid Response! Try again"; exit(1); break; } return 0; } ![]() ![]()
__________________
=====Retired sig team member===== ![]() |
#2
|
||
|
your just adding to my confusion...
![]() |
#3
|
||
|
i just got dumber from looking at that...
dumber...is that even a word?
__________________
-o l d e s t- ![]() |
#4
|
||
|
no its dumberer
|
#5
|
||
|
oh, right!
__________________
-o l d e s t- ![]() |
#6
|
||
|
wow you do that your self, cuz there is ways to shorten it
![]() |
#7
|
||
|
I did that once in Qbasic. Used it for a full year.
looks pretty good. Now you need to add a nice user interface ![]() IcI |
#8
|
|||
|
no its mor e dumb, uh, eh
so, who knows what the hell bone is talking about ![]()
__________________
![]() ![]() ![]() ![]() Supporter > ![]() Quote:
|
#9
|
|||
|
Quote:
![]() i love coding in C++...but visual basic.net is groovie too
__________________
=====Retired sig team member===== ![]() |
#10
|
|||
|
Quote:
__________________
=====Retired sig team member===== ![]() |
#11
|
|||
|
Quote:
lol..good idea..make my own MS money app lol
__________________
=====Retired sig team member===== ![]() |
#12
|
||
|
I was going to write one in vb.net, but never got around to doing it.
I like Visual Basic.net (or C#.net) better then c++ because I don't have to type out the needed code to make windows and buttons, ect.. IcI |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
2 new gfx | Lucky | Sigs and Graphics | 4 | 02-20-2006 11:01 AM |
W-GFX | DogSoldier~MLK~ | Sigs and Graphics | 0 | 12-03-2003 03:42 PM |
my new gfx | secretx | Sigs and Graphics | 3 | 11-27-2003 09:36 AM |
M-GFX | DogSoldier~MLK~ | Sigs and Graphics | 0 | 10-26-2003 04:34 PM |
My GFX | thisoneguy | Sigs and Graphics | 18 | 10-16-2003 01:38 PM |