Friday, July 31, 2009

I need help with this C++ program?

/CREDIT CARD PROGRAM


#include





using namespace std;





int main()


{


//TASK ONE: DECLARE A VARIABLE CALLED balance OF TYPE float.


float charges;


float credits;


float creditLimit;


char pause;





cout %26lt;%26lt; "Enter beginning balance (use -1 to end):";


//TASK TWO: WRITE STATEMENT TO READ KEYBOARD INFORMATION AND


//STORE VALUE IN THE VARIABLE balance.





while ( ) //TASK THREE: COMPLETE while SO THAT THE


//LOOP IS ENTERED ONLY IF


//balance IS NOT EQUAL TO -1.


{


cout %26lt;%26lt; "Enter total charges: ";


cin %26gt;%26gt; charges;





cout %26lt;%26lt; "Enter total credits: ";


cin %26gt;%26gt; credits;





cout %26lt;%26lt; "Enter credit limit: ";


cin %26gt;%26gt; creditLimit;


Theres more to it, but f someone could point me in the right direction on how to complete this part, I could probably use that to finish the rest

I need help with this C++ program?
#include %26lt;iostream%26gt;


using namespace std;





int main()


{


//task 1:


float balance;


float charges;


float credits;


float creditLimit;


char pause;





cout %26lt;%26lt; "Enter beginning balance (use -1 to end):";


//task 2


cin%26gt;%26gt;balance;





//task 3


while (balance != -1)


{


cout %26lt;%26lt; "Enter total charges: ";


cin %26gt;%26gt; charges;





cout %26lt;%26lt; "Enter total credits: ";


cin %26gt;%26gt; credits;





cout %26lt;%26lt; "Enter credit limit: ";


cin %26gt;%26gt; creditLimit;





/* Now make sure that you finish the rest of the program with a return 0; for the end of the main and to close your while loop and you will be fine. hope this helps


*/
Reply:homework? XD. Well i dont know if its part of your program but at the top your comment needs 2 slashes.





//Credit Card Program.





You arent including anything so you need





#include %26lt;iostream%26gt;





and I believe your while loop cant have the comments inbetween the bracket like that ... I havent tested so i dont know for sure ...





and other than that the code ERRORS are fixed.





Hope this helps ^_^


No comments:

Post a Comment