VS2010 C++ CST 280 Program 8 and Week 12 and Assignment 11b - 53631

Solution Posted by
jordanblink

jordanblink

Rating : (19)A+
Solution Detail
Price: $40.00
Request Description

Prograqm 8

Purpose

This program will provide an opportunity to build an application that utilizes a linked list data structure.

Specifications

Write a program to manage a list of computer-related problems for a help desk application. This will be a file-driven program that involves addition to and deletion from a linked list of "problem" objects.

Create a class to store one Problem. Data members should include:

  • Problem Code (a code definiting the type of problem)
  • Criticality (a 1...5 integer designation of the level of importance of the problem: highest: 1, lowest 5)
  • Date (a calendar date object using the provided class used in the course)
  • Contact (string containing name of person initiating problem)

Three files of problems are included for this solution. The file format is:

117,3,12/11/2013,Marilyn,Hanna

defined by

problemcode,criticality,month/day/year,firstname,lastname

Assume scenario that includes a current list of problems, a list of problems recently solved, and a third list of new problems not yet tasked. The three files are:

problems.txt
newproblems.txt
resolvedproblems.txt

In addition, a file is provided that allows the problem code to be decyphered to a specific problem description:

problemlist.txt

Define a class (assume named ProblemList) that has-a ordered linked list of Problem objects as a member (bad grammar intentional). Use of an "templated" ordered linked list does imply that the data type used in the template enables ordering (i.e. defines the < operator among others). Be sure to overload the operators necessary for this feature. Your problems will be ordered within the list by priority code and date. For any two problems having the same criticality level (1 being highest), declare the problem having the earliest date as the higher priority.

Your overall object oriented design should allow you to practice abstraction and limit you driver program to the following (assuming your class is called ProblemList):

ProblemList problems("problems.txt");
ProblemList newProblems("newproblems.txt");
ProblemList solvedProblems("resolvedproblems.txt");
 
problems += newProblems;
problems -= solvedProblems;
problems.writeTop(25);
problems.writeBottom(25);

In addition to other features, this solution implies overloading operators <, ==, and != for your Problem class
and += and -= for your ProblemList class.

Finally, your output should be a list of problems to solve (the top 25 in the list) and the problems that you'll not likely ever get to (the bottom 25). Therefore, include two member functions of your ProblemList class: writeTop(n) and writeBottom(n). These will list the n Problem objects at the top of the list and the n objects at the bottom, respectively.

Your lists could be a simple sequential listing like the following.

Priority  Submitted     By       Description
   1      4/25/2013  Jane Doe    Hard drive crash
   ... and so on down the list in order ...

File needed: orderLinkedList.h (Hint: There should be no need to change the linked list class for this solution).

USE COMMENTS!!!a

Deliverables

Deliver the following as your final product:

  • Cover page with assignment name, student name, and list of attachments
  • Printed copy of all final source code files (.cpp and/or .h files) created in your program
    (you may omit any use of unchanged source code from the course materials)
  • Printed output using the provided input files

 

------------------------

Assignment 11b

CST 280 2 pts

In-Class Assignment 11b

Assume the following list of elements (ordered alphabetically) are inserted into a binary

search tree in the given sequence.

H C R A S Q B F Z M D X

a) Sketch the initial resulting binary search tree:

b) Referring to the tree in (a) describe the sequence of "visits" to nodes as the

tree is traversed in:

PreOrder:

InOrder:

PostOrder:

c) Sketch the tree after all of the following changes are made (assuming the

strategy for deletion is used that was discussed in class):

Insert G

Delete Q

Insert I

Insert Y

Delete R

Delete H

Delete C

Insert H

Tree from part (c):

d) Referring to the tree in (c) describe the sequence of "visits" to nodes as the

tree is traversed in:

PreOrder:

InOrder:

PostOrder:

e) Access the following files from the course web page: binTreeType.h,

and text file testTree.cpp. Verify your results using the tree class

presented in class.

 

Deliverables: This page, your source code and output.

-----------------------

Week 12

CST 280 In-Class Practice – Week 12

Access the following files from the course Week 12 practice file access page

(using code bn23):

binTreeType.h

depthAnalysis.cpp.

Add following functions to the tree class treeDepth()and getDepth().

template<class ItemType>

int BinTreeType<ItemType>::treeDepth()

{

return getDepth(root) - 1; // Subtracting root as level zero

}

// Private function checking maximum depth below current node

template<class ItemType>

int BinTreeType<ItemType>::getDepth(TreeNode* tree)

{

if (tree == NULL)

return 0;

else

{

// Get depths below current node

int leftDepth = getDepth(tree->left);

int rightDepth = getDepth(tree->right);

// Return max depth of subtrees plus one for "this" node

if ( leftDepth > rightDepth)

return leftDepth + 1;

else

return rightDepth + 1;

}

}

The provided driver program depthAnalysis.cpp will demonstrate typical tree

depths based on the number of nodes entered. This program generates a variety of tree

sizes using random integers before returning the maxium depth of the tree.

Deliverables: The source code and output.

Solution Description

VS2010 C++

Attachments
CPPBinaryTreeWeek12.zip
CPPBinaryTreeWe...
CPPCST280_11b.zip
CPPCST280_11b.z...
CPPHelpdesk.zip
CPPHelpdesk.zip
Help Desk Application.zip
Help Desk Appli...