Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,132 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,795 people online right now. Registration is fast and FREE... Join Now!




Functions and Loops

 
Reply to this topicStart new topic

Functions and Loops, Need Help putting a loop in after I've written functions

mizzfitcenny
11 Apr, 2007 - 03:03 PM
Post #1

New D.I.C Head
*

Joined: 13 Jan, 2007
Posts: 13


My Contributions
Hi, I'm new to programming in c++, I'm working on an assignment where I had to calculate a bill using functions. Now I have to put either a sentinel or count controlled loop in so that the user can generate more than one bill without having to restart the program over and over. I know that you need to see code but I'm leary about posting it here because I don't want another student to be able to see and possibly steel it and turn it in as their own. My question is....is there some way on here to talk privately with someone that would be willing to help? I'll show my code then. I know it's a lot to ask, but if it's possible I'd appreciate it.
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Functions And Loops
11 Apr, 2007 - 03:15 PM
Post #2

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,226



Thanked: 37 times
Dream Kudos: 25
My Contributions
We prefer to see the code so everyone can benefit, although your concerns are understandable: A loop can be implemented like so:

CODE

int main(void)
{
   char input = 'Y';
   while(input=='Y')
   {
    //your code goes here
      cout<<"Do you wish to continue (Y/N)?"<<endl;
      cin>>input;
   }
   return 0;
}

User is offlineProfile CardPM
+Quote Post

mizzfitcenny
RE: Functions And Loops
11 Apr, 2007 - 03:26 PM
Post #3

New D.I.C Head
*

Joined: 13 Jan, 2007
Posts: 13


My Contributions
QUOTE(Amadeus @ 11 Apr, 2007 - 04:15 PM) *

We prefer to see the code so everyone can benefit, although your concerns are understandable: A loop can be implemented like so:

CODE

int main(void)
{
   char input = 'Y';
   while(input=='Y')
   {
    //your code goes here
      cout<<"Do you wish to continue (Y/N)?"<<endl;
      cin>>input;
   }
   return 0;
}





This post has been edited by mizzfitcenny: 11 Apr, 2007 - 04:00 PM
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Functions And Loops
11 Apr, 2007 - 04:15 PM
Post #4

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,226



Thanked: 37 times
Dream Kudos: 25
My Contributions
Not sure if there was another question or not....
User is offlineProfile CardPM
+Quote Post

mizzfitcenny
RE: Functions And Loops
11 Apr, 2007 - 04:29 PM
Post #5

New D.I.C Head
*

Joined: 13 Jan, 2007
Posts: 13


My Contributions
QUOTE(Amadeus @ 11 Apr, 2007 - 05:15 PM) *

Not sure if there was another question or not....



There was...I had posted my code but then no one answered so I deleted it. sorry.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 10:25PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month