1 (a) Design a Complex abstract type, whose values are complex numbers. Equip your abstract type with operations such as magnitude, complex addition, complex subtraction, and complex multiplication. (b) Suggest an efficient representation for your abstract type.
2 (a) Design a Date abstract type, whose values are calendar dates. Equip your abstract type with operations such as equality test, comparison (‘‘is before’’), adding or subtracting a given number of days, and conversion to ISO format ‘‘yyyy-mm-dd’’. (b) Suggest an efficient representation for your abstract type.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here