[-] Illegal characters should be ignored
by ofersuli - Monday, 18 April 2016 21:50:05
האם הכוונה היא שיתכן שנקבל קלט שאינו תווים המייצגים ספרות עשרוניות?
[-] Re: Illegal characters should be ignored
by shaera - Tuesday, 19 April 2016 09:28:18
האפשרות התקינה היא מספר עשרוני. עבור כל תו אחר שאינו ספרה עשרונית, תצטרכו לזהות, לתת הודעת שגיאה ולהמשיך את ריצת המחשבון
[-] Re: Illegal characters should be ignored
by ofersuli - Tuesday, 19 April 2016 15:18:28
תודה, אם כן, מהי הודעת השגיאה שיש להדפיס במקרה זה?
[-] Re: Illegal characters should be ignored
by shaera - Friday, 22 April 2016 15:04:01
"Error: Illegal Input".
[-] Re: Illegal characters should be ignored
by ofirhau - Tuesday, 26 April 2016 20:52:31
There are few things that aren't clear here:
(1) At the assignment you wrote to ignore illegal characters, but here you say to print error message. So what are we suppose to do? 
I think it will look much better just to ignore it, as you will see below...
(2). I think that handling illegal input is much more complicated then it may seems, and I am not sure what to do in a situation like this from what I read in the assignment description. In order to make this simpler and cleaner, can we assume the following assumptions:

a. if the first character of the input is legal and isn't numeric, it is a legal operation\quit command and will determine the command type. examples:

+fde -  addition command (other characters ignored)
&54-   and command (other characters ignored)

b. If the first character of the input is legal and numeric,  it's a legal number command and the number will be created from the first character (including) to the first not numeric character (not including) of the input. examples:

45 - number 45
9430tr - number 9430 (other characters ignored)
329p - number 329 (other characters ignored)
54&4 - number 54 (other characters ignored)

Edit: I see now that you wrote: "You may assume that the number entry format is correct" . So if the first character of an input is numeric, can we just assume that all other characters are also numeric? it will be easier to handle from what I wrote here.

c. If the first character of the input is illegal, we will ignore the input, and take next input from user. examples:

hjo- input ignored, get next input from user
f43- input ignored, get next input from user





[-] Re: Illegal characters should be ignored
by shaera - Tuesday, 26 April 2016 22:38:12
קראתי את הדברים שכתבת ואתה צודק, אכן כתבנו שלא נבדוק ספרות בסגנון זה ושיש להתעלם, ולכן אין טעם בבדיקה. (אם כי )היא איננה מסובכת כפי שאתה חושב.

תודה על ההארה, אין צורך בבדיקה הנ"ל

c. כן, במקרה זה תודפס ההודעה שתוארה לעיל
[-] Re: Illegal characters should be ignored
by ofirhau - Thursday, 28 April 2016 15:34:59
Thank you. So just to verify:

1. if the first character of the input is legal and isn't numeric, it is a legal operation\quit command and will determine the command type. Next characters of the input will be ignored- just like in the examples for this case in my previous respond.

2. If the first character of the input is legal and numeric, we can assume that the next characters are also numeric.

3. If the first character of the input is illegal, we will print "Error: Illegal Input", and then take next input from user.

Am I right?
[-] Re: Illegal characters should be ignored
by shaera - Friday, 29 April 2016 10:18:16
Yes
[-] Re: Illegal characters should be ignored
by ncoh - Friday, 29 April 2016 22:51:26
What about empty input? (a string that conatins only null-terminate char or newline) should we print error messgae as well?
Re: Illegal characters should be ignored
by shaera - Tuesday, 3 May 2016 23:55:44
empty input will not be checked.