Run a python program that will receive a chemical compound formula as an input and will give its molar mass

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

Run a python program that will receive a chemical compound formula as an input and will give its molar mass as an output. The mass of the atoms must be imported from a mass.csv file.

Inputs:
a. Chemical Formula
b. Elements in the compound 
c. Number of atoms per element (must be in separated lines depending on the number of elements present)

Output:
a. Molar Mass

Additional Information:
a. If the element entered in “b.” is not in the chemical formula, the output must be: “Incorrect Formula.”
b. If the number of atoms per element is not the same as what was entered in the chemical formula, the output must be: “Incorrect number of atoms.”

Please create a program like this. If not familiar with chemistry, please create a similar program.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT