It's UWAweek 17 (1st semester, week 8)

help2005

This forum is provided to promote discussion amongst students enrolled in CITS2005 Object Oriented 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.

How do I ask a good question?
Displaying the 2 articles in this topic
Showing 2 of 89 articles.
Currently 1 other person reading this forum.


 UWA week 17 (1st semester, week 8) ↓
SVG not supported

Login to reply

👍?
helpful
11:22am Tue 23rd Apr, Zhiyang X.

Sorry for the wrong tag.


SVG not supported

Login to reply

👍?
helpful
3:46pm Tue 23rd Apr, Andrew G.

"Zhiyang Xu" [email protected] wrote:

Hi, Professor:

I am doubt about that if there are two same sets like {5} and to make a union, is it ok to describe as "({5}) U ({5})".

Thank you.

The assessed lab worksheet provides instructions on how describe() should behave for each different class. It does not ask you to simplify or reformat expressions. To do so would in fact be considered wrong, as it is no longer a description of the expression, but of a different (even if equivalent) expression. There is no need to invent extra tasks for yourself that do not exist in the worksheet.

I assume it is a typo, but the example you have given is incorrect. The specification says that singletons should be formatted as "{x}" and unions as "(A U B)", so the union of a singleton 5 with a singleton 5 would be "({5} U {5})" (without the inner parentheses that you wrote).

Hope that helps.

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  5:07AM Sep 06 2023
Privacy policy