quiz حل الأسئلة الجامعية manage_search الأرشيف

تم الحل ✓
categoryبرمجة وتطوير البرمجيات schoolبكالوريوس event_available2026-07-15

السؤال

Transcribed Image Text:

Chemists, biologists, and biochemists, are often interested in calculating the pH level of a given solution. A solution with a pH level less than 7 is acidic; otherwise, it is basic. Determining the pH of a solution is important, since many organisms and micro-organisms can only live in a limited pH range. Write a C++ program that calculates and prints the pH level, and states whether the solution is acidic or basic. The input is concentration of hydroxide ions, denoted OH, and is a real number. The concentration of hydronium ions, abbreviated H, is calculated by the formula H*= 104 OH The pH level can then be computed with pH = -log (H*) For example, if the input solution is 0.002, your program should print something like this: The pH level of solution 0.002 is 11.30103. The solution in basic. Use proper loop structure, meaningful variable names, proper indentation, and appropriate comments. Use the format and style described in the assignment guidelines. Here are four hydroxide concentrations to use as test input: 0.002 0.00006 0.000000007 0.0000000009. Show your lab instructor that your program works. Sample Output Sample Output This program calculates ph level Enter 0 to quit the program. Please input the concentration of hydroxide: 0.002 The ph level of solution 0.0020000000 is 11.3010299957. The solution is basic. Please input the concentration of hydroxide: 0.00006 The ph level of solution 0.0000600000 is 9.7781512504. The solution is basic. Please input the concentration of hydroxide: 0.000000007 The ph level of solution 0.0000000070 is 5.8450980400. The solution is acidic. Please input the concentration of hydroxide: 0.0000000009 The ph level of solution 0.0000000009 is 4.9542425094. The solution is acidic. Please input the concentration of hydroxide: 0. You entered 0. so quit the program.

check_circle الجواب — حل مفصل خطوة بخطوة

hourglass_top