We help IT Professionals succeed at work.

getting program to have certain output

Daaber40
Daaber40 asked
on
I have just written a program which asks the user to enter an integer between 1 and 10. If a wrong integer is entered it displays "You didn't follow directions, and will continue until a correct integer value is entered, at which time the output is "Nice Job". What I want it to do is print out ' Nice Job" for the amount of wrong answers entered. How would I get output to repeat

                               Thanks
                                 Daaber40@hotmail.com
Comment
Watch Question

c++:
int nTimes=5;
for(int i=0;i<nTimes;i++)
  cout<<"Nice job"<<endl;

c:
int nTimes=5;
for(int i=0;i<nTimes;i++)
  printf("Nice job\n");

--EC--
This is strange question. I understand from the question that you used loops before. So you just need to put the print function inside loop, and hey, if you'll go that direction, maybe you'll find more good uses for loops......:-)

--EC--

Commented:
ugly job, those homeworks !

Commented:
I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. Unless there is objection or further activity,  I will suggest to accept "elcapitan" comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points.
The link to the Community Support area is: http://www.experts-exchange.com/commspt

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
Per recommendation, force-accepted by
Netminder
CS Moderator

Experts: please check for "Points For" questions -- there are a bunch in this TA.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.