I just want to  main call (It is only one question) Look at the code below. You have four classes (O, X, T, and M) and a variable of each of these. O o; X x; T t; M m; The following assignments are all legal (assume that they all compile): m = t; m = x; o = t; The following assignments are all illegal (they cause compiler errors): o = m; o = x; x = o; What can you say about the relationships of these classes? Draw a class diagram. Main (I want the complete solution using the codes in bluej program also diagram) bluej java cood

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

I just want to  main call

(It is only one question)

Look at the code below. You have four classes (O, X, T, and M) and a variable of each of these.
O o;
X x;
T t;
M m;
The following assignments are all legal (assume that they all compile):
m = t;
m = x;
o = t;
The following assignments are all illegal (they cause compiler errors):
o = m;
o = x;
x = o;
What can you say about the relationships of these classes? Draw a class diagram.

Main

(I want the complete solution using the codes in bluej program also diagram)

bluej

java cood

 

4. Look at the code below. You have four classes (O, X, T, and M) and a variable of each of these.
0 0;
X X;
Tt;
Mm;
The following assignments are all legal (assume that they all compile):
m = t;
m = x;
o = t;
The following assignments are all illegal (they cause compiler errors):
o = m;
0 = x;
X = 0;
What can you say about the relationships of these classes? Draw a class diagram.
Transcribed Image Text:4. Look at the code below. You have four classes (O, X, T, and M) and a variable of each of these. 0 0; X X; Tt; Mm; The following assignments are all legal (assume that they all compile): m = t; m = x; o = t; The following assignments are all illegal (they cause compiler errors): o = m; 0 = x; X = 0; What can you say about the relationships of these classes? Draw a class diagram.
Expert Solution
steps

Step by step

Solved in 4 steps with 8 images

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning