Question: Write C++ code that have the exact same output. please spearate as periodic_table.cpp, Element.h, and get_table.cpp ========================================================================================================================================================================================================================== // Element.h #pragma once #include using namespace std;

Write C++ code that have the exact same output. please spearate as periodic_table.cpp, Element.h, and get_table.cpp Write C++ code that have the exact same output. please spearate as

==========================================================================================================================================================================================================================

// Element.h

#pragma once

#include

using namespace std;

struct Element {

int atomic_number;

string name;

string abbreviation;

double mass;

};

Description Write a C++ program to dynamically read into memory a periodic table from a file. Each element will have an atomic number, a name, an abbreviation, and a mass. Your program must include: 1. An Element structure is defined in a header file: Element.h 2. A function get table that will return a pointer to array of pointers to the elements and the number of elements (size) read from the file /user/tvnguyen7/data/periodictable.dat via a call by reference parameter. This function must read in the data by constructing a linked list and convert the linked list into an array of pointers. The prototype for this function is included in the Element.h file. Return NULL on error conditions 3. A main program that will sort the table using the element name and print out the elements name in alphabetical order. See required I/O. You can use qsort in cstdlib. 4. Dynamic memory must be allocated and deallocated properly Required I/O Name Abr ANo Mass Helium Hydrogen Lithium 2 4.00 1 1.01 Li 3 6.94 He all the elements Ununoctium The average mass - Mask Uuo 118 0.00 24.31

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!