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 6 articles in this topic
Showing 6 of 828 articles.
Currently 105 other people reading this forum.


 UWA week 42 (2nd semester, week 12) ↓
SVG not supported

Login to reply

👍?
helpful
4:16pm Tue 15th Oct, Anthony S.

Hi, I know the memory struct given to us is an unnamed struct but is it okay if we make a new type called struct memory? This is how I have defined my struct: struct memory { int process_id; int page_num; int last_accessed; }; Also can you verify this output: in.txt 0 0 0 0 1 0 0 2 3 1 0 2 3 3 2 out.txt 0, 1, 2, 3, 4, 7, 99, 99, 99, 99, 5, 99, 99, 99, 6, 99, 0,0,5; 0,0,5; 0,1,6; 0,1,6; 0,2,10; 0,2,10; 0,3,3; 0,3,3; 1,0,4; 1,0,4; 2,2,14; 2,2,14; 3,2,13; 3,2,13; 1,1,9; 1,1,9;


SVG not supported

Login to reply

👍?
helpful
4:23pm Tue 15th Oct, ANONYMOUS

"Anthony Stewart" <24*0*5*9@s*u*e*t*u*a*e*u*a*> wrote:
> Hi, I know the memory struct given to us is an unnamed struct but is it okay if we make a new type called struct memory? > This is how I have defined my struct: > > struct memory { > int process_id; > int page_num; > int last_accessed; > }; > > Also can you verify this output: > > in.txt > 0 0 0 0 1 0 0 2 3 1 0 2 3 3 2 > > out.txt > 0, 1, 2, 3, > 4, 7, 99, 99, > 99, 99, 5, 99, > 99, 99, 6, 99, > 0,0,5; 0,0,5; 0,1,6; 0,1,6; 0,2,10; 0,2,10; 0,3,3; 0,3,3; 1,0,4; 1,0,4; 2,2,14; 2,2,14; 3,2,13; 3,2,13; 1,1,9; 1,1,9;
I got the same output, so it's probably correct. In case anyone is looking at this later and wants to know the output for not allowing process pages to be read more than once, the output should be something like this: 0, 1, 2, 3 4, 7, 99, 99 99, 99, 5, 99 99, 99, 6, 99 0,0,0; 0,0,0; 0,1,1; 0,1,1; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,0,4; 1,0,4; 2,2,14; 2,2,14; 3,2,13; 3,2,13; 1,1,9; 1,1,9


SVG not supported

Login to reply

👍?
helpful
4:39pm Tue 15th Oct, Joshua N.

Both are correct. The struct you make doesn't need to be exactly the same.


SVG not supported

Login to reply

👍?
helpful
1:16pm Wed 16th Oct, ANONYMOUS

Are you assuming time stamp increases when you ignore a page? Our output is: 0, 1, 2, 3 4, 7, 99, 99 99, 99, 5, 99 99, 99, 6, 99 0,0,0; 0,0,0; 0,1,1; 0,1,1; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,0,4; 1,0,4; 2,2,11; 2,2,11; 3,2,10; 3,2,10; 1,1,7; 1,1,7; Cheers


SVG not supported

Login to reply

👍?
helpful
1:32pm Wed 16th Oct, ANONYMOUS

ANONYMOUS wrote:
> Are you assuming time stamp increases when you ignore a page? Our output is: > > 0, 1, 2, 3 > 4, 7, 99, 99 > 99, 99, 5, 99 > 99, 99, 6, 99 > > > 0,0,0; 0,0,0; 0,1,1; 0,1,1; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,0,4; 1,0,4; 2,2,11; 2,2,11; 3,2,10; 3,2,10; 1,1,7; 1,1,7;
You are correct on that, yes. By not incrementing the time that is the expected output - you should list that as one of your assumptions though, just in case.


SVG not supported

Login to reply

👍?
helpful
8:05pm Wed 16th Oct, Joshua N.

ANONYMOUS wrote:
> Are you assuming time stamp increases when you ignore a page? Our output is: > > 0, 1, 2, 3 > 4, 7, 99, 99 > 99, 99, 5, 99 > 99, 99, 6, 99 > > > 0,0,0; 0,0,0; 0,1,1; 0,1,1; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,0,4; 1,0,4; 2,2,11; 2,2,11; 3,2,10; 3,2,10; 1,1,7; 1,1,7; > > Cheers
You are right the time stamp shouldn't increase when you ignore a page I got mixed up with the reloading.

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