It's UWAweek 47

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
Displaying the 7 articles in this topic
Showing 7 of 828 articles.
Currently 81 other people reading this forum.


 UWA week 40 (2nd semester, week 10) ↓
SVG not supported

Login to reply

👍?
helpful
4:09pm Wed 2nd Oct, Liam H.

Will we be expected to sanitise or validate the input file? For example, if the input file requests the next page for process 9 (obviously doesn't exist), should we print an error? Or perhaps shoudl we catch any potential invalid inputs and skip them?


SVG not supported

Login to reply

👍?
helpful
8:13pm Wed 2nd Oct, Joshua N.

"Liam Hearder" <23*7*4*2@s*u*e*t*u*a*e*u*a*> wrote:
> Will we be expected to sanitise or validate the input file? > > For example, if the input file requests the next page for process 9 (obviously doesn't exist), should we print an error? Or perhaps shoudl we catch any potential invalid inputs and skip them?
I think this is meant to be a simple project. So, I don't think input sanitization is necessary, but it is good practice.


SVG not supported

Login to reply

👍?
helpful
6:15pm Thu 3rd Oct, Samay G.

So, if any process request comes other than 0 to 3 in the input string, I am skipping that process and processing rest of the processes as required without printing any error


SVG not supported

Login to reply

👍?
helpful
6:46pm Thu 3rd Oct, Joshua N.

"Samay Gupta" <23*6*5*8@s*u*e*t*u*a*e*u*a*> wrote:
> So, if any process request comes other than 0 to 3 in the input string, I am skipping that process and processing rest of the processes as required without printing any error
If you countered a number outside of 0-3 then you would assume the file is corrupted and you shouldn't continue reading. So best practice is to print an error message then call exit(EXIT_FAILURE).


SVG not supported

Login to reply

👍?
helpful
6:47pm Thu 3rd Oct, Joshua N.

"Joshua Noble" <22*6*9*8@s*u*e*t*u*a*e*u*a*> wrote:
> "Samay Gupta" <23*6*5*8@s*u*e*t*u*a*e*u*a*> wrote: > > > So, if any process request comes other than 0 to 3 in the input string, I am skipping that process and processing rest of the processes as required without printing any error >
If you encountered a number outside of 0-3 then you would assume the file is corrupted and you shouldn't continue reading. So best practice is to print an error message then call exit(EXIT_FAILURE).


SVG not supported

Login to reply

👍?
helpful
6:50pm Thu 3rd Oct, Joshua N.

"Joshua Noble" <22*6*9*8@s*u*e*t*u*a*e*u*a*> wrote:
> "Joshua Noble" <22*6*9*8@s*u*e*t*u*a*e*u*a*> wrote: > > > "Samay Gupta" <23*6*5*8@s*u*e*t*u*a*e*u*a*> wrote: > > > > > So, if any process request comes other than 0 to 3 in the input string, I am skipping that process and processing rest of the processes as required without printing any error > > > > If you encountered a number outside of 0-3 then you would assume the file is corrupted and you shouldn't continue reading. So best practice is to print an error message then call exit(EXIT_FAILURE).
Actually the best practice is to never call "exit" because it doesn't end the program "gracefully". The best practice is to return EXIT_FAILURE (1) in main. If you are interested.


SVG not supported

Login to reply

👍?
helpful
2:50pm Sat 5th Oct, Samay G.

Thanks for the guidance, Appreciate it

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy