Discount Get GSP 295 ALL WEEKS Solution ONLY $104.95 $139.93
GSP 295 Week 1 - A Simple ADT [$19.99]
GSP 295 Week 2 - Sorted List Lab [$19.99]
GSP 295 Week 3 - Palindromemordnilap [$19.99]
GSP 295 Week 4 - Horacious Glump [$19.99]
GSP 295 Week 5 - Simple Cipher [$19.99]
GSP 295 Week 6 - Graph ADT [$19.99]
GSP 295 Week 7 - Dijkstra [$19.99]
Get Selected Weeks Solution with ONLY NOT Add Selected Tutorials To Cart
GSP 295 GSP295 GSP/295 - Week 4 - Lab 4 - iLab 4 - Horacious Glump - The first part of the new ride system involves mapping names to ride numbers. To accomplish this you will use a hash function to convert a string into a numerical value.
    GSP 295 GSP295 GSP/295 - Week 4 - Lab 4 - iLab 4 - Horacious Glump - The first part of the new ride system involves mapping names to ride numbers. To accomplish this you will use a hash function to convert a string into a numerical value.

GSP 295 GSP295 GSP/295 - Week 4 - Lab 4 - iLab 4 - Horacious Glump - The first part of the new ride system involves mapping names to ride numbers. To accomplish this you will use a hash function to convert a string into a numerical value.

$19.99

Deliverables

A single zip file including the following.

  • Your Visual Studio Project directory and associated files, including source files for the Lab.
  • The results of your testing. What tests did you run? Did everything work okay? Are there outstanding issues in your program? A short half-page summary of your results is about the right length.
  • Your answers to the Part 4 Lab Questions.

If you document any issues, it will be easier to isolate any problems, provide detailed help, and could potentially improve your grade.

Summary

It is the year 2025 and the new children’s literary masterpiece, Horacious Glump has been a huge entertainment success. You have been contracted to help create the new Horacious Glump theme park ride for a very popular theme park in Florida. You have devised an ingenious new system for park visitors to visit the new ride. In this Lab, you will design a proof of concept system to demonstrate the ingenuity.

Understanding the System

This Lab requires a bit of custom hybrid implementation; taking concepts from the textbook and implementing them but with some modification. Be sure to allocate sufficient time to complete the lab.

The new system envisioned is as follows.

  • Park visitors will register at a kiosk if they want to ride the new theme park ride.
  • Visitors will give their full names.
  • The Horacious Glump system will hash their names to a particular ride number.
  • Visitors will then be placed in the queue for the ride number.
  • At each time interval all rides will run simultaneously.
  • At the end of the ride the first person in each ride queue will be removed.
  • There will be seven rides in the system for the prototype
  • Each ride queue holds a maximum of three people for testing.

Part 1: Mapping Names

The first part of the new ride system involves mapping names to ride numbers. To accomplish this you will use a hash function to convert a string into a numerical value.

Recall that great time and care must be taken to choose a good hashing function; however, because this is merely a prototype system, you may use the simple hash function given below:

  • Implement the hash function within your Horacious Glump ride class. 
  • Create a test driver that asks for a name from the user and outputs the ride number that it maps to. 

Consider “hashValue %= hashSize” line of the hash function. What is the purpose of this line?  What would happen if it were removed?

Note: You do not need to submit this test driver function. It is merely for you to verify Part 1 functionality before moving on.

Part 2: Creating a Queue

A queuing system will be needed to complete the implementation. Using the ADT described in the textbook, implement a FIFO Queue that holds strings. For the purposes of this activity, the maximum queue size should be 3.

You will need to implement one additional operation in your queue to support your test driver:  a display function.

Note: You cannot use already existing stack and queue operations or include files. You must implement the ADT using basic data structures (arrays or linked lists).  You may, however, use your ADT list that you created earlier in the course to help you. However, your insert and delete queue operations should be O(1) so you may need to modify your list ADT.

Important: Be careful with ‘edge’ or ‘border’ cases. For example, what happens when you remove an item and no items are present? What happens if an item is added to a queue that already has the maximum elements? Your program should not break in these conditions!

Part 3: Implementing a Test Driver

Step 1) Initialize the System

Create a test driver with a main function. This driver should automatically setup the system initialization as follows.

  • Create a new hash table of size 7 for the 7 rides.
  • Create a new queue in each of the 7 hash table positions.
  • Each queue should have a maximum size of 3.

Step 2) Basic Test Commands

Create a test driver menu system similar to those for the Week 1 and Week 2 Labs. You are welcome to implement any test commands to help you verify your queue and hash table system. In addition to any of these, you are required to have the following commands.

  • Add Person
  • Prompts for person’s name
  • Hashes their name to a queue #
  • Inserts the person into the queue
  • Print a confirmation to the user
  • Be sure to output a message if the queue is full
  • Run System
  • Prints a confirmation to the user (“Ride Running…..”)
  • Removes the first person in the queue in each queue.
  • Displays the name of each rider and their queue #.
  • Be sure to output a message if a queue is empty
  • Find Length of Wait
  • Prompts for a person’s name
  • Hashes the name to a queue #
  • Outputs the current size of the queue this person would be placed in
  • Display System
  • Outputs all 7 queues in the system and for each queue the exact order that each person is within the queue
  • A simple format is sufficient, for example:

Queue #0

  • Marty Smith

Queue #1

  • Frank Jacobson
  • Roy Laop
  • Tony Ramno

Queue #2

<empty>

Queue #3

<empty>

Queue #4

  • Julie Frank
  • Bob Goldson

etc…

Part 4: Lab Questions

Consider and answer the following questions in brief in your Lab write-up.

  • Consider the last line of the hash function from Part 1. What is the purpose of this line? 
  • What would happen if it were removed?
  • Assuming it was possible to add a very large number of rides (increase the hash table size higher than the number of visitors to the park), what would be the average Big-O run-time complexity of adding a person to the system? 
  • In the large rides condition of question 2, what is the average Big-O run-time of finding the wait time for a person? 

All rides are run in parallel rather than one ride at a time (despite the opposite being true in your simulator). On a parallel system, what is the Big-O run-time in the large rides condition of question 2?

General iLab Comments

All coding assignments for this class will be using Microsoft Visual Studio. This is available through the Software Store, which can be found in Course Home. Contact the help desk if you encounter any issues or contact your professor.

*Please note as a reminder that you may not copy code from any web reference to complete this assignment, even if you correctly give credit. You may of course use web references to help you understand, but you must code the assignment yourself. You may use code directly from your textbook where applicable, but do make sure you give credit in your comments if you are doing so.

Here is solution for GSP295 - Week 4

It is 100% correct.

Solution contain Visual Studio C++ project and document answer all questions.

If you have more questions, please contact me via email support@extutorials.com

I will help you any time

Thank you very much

Attached Files

Move over [ preview ] file name to preview content in it!

Write a review

Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:



PURCHASE SAVE
2 Tutorials 10%
3 Tutorials 13%
4 Tutorials 16%
5 Tutorials 19%
6 Tutorials 22%
7 Tutorials 25%
8 Tutorials 28%
9 Tutorials 31%
10 Tutorials 34%
add url more

9MZQASHWN73B