Mock Midterm Exam for CSE 1302C.docx

advertisement
Mock Midterm Exam for CSE 1302C
Question 1: Arrays



Declare a 2D array of 2000 by 2000 integers
Initialize each slot to a random number
Find the minimum element in the 2D array
Question 2: OOP


Create a class called Email that has a recipient, a subject and a body. Create an appropriate
constructor as well as an accessor and modifier for only one of the attributes. Then, create a
method called “Print” that prints each attribute to the screen.
In Main, create an instance of an email. Then, tell that email to Print.
Question 3: What’s the difference between Inheritance and Polymorphism?
Question 4: Create a List of Emails (from Question 2) and then add an Email to it.
Question 5: Draw a UML diagram that does something (of course, this wouldn’t be worded this way, but
whatever).
Download