Home » Computer Science Question

Computer Science Question

CSCI 270-01-Assignement – 2: Abstract Base Class and MultipleInheritance
(70 points)
Due October 31, at 11:55 pm
Part 1: Multiple Inheritance (40pts)
Exercise 1 – Class Date (14pts)
1. (4pts)Create a class named Date with the following protected attributes:
int day;
int month;
int year;
2. (4pts)Implement the constructors with and without parameters of the class Date.
3. (6pts)Implement the getters and setters of the class Date.
Exercise 2 – Class Time (14pts)
1. (4pts)Create a class named Time with the following protected attributes:
int hou;
int min;
int sec;
2. (4pts)Implement the constructors with and without parameters of the class Time.
3. (6pts)Implement the getters and setters of the class Time.
Exercise 3 – Class DateTime (12pts)
1. (2pts)Create a class named DateTime that inherits from the classes Date and Time. The
access specifier for the classes Time and Date is public.
2. (4pts)Implement the constructors with and without parameters of the class DateTime.
3. (2pts)Implement the function showDateTime that displays the date and time.
4. (4 pts)Test your code by creating two objects of type DateTime; the first object using the
constructor without parameters and the second object using the constructor with
parameters.
Display the date and time of the two objects by calling the function showDateTime.
Example of the output of the function showDateTime for the two objects
1/1/1900 0:0:0
02/25/2009 6:20:55
1
Part 2: Abstract Base Class and Pure Virtual Functions (30pts)
Exercise 1
1. (3pts)Create an abstract base class named: Shape. The class Shape contains a public pure
virtual function named display();
2. (3pts)Create another class named: Rectangle. The class Rectangle contains the following
private properties:
double width;
double length;
3. (4pts)Implement the constructor with and without parameters of the class Rectangle.
4. (4pts)Implement the getters and setters of the class Rectangle.
5. (2pts)Override the function display of the class base Shape to display the length and width of
the Rectangle.
6. (2pts)Create another class named: Cube. The class Cube contains the following private
property:
double height;
7. (4pts)Implement the constructor with and without parameters of the class Cube.
8. (2pts)Implement the getters and setters of the class Cube.
9. (2pts)Override the function display of the class Rectangle to display the length, width and the
height of the Cube. Do not forget to call the function display of the class Rectangle.
10. (4pts)Test your code by creating two objects:
A Rectangle r1 of width = 5 and length = 9;
A Cube c1 of width = 4, length = 7, and height = 10;
Display the dimensions of the rectangle r1 using the function display.
Display the dimensions of the cube c1 using the function display.
2

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your essay today and save 30% with the discount code ESSAYHELP