Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
Chemical Elements 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 In the main) procedure, do the following 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 the typedef keyword. An example of the properties stored is as follows: Name: Aluminum Symbol: Al Atomic Number: 13 Atomic Mass: 26 Declare a variable (object) called element1 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 (e.g., element1) as parameter and prints it member variables in the format above Declare another element called element Write a function initElement() that takes as parameters (1) a pointer to an element (e.g., element2) as parameter, (2) a string as the name of the element, (3) a string as the symbol of the element, (4) an integer as the atomic number (5) an integer as the atomic mass, and store the corresponding four member values into the element. Use the function initElement() to initialize its members with iron (Iron, Fe, 56, 26) After initializing each element, print it using the printElement() function

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

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

Explain the different types of marketing strategies.

Answered: 1 week ago

Question

Explain product positioning.

Answered: 1 week ago

Question

Explain Industrial market segment.

Answered: 1 week ago

Question

3. Describe the strategic training and development process.

Answered: 1 week ago

Question

10. Microsoft Corporation

Answered: 1 week ago

Question

4. EMC Corporation

Answered: 1 week ago