lonic compounds are those created through the bonding of metal and non-metal elements. You are to create a python program that will allow the user to enter two chemical symbols that will then allow the user to create an ionic compound formula or create the ionic compound name. This project will test your knowledge of strings, string methods, indexing, slicing, modules, functions. Program Requirements: 1. Create a module called chemistry that contains the following three functions: a) 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. b) 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. c) 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. 2. Create a Python program that uses the functions defined in your chemistry module to allow a user to create chemical formulas and chemical names. i) ii) iii) 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. v) If the user chooses options 1 or 2, they should be asked to enter the chemical symbols and charges. 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. vi) The menu should then be displayed again, allowing the user to choose again. d) 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.

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
lonic compounds are those created through the bonding of metal and non-metal elements.
You are to create a python program that will allow the user to enter two chemical symbols
that will then allow the user to create an ionic compound formula or create the ionic
compound name.
This project will test your knowledge of strings, string methods, indexing, slicing, modules,
functions.
Program Requirements:
1. Create a module called chemistry that contains the following three functions:
a) 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.
b) 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.
c) 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.
2. Create a Python program that uses the functions defined in your chemistry module to
allow a user to create chemical formulas and chemical names.
i)
Your program should include a menu with 2 options.
ii)
If the user selects an invalid option, the user should be told so, and the
menu should be displayed again.
iii)
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.
v)
If the user chooses options 1 or 2, they should be asked to enter the
chemical symbols and charges.
vi)
The menu should then be displayed again, allowing the user to choose
again.
d) 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.
e) Your program should demonstrate your mastery of the style rules we have
discussed so far this year including docstrings, and code comments, and correct
use of modules.
f) Develop an algorithm explaining how the program will function.
Transcribed Image Text:lonic compounds are those created through the bonding of metal and non-metal elements. You are to create a python program that will allow the user to enter two chemical symbols that will then allow the user to create an ionic compound formula or create the ionic compound name. This project will test your knowledge of strings, string methods, indexing, slicing, modules, functions. Program Requirements: 1. Create a module called chemistry that contains the following three functions: a) 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. b) 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. c) 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. 2. Create a Python program that uses the functions defined in your chemistry module to allow a user to create chemical formulas and chemical names. i) Your program should include a menu with 2 options. ii) If the user selects an invalid option, the user should be told so, and the menu should be displayed again. iii) 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. v) If the user chooses options 1 or 2, they should be asked to enter the chemical symbols and charges. vi) The menu should then be displayed again, allowing the user to choose again. d) 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. e) Your program should demonstrate your mastery of the style rules we have discussed so far this year including docstrings, and code comments, and correct use of modules. f) Develop an algorithm explaining how the program will function.
Expert Solution
steps

Step by step

Solved in 5 steps with 6 images

Blurred answer
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