Give me a chequebook balancing program.

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jan 2009
Posts: 7
Reputation: hsoni007 is an unknown quantity at this point 
Solved Threads: 1
hsoni007's Avatar
hsoni007 hsoni007 is offline Offline
Newbie Poster

Give me a chequebook balancing program.

 
0
  #1
Jan 26th, 2009
How can i make a chequebook balancing program of an user’s account?
It will use getline() to read a line, which will contain either the word “withdrawl” or “deposit”.
The next line will contain the amount of the withdrawl or deposit. After reading each pair of lines, the program should compute and print the new balance.
You can declare the variable to hold the running balance to be datatype float, and you can use the function atof() to convert an amount string read by getline() into a floating-point number.
When the program reaches end-of-file, it should exit.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Give me a chequebook balancing program.

 
1
  #2
Jan 26th, 2009
> Give me a chequebook balancing program.
How presumptuous of you that you think you can just roll in here and demand that we do your homework.

True or false - this applies to you as well as all the other noobs?
Announcement: We only give homework help to those who show effort
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 7
Reputation: hsoni007 is an unknown quantity at this point 
Solved Threads: 1
hsoni007's Avatar
hsoni007 hsoni007 is offline Offline
Newbie Poster

Re: Give me a chequebook balancing program.

 
0
  #3
Jan 26th, 2009
Please give me a hint to make this program!
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 2,048
Reputation: Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of 
Solved Threads: 178
Aia's Avatar
Aia Aia is offline Offline
Postaholic

Re: Give me a chequebook balancing program.

 
0
  #4
Jan 26th, 2009
Salem gave you a hint already, but if you feel you need more I'll give you another.

Search for your answer first!; the first point from Read This Before Posting, at the head of the forum.
"If it moves, tax it. If it keeps moving, regulate it, and if it stops moving, subsidize it" - Ronald Reagan
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Give me a chequebook balancing program.

 
0
  #5
Jan 26th, 2009
The hints in your homework seem pretty massive from where I'm sitting.

> It will use getline() to read a line
There you go, write a program using getline() and see what happens.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 7
Reputation: hsoni007 is an unknown quantity at this point 
Solved Threads: 1
hsoni007's Avatar
hsoni007 hsoni007 is offline Offline
Newbie Poster

Re: Give me a chequebook balancing program.

 
0
  #6
Jan 26th, 2009
IS getline() INBUILD FUNCTION?
AND HOW IS IT WORKS?
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Give me a chequebook balancing program.

 
0
  #7
Jan 26th, 2009
Erm, tell me this isn't the first ever program you've written.

And yes getline() is a function in C++.
I know you've posted on the C forum, but I figured the assignment knew more than you did, and the intention was for you to use C++.

If that's not the case (and it's really C), then you need to write your own (hint: use fgets).
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Give me a chequebook balancing program.

 
0
  #8
Jan 27th, 2009
There you go, a program to print a balanced checkbook
  1. #include <stdio.h>
  2. int main ( ) {
  3. printf(
  4. "CHECKBOOK\n"
  5. "=========\n"
  6. " ^\n"
  7. );
  8. return 0;
  9. }
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 82
Reputation: riahc3 is an unknown quantity at this point 
Solved Threads: 0
riahc3 riahc3 is offline Offline
Junior Poster in Training

Re: Give me a chequebook balancing program.

 
1
  #9
Jan 28th, 2009
Originally Posted by Salem View Post
There you go, a program to print a balanced checkbook
Well I learnt something from this thread

  1. printf(
  2. "CHECKBOOK\n"
  3. "=========\n"
  4. " ^\n"
  5. );
Had no idea you could do that in C.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C Forum
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC