Lost Password?


Go Back   CodeCall Programming Forum > Software Development > C and C++

C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-16-2008, 06:42 PM
zizimetalique zizimetalique is offline
Newbie
 
Join Date: Nov 2007
Posts: 20
Rep Power: 4
zizimetalique is on a distinguished road
Default New Code, sorry couldnt delete the old one!

Hi !
Help with my code

i have to write a program that prompts the following from the user:account number, an account type (s for savings and c for checking), minimum balance, and current balance. then the prog should output: the account number, the full account type (savings or checking), the current balance, and a message as described below.

For savings accounts, the output current balance is the input balance plus 4% interest. Also a service charge of $10 is subtracted for balances below minimum balance. A message will say whether a charge or interest is in effect.

For checking accounts, the output balance is input balance plus 5% interest of amounts up to $5000 over the minimum balance and 3% for excess amounts. Also $25 is charged for balances below minimum balance. A message is displayed as in the savings case.

Here is suggested test data: 46728 S 1000 2700

87324 C 1500 7689

79873 S 1000 800

89832 C 2000 3000

98322 C 1000 750


i changed the code, fixed few errors, here is the New code and the errors below:
Once again your help and your kindness will be appreciated!
Code:
#include<iostream>
using namespace std;
int main(){
int accounttype;
int totalamount;
int minimbalance;
int currentbalance;
int select = 0;
int accountnumber;
// select 1 = savings;
// select 2 = checkings;
cout << "choose from the followings: 1 for savings 2 for checkings " ;
cin >> select;
cout << " enter your minimum balance ";
cin >> minimbalance;
cout << " enter your current balance ";
cin >> currentbalance;
cout << " what is your account number? Please enter your account number " ;
cin >> accountnumber;

if (select == 1)
{
if (currentbalance < minimumbalance)

totalamount = currentbalance - 10;

}
else

if (currentbalance >= minimumbalance)

{ totalamount = currentbalance * 1.04 ;



if (select == 2)
{
if (currentbalance < minimbalance)
totalamount = currentbalance - 25;
}
else

if (currentbalance >= minimbalance && >= 5000)
{
totalamount = currentbalance * 1.05 ;
}
else
if (currentbalance < minimbalance && <= 5000)
totalamount = currentbalance * 1.03 ;
}
cout << " your account type is " << accounttype << " your account number is " << accountnumber << endl;
cout << " and your current balance which is your Total balance is " << totalamount << endl;
cout << endl;
}
account.cpp:23: error: âminimumbalanceâ was not declared in this scope
account.cpp:30: error: âminimumbalanceâ was not declared in this scope
account.cpp:32: warning: converting to âintâ from âdoubleâ
account.cpp:43: error: expected primary-expression before â>=â token
account.cpp:45: warning: converting to âintâ from âdoubleâ
account.cpp:48: error: expected primary-expression before â<=â token
account.cpp:49: warning: converting to âintâ from âdoubleâ

Last edited by WingedPanther; 07-17-2008 at 12:22 PM. Reason: add code tags
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 07-17-2008, 12:26 PM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 3,421
Last Blog:
wxWidgets is NOT code ...
Rep Power: 37
WingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to behold
Default Re: New Code, sorry couldnt delete the old one!

(currentbalance >= minimbalance && >= 5000)
(currentbalance < minimbalance && <= 5000)

These are invalid syntax. They should be:
((currentbalance >= minimbalance) && (currentbalance >= 5000))
((currentbalance < minimbalance) && (currentbalance <= 5000))
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Programming is a branch of mathematics.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic Calculator AfTriX VB Tutorials 3 02-29-2008 09:53 AM
How to write the code to delete the whole binary search tree ?? worried_student C and C++ 1 11-23-2007 11:09 AM


All times are GMT -5. The time now is 11:33 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 101%


Complete - Celebrate!

Ads