Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this lab, you will implement a program that can output information about any element in the periodic table of elements. Requirements Read in a

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

For this lab, you will implement a program that can output information about any element in the periodic table of elements. Requirements Read in a comma-separated values text file that contains the information about the elements in the periodic table. Save those elenments in a data structure for further processing. Accept command-line parameters: o Program arguments shall be the chemical symbols for wish the user wants more information o Optionally, the user may provide as the first program argument. the name of a file to write the information out to Print out, or write to a file, information about the elements requested Data structure for elements You will need to declare a data structure to hold the information about the chemical element Your structure will have the following components Atomic Number (integer) Chemical Symbol (string) Name (string) Atomic Weight (floating point number State at room temp (string) Bonding type (string Year discovered (string) Incomplete Sample Code You can download an incomplete sample code, though you don't have to completely follow it incomplete sample code. Read in file First, download the element database file by clicking here elemen cs. Save this file in the same directory as the source code for your lab. The first thing your program should do is read in the element db.csv file. line by line. Every line of the file represents one element in the periodic table of elements. o Open the .csv file for reading a text file. and read in every line of the file using the function fgets. o The file in csv format. which means the data fields are separated by commas. Use the function strtok to extract the data field by field. o You can use the function atoito convert a string to an integer. o The function atof can be used to convert a string to a floating point number. Save all of the elements scanned in into an array for further processing

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

Recommended Textbook for

Advances In Databases And Information Systems 25th European Conference Adbis 2021 Tartu Estonia August 24 26 2021 Proceedings Lncs 12843

Authors: Ladjel Bellatreche ,Marlon Dumas ,Panagiotis Karras ,Raimundas Matulevicius

1st Edition

3030824713, 978-3030824716

More Books

Students also viewed these Databases questions

Question

1 x - 1 + 3 = 7 x - 1

Answered: 1 week ago

Question

=+Are there shop stewards?

Answered: 1 week ago