954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

help wanted

I was encoding a C program as my assignment and got stuck. Following is the part of my assignment where i got stuck

Please enter the employee's pay period information :
Income for the current pay period : -2400
**Value must be greater than 0.0
**Try again. : 2400..
**Trailing character encountered
**Try again. : 2400.00

Can anybody tell me what condition I have to use here?

mayank24
Newbie Poster
5 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

So what got you "stuck" ?

>>Can anybody tell me what condition I have to use here?
Sorry but I'm having trouble seeing the code on your computer. Please post on DaniWeb.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 
Can anybody tell me what condition I have to use here?


I see the possibility of an switch inside a do/while loop

declare an input variable and a flag variable
set a flag to false
ask the question
do
    obtain the user input
    switch input variable
         wrong input:
             display warning
             set flag false
             break
         right input:
             do this
             set flag true
             break
while flag is false repeat
Aia
Nearly a Posting Maven
2,392 posts since Dec 2006
Reputation Points: 2,224
Solved Threads: 218
 

Thank you very much friend. Your solution helped me alot. Thank you once again

I see the possibility of an switch inside a do/while loop

declare an input variable and a flag variable
set a flag to false
ask the question
do
    obtain the user input
    switch input variable
         wrong input:
             display warning
             set flag false
             break
         right input:
             do this
             set flag true
             break
while flag is false repeat
mayank24
Newbie Poster
5 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You