INTRODUCTION:   In chemistry, neutralization occurs when an acid and a base react with each other. Most chemistry occurs in water (that is, is aqueous); under these circumstances, neutralization leads to water with no excess hydrogen or hydroxide ions present. Neutralization can most simply be expressed as   acid + base → salt + water   For example,   HCl + NaOH → NaCl + H2O   The stoichiometry of the reaction depends

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

INTRODUCTION:

 

In chemistry, neutralization occurs when an acid and a base react with each other. Most chemistry occurs in water (that is, is aqueous); under these circumstances, neutralization leads to water with no excess hydrogen or hydroxide ions present. Neutralization can most simply be expressed as

 

acid + base → salt + water

 

For example,

 

HCl + NaOH → NaCl + H2O

 

The stoichiometry of the reaction depends on how much hydrogen ion and hydroxide ion each reactant provides. In this case, each molecule of HCl provides one hydrogen ion, and each molecule of NaOH provides one hydroxide ion. The one hydrogen and one hydroxide ion combine to form one molecule of water.

 

For this assignment, suppose that you have been presented with several solutions of hydrochloric acid (HCl) and some of the most popular bases for wastewater treatment: magnesium hydroxide (Mg(OH)2), calcium carbonate (CaCO3), calcium oxide (CaO), sodium bicarbonate (NaHCO3), sodium hydroxide (NaOH), and ammonia (NH4OH). The neutralization reactions are as follows:

 

2HCl + Mg(OH)2 → MgCl2 + 2H2O (1 mol of Mg(OH)2 will neutralize 2 mol of HCl)

 

2HCl + CaCO3 → CO2 + CaCl2 + H2O (1 mol of CaCO3 will neutralize 2 mol of HCl)

 

2HCl + CaO → CaCl2 + H2O (1 mol of CaO will neutralize 2 mol of HCl)

 

HCl + NaHCO3 → CO2 + H2O + NaCl (1 mol of NaHCO3 will neutralize 1 mol of HCl)

 

HCl + NaOH → NaCl + H2O (1 mol of NaOH will neutralize 1 mol of HCl)

 

ASSIGNMENT:

Write a C program that calculates how much base is required to neutralize a solution of hydrochloric acid. For this program, start with a solution that contains 5 mol of HCl, incrementing by 5 mol of HCl, up to a final solution containing 20 mol of HCl. Let the HCl level be controlled by a while loop. Within the while loop, insert a for loop. This for loop should start at 1, increment to 5, and count up by 1. This loop will act as the acid “selector”. A value of 1 will be Mg(OH)2, a value of 2 will be CaCO3, a value of 3 will be CaO, a value of 4 will be NaHCO3, and a value of 5 will be NaOH. For each of these bases, calculate how much mass is need to neutralize the hydrochloric acid. (Hint: this will likely be easiest to do with embedded if statements). The output should print as a table.

 

The following constants should be defined in preprocessor directives:

Molar mass of Mg(OH)2           58.32

Molar mass of CaCO3            100.09

Molar mass of CaO                 56.08

Molar mass of NaHCO3         84.01

Molar mass of NaOH             40.00

 

Use the “Code Sections.c” template on Blackboard to write your code.

 

Your program output will look like the illustration shown below. Use your PC’s cursor to determine the horizontal and vertical spacing for the output format.

 

OUTPUT FORMAT:

********************************************

       NEUTRALIZING HYDROCHLORIC ACID

 

HCl Level = 5.0 mol

Base       Amount needed (g)

Mg(OH)2    xxxx.xx

CaCO3      xxxx.xx

CaO        xxxx.xx

NaHCO3     xxxx.xx

NaOH       xxxx.xx

 

HCl Level = 10.0 mol

Base       Amount needed (g)

Mg(OH)2    xxxx.xx

CaCO3      xxxx.xx

CaO        xxxx.xx

NaHCO3     xxxx.xx

NaOH       xxxx.xx

 

.                    .

.                    .

.                    .

********************************************

 

 

Pseudocode:

 

The following pseudocode may help you structure the nested while, for, and if structures.

 

while(moles of HCl <= 20)

   for(i)

      if(i=1)

         print that base is MgOH2

         print how many g of MgOH2 are required to neutralize HCl

      if(i=2)

         print that base is CaCO3

         print how many g of CaCO3 are required to neutralize HCl

      if(i=3)

         print that base is CaO

         print how many g of CaO are required to neutralize HCl

      if(i=4)

         print that base is NaHCO3

         print how many g of NaHCO3 are required to neutralize HCl

      if(i=5)

         print that base is NaOH

         print how many g of NaOH are required to neutralize HCl

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education