.. (לתיקייה המכילה) | ||
Which lecture and tutorial slides are required to HW3? | |
החומר הדרוש לכל חלק: - חלק א': בשביל להתחיל צריך אופרטורים (תרגול 9, מצגת הרצאה 8), בשביל לסיים צריך חריגות (תרגול 10, מצגת הרצאה 11). - חלק ב': בשביל להתחיל צריך ירושה ופולימורפיזם (תרגול 11, מצגת הרצאה 9), בשביל לסיים צריך תבניות (תרגול 10, מצגת הרצאה 10). - חלק ג': בשביל להתחיל צריך לסיים את חלק ב' (תרגול 11, מצגת הרצאה 10), מותר להשתמש ב-STL (תרגול 12, מצגת הרצאה 10) אבל אפשר גם לפתור בלי. - חלק יבש: צריך STL (תרגול 12, מצגת הרצאה 10). |
האם מותר להשתמש במחלקה string.h | |
You are allowed to use std::string, it is not part of the STL. |
בהנחיות התרגיל ישנה התיחסות למקרה שבו מוסיפים ל-EventContainer כמה אירועים באותו תאריך, אבל לא למקרה שבו מוסיפים כמה אירועים באותו תאריך ובאותו שם. | |
An EventContainer can contain two events with the same date and the same name. In such cases, it does not matter which of the two events comes first - both options are valid. Notice that unlike EventContainer, in partC an instance of class Schedule cannot contain two events with the same date and name. Trying to add an event with the same date and name as an existing event will result in a EventAlreadyExists exception in Schedule::addEvents. |
האם ניתן בסעיף ב' להשתמש בpq מסעיף 1 דרך extern C ? | |
Nice question, but the answer is no, as it would not compile properly with the compilation commands provided. |
שלום רב | |
The required comparison operators are symmetric in the sense that both operands are DateWrap objects, so the operator should compile and work correctly even if the operands are swapped. You need to decide if the operators should be implemented as member functions or external functions. P.S. "Operand" is an argument to an operator. For example, in 2 + 3 the operator + has two operands: 2 and 3. |
in part A we are not told to implement a destructor, how would the function know to call date destroy if we don't add it to the methods | |
As stated in the PDF, you are allowed to implement new methods and even new classes, beyond those that the exercise requires. |
כאשר מעמיסים אופרטור כלשהו, שלא משתמשים בערך החזרה שלו למשל ++,+ | |
As you learned (or will learn) in class, the accepted way is to make these kind of operators "chain-able". I.e, (a++)++ and (a + b) + c and even (a += b) += c should all compile successfully. If you define the operators to return void, then they won't be chain-able, and there's a chance you will lose points. |
האם במתודה clone במחלקה closeEvent צריך לשכפל גם את רשימת המוזמנים? | |
Yes. You need to return an object with equivalent content to the original. |
Just so I know we are on the same page about when to throw the "InvalidDate" exception - | |
Yes, exactly the same as in exercise 1. The year can even be 0 or negative. |
האם יש לעצור את התוכנית לאחר כל חריגה? | |
In this exercise, some places are required to throw exceptions in case of error. It is the responsibility of user to decide how to respond to these exceptions, not yours. |
האם ניתן ומותר לממש אותה ע"י מערך בגודל 20 אלף? | |
You suggest creating a 20000-sized array for each event instance, regardless of how many participants the event really has. Theoretically the solution will work, but is very wasteful - both in memory and running time (when the array is copied). This solution will not be accepted. |
האם זאת דרישה לממש מעטפת לDate, או שניתן לממש את הקלאס מחדש ללא שימוש בDate? | |
Yes, you must use the Date ADT. Learning how to integrate with existing C code is part of the exercise. Yes, you should also use std::bad_alloc where appropriate. |
מתי אירועים נחשבים שווים, והאם אפשר להכיל שני אירועים שווים? | |
הקונספט של "שוויון אירועים" רלוונטי רק לחלק ג ולמחלקה Schedule. מבחינת Schedule, שני אירועים הם שווים אם ורק אם יש להם שמות זהים ותאריכים זהים. שאר המאפיינים של האירועים אינם חשובים. אובייקט Schedule לא יכול להכיל שני אירועים שווים. במתודת addEvents של מחלקת Schedule, אתם יכולים להניח שהקלט לא יכיל שני אירועים שווים. באופן כללי, EventContainer יכול להכיל אירועים שונים בעלי שמות זהים ותאריכים זהים. לגבי סדר הדפסה, אם יש שני אירועים בעלי שמות זהים ותאריכים זהים, אז זה לא חשוב איזה מביניהם יודפס קודם - שתי האופציות יתקבלו. |