[Solved] CS240 Introduction to Computing III mp03 (templates)

$25

File Name: CS240__Introduction_to_Computing_III_mp03_(templates).zip
File Size: 499.26 KB

SKU: [Solved] CS240 – Introduction to Computing III mp03 (templates) Category: Tag:
5/5 - (1 vote)

5/5 – (1 vote)

Objectives

▪ To make use of class and function templates

▪ To use pointers and dynamic memory management

Project setup

Create the project mp03.<FirstLast>. Replace FirstLast with your name and do not include the <> brackets. For instance, mp03.SocratisTornaritis.

Add the provided files to your project:

main.cpp

Name.hpp, Name.cpp

ArrayList.hpp, ArrayList.cpp

The folder mp03.Firstlast containing just the source file(s) and text file(s), is the one that you must zip and upload. Do not upload any IDE specific files.

Refer to the appropriate how to tutorial notes available on the course website, for instructions on how to create a project and manage its files.

Problem description:

This mp has two parts to it. The first is to rewrite the ArrayList example we did in class and change the array elements to Name elements, rather than Name * elements. The second is to convert the ArrayList class to a template and implement the <<() function as a template.

Original list: [John SmithTobby AppleseedMary Appleseed]First name: John SmithIs John Smith before Tobby Appleseed alphabetically? NoCopy list: [Mary PoppinsTobby AppleseedMary Appleseed]Original list: [John SmithTobby AppleseedMary Appleseed]

1 / 2 Last updated: September 28, 2016 at 7:05 AM

Program requirements:

  • Complete the implementation of the Name

Implement the relational operator methods and <<() function. Refer to class examples.

  • Update the interface file for the ArrayList

Update the ArrayLists declaration to reflect the new element type, which this time is a Name object, rather than a Name *.

  • Implement the class inline.

An inline implementation means that the class declaration is now also the class definition. Copy the relevant code from the implementation file into the interface file. When finished, it will look very much like a Java class implementation, all in one basically. Refer to class example for details.

  • Remove the ArrayList implementation file from the project.

Since we are using inline methods, remove the .cpp file from the project, else you will run into compilation errors.

  • Now make the ArrayList class into a template. Turn the ArrayList into a template.

As you write your programs from here on out, documentation will be desirable and an essential part of your code. Add the following section to each of your programs to identify relevant information to anyone reading your code. The sample below is what I used for Main.java, so make the appropriate changes to reflect your current/accurate information. This is just a sample, so feel free to add to it if you want, but do not remove anything.

/* File: <filename>

  • Name: <your name>
  • Revised: <date authored>
  • Course: CS240 Introduction to Computing III

*

  • Desc: <program description>

*/

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CS240 Introduction to Computing III mp03 (templates)
$25