Write program using data abstraction to track stock market

Assignment Help C/C++ Programming
Reference no: EM131978355

Topic: C++ Assignment

You have decided to write a C++ program using data abstraction to help you keep track of the stock market. You want a program that will quickly allow your users to find out very quickly about a stock or mutual fund.

The information about each stock or mutual fund that you want to keep track of is:

  • ticker symbol (e.g., IBM for International Business Machines)
  • stock or fund name (e.g. International Business Machines)
  • share price (e.g. 25.73) (this should be stored as an int, not as a float or a double)
  • Date of that share price (e.g. May, 23, 1967)

You will implement this as a hash table. You will use linear probing for handling collisions. This means that if you have a collision when inserting a new item, you will search the table in order of increasing indices until you find the first empty slot and insert the new item there. You will treat the table as a circular array, so if your search takes you "off the top" of the table, you will continue looking for an empty slot at location zero.

An attempt to insert a stock into the hash table can fail for one of two reasons:

  • the stock is already in the hash table
  • the hash table is full (i.e. no more empty slots)

Your code will need to handle this condition by indicating failure when requested to insert a stock which is already there, or for which there is not room.

It is required that the functions HashMap::get(), HashMap::put(), and HashMap::remove() use hashing and linear probing. Do not just do a linear search in the array. Doing so will result in a severe loss of points.

The function HashMap::hashStr() should be coded to be as fast as possible and to not do unnecessary work as it computes the hash value for a string. Getting this right is non-obvious, and will be an important factor in your grade for this assignment.

The share price is required to be stored as an int (representing the number of cents, not dollars). You should not use any floating point techniques for either storing or printing out the share price.

Your code needs to produce output that's identical to the contents of asgmt03.correctOutput.txt (except for minor differences in whitespace). You will need to use I/O manipulators (defined in <iomanip>) in order to format the printed output properly.

In the printed output, "hc" is the label for what your function returned as symbolHash, "hi" is the label for hashIndex, "ui" is the label for usedIndex, and "sl" is the label for the linear probe sequence length. The driver code takes care of printing all of this. Your code just has to return the appropriate data.

Attachment:- Assignment Files.rar

Reference no: EM131978355

Questions Cloud

Discuss the ethical dilemma jack faces : In 1 and 1/2 double-spaced pages discuss the ethical dilemma Jack faces. What is the issue? Who are the parties involved?
Indicative of normative influence : Imagine that some researchers conducted a study and interpreted the results of the study as indicative of normative influence.
Each machine have equivalent profit or loss : At what quantity does each machine have an equivalent profit or loss?
Name two positive outcomes of the growing pains : Name two positive outcomes of the growing pains developing nations go through in the transition to "industrialized" status, as well as two negative outcomes.
Write program using data abstraction to track stock market : Topic: C++ Assignment. You have decided to write a C++ program using data abstraction to help you keep track of the stock market
Equipment book value at the end of the project life : Create the depreciation schedule of the equipment. What is the equipment’s book value at the end of the project’s life?
Different from the general dictionary of learning : What makes it different from the general dictionary of learning? Why is it considered important to psychologists?
Ideas about human behavior and development : Describe the key ideas about human behavior and development for each of the five identified major perspectives in psychology.
What effect will this have on cash flows to equity : The entire principle was repaid at the end of year 10, what effect will this have on cash flows to equity? Explain

Reviews

len1978355

5/10/2018 5:19:07 AM

Topic: C++ Assignment. Detailed Question: This assignment needs to be performed on Linux. Required Submission File Structure - Do not change the structure of your project directory in any way. Do not rename files, add new files, or delete files. I grade your code using a Bash script that depends on files being in predictable places. Nothing in this assignment requires files to be moved, renamed, deleted, etc.

len1978355

5/10/2018 5:19:01 AM

Printed Output - Your code's printed output needs to be identical to the contents of the "correct output" file(s) provided as part of this assignment. "Identical" means the Linux utility diff will find no differences between your code's output and the provided file, when called with flags: -w -B. This means that the sequence of non-whitespace characters in your output has to be identical, but that differences in whitespace will be ignored.

len1978355

5/10/2018 5:18:56 AM

You are still required to produce output that lines up with itself properly. Columns may need to line up, numbers may need to be right-justified, etc. You should look at the "correct output" file(s) to see what you need to do. Each item sets the named data member to the value in the parentheses. In the SomeClass constructor above, each of the two initialization list items sets its data member to the constructor argument named inside the parentheses. This is weird-looking syntax, but it is standard usage in the culture of C++.

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd