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.

> 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

Comments
Boolean arithmetic is an advanced topic. You might had set expections too high.

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.

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).

There you go, a program to print a balanced checkbook

#include <stdio.h>
int main ( ) {
    printf(
        "CHECKBOOK\n"
        "=========\n"
        "    ^\n"
        );
    return 0;
}
Comments
Loved the sarcasm ;-)

There you go, a program to print a balanced checkbook

Well I learnt something from this thread

printf(
        "CHECKBOOK\n"
        "=========\n"
        "    ^\n"
        );

Had no idea you could do that in C.

Comments
:) at least someone got something out of it
This article has been dead for over six months. Start a new discussion instead.