ANONYMOUS wrote
It does seem like this question is an issue with semantics ( which has happened before (https secure.csse.uwa.edu.au run help2002?p np opt U463 year 2019)) and being such a minute detail of the system call. It seems, at least, possi...
ANONYMOUS wrote
Thanks for the link. However, unless I'm misinterpreting it, that thread ended unresolved too. Dr. McDonald's only contribution in that thread was a non-answer (below)
All the other messages seem to be speculation, where the same argu...
Feel the same way. Why to create such ambiguity in the description of the question? This cannot verify whether we have mastered the knowledge. On the contrary, such tricks make me more confused and increase the difficulty of mastering the correct kno...
After going through multiple years of forums, I believe I found an answer to this specific question here
https secure.csse.uwa.edu.au run help2002?p np opt U215 year 2019
You also note that the question has similar phrasing to questions 8, 10, and 1...
Making a new thread about this because I think it's worth getting to the bottom of the issue.
Question 20 is either an unexplained trick question or a mistake in the sample answers. I'd like to explain why I think it is, or should be treated as, the l...
well, not really sure about this either, but in my opinion it really comes down to technicality, since after the fork, the code doesn't terminate, so we can either call fork() again somewhere outside the function, or call the function more than one t...
I don't know what Chris had mind, it could be a trick question (note the 'always be true'). Suppose I write a complete C code with a main() and do not call this function?
I don't understand why the answer to question 20 was D, rather than C, is anyone able to explain?
Thank you )
(20) Consider the following C code
void function(void)
fork();
fork();
printf("hello world n");
If the above code ...
You can find this state in the diagram found in lecture 8, slide page 14,
or alternatively here https teaching.csse.uwa.edu.au units CITS2002 lectures lecture08 14.html
(10) Consider the following code which contains a common error
c
define N 10;
void function(void)
A) char array N ;
B) int x 2 N;
C) for(int i 0 ; i N i)
printf(" c n", array i );
Which of the follo...
I was also confused by this one. I understood that the suspend state was distinct from the ready state, and that when a processor in the ready state is moved into swap, it stops being in the ready state.
I didn't see the ready suspend thing ...
Not sure if I am correct but the reason why B (int x 2 10;;) is because it would take the second semicolon as an empty statement so it'll be read as
int x 2 10;
;
which would not affect the program itself but will just look weird and isn't good ...
Not OP but would it be because it depends on the bits (i.e. 32-bit or 64-bit) where 32-bit is 4 bytes per integer but something like 16-bit will give 2 bits so it'll be value of 200.
That's why the answer is B. Because the value byte of each object i...
First, I think C is also right answer because the question asks for "reason",and option C is the "result" caused by the fail.
Option D is correct because it presents a scenario that is not applicable to the fork() system call. Since fork() does not ac...
Wouldn't this mean that A and B are incorrect. Since we define N as 10; which includes the semicolon.
That means for A, Substitution char array 10; ; The semicolon causes a syntax error here.
For B, int x 2 10;; This results in a double semico...
(20) Which of the following is NOT a reason for the fork system call failing?
A. the user already has too many processes running.
B. The whole computer system has exhausted is available memory.
C. the value returned by fork is -1.
D. the parameter passed...
ANONYMOUS wrote
If the size of one integer was always 4 bytes, then the answer would be A) 400 bytes .
The C11 standard (nor any C standard) does not specify sizeof(int) to always be 4.
For what reasons might sizeof(int) not be 4?
Hi I have checked the practice test paper and there is no page 9 with solutions from the Mid-Semester test section. I am just wondering if it wasn't able to upload or it has been posted elsewhere?
Regards,
Hi, I was just wondering where I could find the solutions to the practice test, as it is mentioned that they would be released today on the mid-semester test information page.
Thanks in advance,
Jerry
https www.uwaquiz.com
you can enter this link and practice to get some clues on what to focus on and maybe focus on the lecture notes, I'm also glad to have some discussion and share tips together
ANONYMOUS wrote
It's certainly an error if you correctly perform the textual substitution for N .
A couple of students have asked if this is a trick question - not really, misunderstandings about how the preprocessor works are reasonably common....
Oh, I see, there's a semicolon after the N... oops. I'll be mindful of that in future.
When you say both your points, are you saying that for(int i 0 ; i N i) is valid syntax? Or are you talking about the response above mine?
Thanks for the res...
Line A is valid; the syntax char array N ; declares an array named "array" and allocates enough memory for N-many chars to be stored in the array, (see here (https www.geeksforgeeks.org c-arrays )).
There's definitely a syntax error in line C th...
ANONYMOUS wrote
Not the "Extra reading" links, as they're to daily and weekly news, blog, and review sites.
But the "Information resources" page will certainly assist.
Lecture 3.
The answer to this is not explicitly stated on a lecture slide, but readin...
The define preprocessor directive, when used as define pattern1 pattern2 , results in all later instances of pattern1 being replaced by pattern2 .
In this example, N is not a variable, and is not being initialised, but ev...
ANONYMOUS wrote
B) is certainly the correct answer. Yes, it's undoubtably defined in the (huge) standards document, but there is no requirement to read it to answer the question.
We've highlighted that C is quite a small language by contemporary stan...
Hi, I was wondering if the extra reading links on the unit schedule would be help us better prepare for the test coming up this Friday?
I've been having difficulty answering questions such as
(17) Operating systems started supporting multiprogramming ...
define N 10; being wrongly initialised, I think all of the above should be the correct answer, as it makes N 10, resulting in the error in other statements as well.
in light of adding clarity to the question, would it be fair to deduct that The C11 standard defines 29 standard header files, covering essential functionalities required for C implementations, as explicitly listed in the ISO IEC 9899 2011 specificat...
ANONYMOUS wrote
Not all assessed information comes from lecture slides, but you have been referred to information resources that introduce discuss the topic of the question.
All of the questions in this sample test have been taken from past tests.
It's...
Consider the following code which contains a common error
define N 10;
void function(void)
A) char array N ;
B) int x 2 N;
C) for(int i 0 ; i N i)
printf(" c n", array i );
Which of the following lines contains a syntax error?
A. Line A.
B. Line...
this is a question in the past exam
Roughly, how many standard header files are defined by the C11 standard
A. 10
B. 30
C. 100
D. 300
was this information accessible on the lecture slides?
and if so will these types of questions come out in the midsem?
jus...
The question is about the syntax error but initialising N has a syntax error itself.
i.e. define N 10;
Does option B, int x 2 N; , count as a syntax error?
This is the correct 'answer', thank you.
I wonder how why the OP has break statements in the posted question.
Perhaps they had been introduced by an IDE trying to be helpful by (incorrectly) anticipating what was coming 'next' ??
The code in the question doesn't have any breaks in the switch statement, remember that c has switch fall through by default, which should make the answer self evident.
ANONYMOUS wrote
You're right. I think there is a typo in the answer. None of the options are correct. However, there is one option that is very close to the correct answer. Can you see which one it is?
ANONYMOUS wrote
One place to the left means index - 1 .
e.g. If an integer is at index 3 it will be at index 2 after the code runs. Likewise, if an integer is at index 1, then after the code runs it will be at index 0.
I hope that makes sense.
for this question in the sample test
(14) Consider the following array declaration
int arr 20 ;
Which of the following code fragments moves all the integers in index positions 1 through
5 inclusive one place to the left to index positions 0 through 4 i...
Full details here https teaching.csse.uwa.edu.au units CITS2002 examinations.php
The page also includes a link to a sample mid-semester test paper.
Good luck,
You can find all details about the test here - https teaching.csse.uwa.edu.au units CITS2002 examinations.php
A sample test paper coming later this morning.
I just watched the lecture today and heard the mention of mid-sem exam with 20MCQ. I'd just like to ask what topics it will cover. Will it only be lectures or will it include workshops and labs (I saw one of the other help questions where it was ment...