Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE DO THIS IN C PROGRAM AND FOLLOW THE OUTLINE AT THE BOTTOM INTRODUCTION: In chemistry, neutralization occurs when an acid and a base react

PLEASE DO THIS IN C PROGRAM AND FOLLOW THE OUTLINE AT THE BOTTOM

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 PCs 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

. .

. .

. .

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

SUBMITTING ASSIGNMENTS:

Once you have your program working, exit the C compiler that you are using. Make sure that your source program file name conforms to the following specifications:

sn_pn_first_last

where: sn is your section number (you are in section 04)

pn is the program number (1, 2, 3, 4, 5, )

first is your first name

last is your last name

An example for the sixth assignment would be 4_6_elmer_fudd.

Submission:

Submit your source program using the Assignments button in Blackboard. Remember to submit your C source program in standard ANSI C format only. No other format will be accepted.

If you make changes to your program and need to resubmit, rename the file such as 4_6_elmer_fudd_2 or 4_6_elmer_fudd_3, etc. Then use the Assignments button in Blackboard to submit the new version. Only the most current submitted program version will be graded.

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

PLEASE DO THIS IN THE FOLLOWING FORMAT

/******************************************************************************* AUTHOR SECTION ENGR 200.xx DATE: mm/dd/yyyy PROGRAM: # Author: ******************************************************************************** PROGRAM DESCRIPTION DESCRIPTION OF VARIABLES NAME | TYPE | DESCRIPTION ----------------------------------------------------------------------------- *******************************************************************************/ /* Preprocessor directives */ #include  #include  /* Main function */ int main(void) { /* Declare variables */ /* Print headings */ printf("********************************************"); printf(" "); /* Input values */ /* Compute */ /* Print output values */ printf(" RESULTS"); printf(" ******************************************** "); /* Exit the program */ return 0; } /******************************************************************************/

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions