kaist-cp / cs220

268 stars 53 forks source link

Questions about midterm #410

Closed jakobsteinke closed 1 month ago

jakobsteinke commented 1 month ago

Related Issue

-

Googling Result

-

ChatGPT Result

-

Your question here

Hello, I have some questions regarding the midterm:

  1. Did I understand it correctly that we can compile all our solutions in part 2 of the exam and even write test cases by using the code server?
  2. For 10 point questions that consist of sub questions, do we also get 0 points in the other subquestions when we make a mistake in one subquestion?
  3. how much time do we have for the entire exam and can we instantly start with part 2 when we are finished with part 1?
  4. how should we know all the imports (because we are asked to always specify what we import via use std::…)?
  5. Ownership is mentioned in some chapters that we covered in class, but we will cover the official Ownership chapter after the midterm, so is Ownership completely irrelevant for this exam? Content questions:
  6. 29838E5B-B5E8-400E-B263-1FE807D5A085 This code compiles but fails at runtime, so would the answer be true?

  7. E550FF1E-B7AB-4404-9025-DCB5B4798528 is true correct?

  8. E2A77E5D-C76B-4D5F-B17B-129E9F622054 is true correct?

  9. 58107B5C-2F79-4531-AF43-7FA1BEF56B27 is false correct?

  10. 31AD74FB-44D0-46AA-B7F4-91BFE7903315 How can we solve this without using a bool flag that indicates whether or not an opening single quote occurred (since we can only edit the todo part)? Thanks in advance! (Sorry for the amount of questions)

Lee-Janggun commented 1 month ago
  1. Yes.
  2. I assume you are asking about part 2; there may be partial points. E.g., 3 test cases, if you get the first two, 4 points out of 10.
  3. Please read https://github.com/kaist-cp/cs220/issues/407
  4. You really won't need to know more than what is already imported.
  5. No, ownership won't be asked in the midterm.
  6. For the TF, I'm not going to answer them, you can double check with the slides/just try it out yourself. Although for TF 27, the recommended thought process is to think about if there is any branch that may not terminate. For the parsing shell command, this is a HW question, so I won't answer in detail. A way is to use a current arg as a double for a current arguemnt and boolean flag.
jakobsteinke commented 1 month ago

Thanks for the answer! "A way is to use a current arg as a double for a current arguemnt and boolean flag", could you elaborate on this? (In the homework it was possible to just use a bool flag outside the loop, but as I am only allowed to fill out the todos, that approach doesn't work anymore)

Jaewookim08 commented 1 month ago

The purpose of the problem was to determine if you can implement the homework task without using a boolean flag. The idea is to embed the information that indicates whether the opening single quote has occurred into one of the existing variables (both current_arg and args can be used for this). There are various ways to embed this information, which I will leave up to you. The code should later remove the embedded information to return the correct results.