Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Qeiction I Nete: As for questiom (a) dhare the diagrum in dhe antwer boolifer provided. An for queations (b) and fod. modloy the same pregnam,

image text in transcribed
image text in transcribed
Qeiction I Nete: As for questiom (a) dhare the diagrum in dhe antwer boolifer provided. An for queations (b) and fod. modloy the same pregnam, progriml. \&P?: Given a Ct+ program naned pregramb.cpp that contains four classes named Courae, Instructor. Texteook and Name, respectively. Analyre the program and answer the following question: a. Draw the UML elass diagram based on the implementiation of all the classes in programl.epp. (10 marks) b. Define a C++ template for a class named Array to store an array of object iterns in the same program program1.cpp. The detail specifications of the class are as follows: i. Store the items in a vector. ii. Define a method named a del () to add a new item (passed as a parameter) to the array. iii. Define a method named getitern () that returns an item based on the index. passed as parameter to the method. iv. Define a method named print () to print all the items of the array. (15 marks) c. Test the template in the main function of program1.cpp by accomplishing the following tasks. See the expected output in Figure 1 (see next page). i. Create an array of instructors using the template and print all the items of the array. ii. Create an array of textbooks using the template and print all the items of the array. iii. Create a Course object with the following data and print the object. Title: "Programming Technique II" Instructor: the first item of the instructor array, created in c(i). Textbook: the second item of the textbook array, created in c(ii). Figure 1: Expected ouput on prugr

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions