![]() |
.. (לתיקייה המכילה) | |
The program works fine if I enter input through the keyboard, but it
doesn't do anything/gets stuck/doesn't work if I redirect the input from
the files you supplied. Can I remove the last getch() to make it work?
|
!! UPDATE !! due to problems still with the new files, all students are requested to submit the main functions without the getch() command. The updated files worked for sum, but not the others, so to keep a unified solution, everyone please submit without the getch() command. This should not affect your answers, and is just a technicality. Apologies for the mess... |
Can we use external library functions like sprintf, strlen, atoi and more?
|
No, please use only the functions we learned in class. You should not include any library other than stdio.h |
Can we assume the input is correct in all the questions?
|
Yes, you can assume the input is correct for all the questions, meaning you won't get strings instead of numbers, the ranges of the numbers correspond to variable types, and so on. Please note that if you get a number, then 0 is still correct, like when receiving a string, the empty string ("") is also correct. |
in Question 4a, what is the average of the neighbours of "4" (or any single
digit for that matter)?
| For a single digit, both neighbours are counted as zeros, so please return 0. |
In question 4b - if there are several maximum's, which index should I return?
| Please return the index of the first maximum. |
How do I input an empty line - I want to check my code in question 4b
|
It is indeed hard to read an empty line from the console. For testing purposes, you can call the function explicitly with an empty string: max_avg_str("") Only remember to remove it from main before submitting. |
Question 3 - several small questions
|
* In the assignment document, it is written to return the second input for q3 as "q3out2". It should be like the rest - "q3.out2". * 0 is divisible by three * You are allowed to change the original input string. |
What is "Decimal Form" (Yitzug Esroni) ?
|
The decimal form is the normal form we all know from grade 1. 123 should be returned as "123". 1 should be returned as "1". No periods, or trailing zeros should be added. Just the normal number. |

