Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your task is to construct a program that will serve as lookup for each item in the periodic table. You should provide functionality that will

Your task is to construct a program that will serve as lookup for each item in the periodic table. You should provide functionality that will allow a person to search by either element name of element number. You should construct a simple menu that will allow a person to select what they want to lookup the element by. The output of your program should be Atomic number, Symbol, Element name, atomic weight.
Specifics.
You are to create an AVL Tree that will hold the Name, Atomic Number, and Atomic weight for each value in the periodic table. Your AVL Tree should be constructed as a class and be generic so that any data type can be used. You should have another class called ElementLookup (non generic) that will load the elements from the csv file into the tree and provide the necessary functionality to lookup the element. The relationship between the AVLTree and the element lookup should be one of composition. In other words the ElementLookup class is composed of the AVLTree class.
AVLTree - The node of the AVLTree should not be modified to hold specific information about the periodic elements. What this means is that you will have to create a class or a struct to hold this information inside the AVLTree.
ElementLookup - This class will read and parse the csv file into the tree. Using an AVLTree will assure that it is balanced.
You should not use any absolute paths when reading the csv file. You simply need to put the csv file into the correct project folder so that only the name of the file without any path is used.
The lookup method / function should return a string that contains the information in the following format:
Atomic Number: 1, Name: Hydrogen, Symbol: H, Atomic Weight: 1.00797

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

Students also viewed these Databases questions

Question

How to solve maths problems with examples

Answered: 1 week ago