Question: Write a program elements.c that loads the chemical elements from a file into a struct array and allows the user to search it and edit

Write a program elements.c that loads the chemical elements from a file into a struct array and allows the user to search it and edit it. First, declare a struct to store properties of chemical elements. Include the following members: name, symbol, atomic number, atomic mass. Define it as a type called Element using typedef keyword. An example of the properties stored is as follows: Name: Aluminum Symbol: Al Atomic Number: 13 Atomic Mass: 26 Declare a variable of type Element and initialize all its members from standard input (i.e., ask the user to enter each value). Write a function printElement that takes an element as parameter and prints it member variable in the format above. Write a function initElement that takes a pointer to an Element as parameter, two strings and two integers and stores the strings as the name and symbol of the element and the integers as its atomic number and mass. Declare another Element and use the function initElement to initialize its members with values of your choice. After initializing each element, print it using printElement function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
