Create a module called chemistry that contains the following three functions: elementName(symbol) This function accepts one string parameter. The symbol represents the name of a specific element on the periodic table. The function returns the name of the element (as string) of the specific element. For example, elementName(Na) returns Sodium. elementName(Li) return Lithium. Note: You are NOT allowed to use lists or any data types not yet covered in class. ionicCompound(e1, c1, e2, c2) This function accepts the chemical symbol and charge for two elements. The function should return the ionic compound created with these two elements. The subscripts should be reduced. ionicName(e1, e2) This function accepts the chemical symbols for two elements. Based on these two symbols the function should return an appropriate chemical name. ionicName(Mg, O) returns Magnesium Oxide. Create a Python program that uses the functions defined in your chemistry module to allow a user to create chemical formulas and chemical names. Your program should include a menu with 2 options. If the user selects an invalid option, the user should be told so, and the menu should be displayed again. The user can enter ANY chemical symbol and chemical charge (+ or -). The program should only work with one metal (+) and non-metal (-). It should only work for the first 20 elements. iv) If the user chooses option 'Q’ (or 'q') the program should end. If the user chooses options 1 or 2, they should be asked to enter the chemical symbols and charges. The menu should then be displayed again, allowing the user to choose again. Your program should use effective mainline logic. In addition to a main() function, think about creating other functions to make your code as easy to read as possible. Your program should demonstrate mastery of the style rules including docstrings, and code comments, and correct use of modules.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Create a module called chemistry that contains the following three functions: elementName(symbol) This function accepts one string parameter. The symbol represents the name of a specific element on the periodic table. The function returns the name of the element (as string) of the specific element. For example, elementName(Na) returns Sodium. elementName(Li) return Lithium. Note: You are NOT allowed to use lists or any data types not yet covered in class. ionicCompound(e1, c1, e2, c2) This function accepts the chemical symbol and charge for two elements. The function should return the ionic compound created with these two elements. The subscripts should be reduced. ionicName(e1, e2) This function accepts the chemical symbols for two elements. Based on these two symbols the function should return an appropriate chemical name. ionicName(Mg, O) returns Magnesium Oxide. Create a Python program that uses the functions defined in your chemistry module to allow a user to create chemical formulas and chemical names. Your program should include a menu with 2 options. If the user selects an invalid option, the user should be told so, and the menu should be displayed again. The user can enter ANY chemical symbol and chemical charge (+ or -). The program should only work with one metal (+) and non-metal (-). It should only work for the first 20 elements. iv) If the user chooses option 'Q’ (or 'q') the program should end. If the user chooses options 1 or 2, they should be asked to enter the chemical symbols and charges. The menu should then be displayed again, allowing the user to choose again. Your program should use effective mainline logic. In addition to a main() function, think about creating other functions to make your code as easy to read as possible. Your program should demonstrate mastery of the style rules including docstrings, and code comments, and correct use of modules. 

Expert Solution
steps

Step by step

Solved in 5 steps with 6 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY