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.
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...
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 5 steps with 6 images
Recommended textbooks for you
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 Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
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 Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
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
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY