Question

by using fortran.90 solve this question... the pH of an aqueous solution is a measure of...

by using fortran.90 solve this question...
the pH of an aqueous solution is a measure of its acidity. The pH scale ranges from 0 to 14, inclusive. A solution with
a pH of 7 is said to be neutral, a solution with a pH greater than 7 is basic, and a solution with a pH less than 7 is acidic.
Write a program that will read value of pH of a solution, and will print whether it is neutral, basic, or acidic. If the user enters
an invalid pH, an error message will be printed.

Homework Answers

Answer #1
Here's the program in fortran:

program phrange
  implicit none
  integer            :: p   ! integer to hold pH value
  character(len=8)   :: type  ! string to hold the result

  print*,"Enter the pH value"   !taking input from user
  read (*) p
  
  IF (p < 0) THEN           
    type="error"              ! checking for pH in range
  ELSE IF (p > 14 ) THEN
    type="error"              ! checking for pH in range
  ELSE IF (p == 7) THEN
    type="neutral"            ! checking for pH being neutral
  ELSE IF (p < 7) THEN 
    type="acidic"             ! checking for pH being acidic
  ELSE 
    type="basic"              ! checking for pH being basic
  END IF
  print *, type               ! printing result
end program phrange
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
by using fortran.90 solve the question below... -the power (watts) and the voltage (volts) the current...
by using fortran.90 solve the question below... -the power (watts) and the voltage (volts) the current (amps) drawn in a circuit can be found from: Current= (Power)/ (Voltage).By using Select Case, write a program that calculates the current given the power of 50 devices (remember that the voltage is 240v in the UK) and displays the most suitable cable for use. Consider 3 suitable cables (1.5 mm2 for up to 5 amps, 2.5 mm2 for up to 13 amps, and...
1. What is the pH of a 0.000682 M solution of NaOH? 2. a)What is the...
1. What is the pH of a 0.000682 M solution of NaOH? 2. a)What is the kb for F- given that the ka for HF is 6.8*10-4 b)What is the pH of a 0.292 M solution of NaF? 3. What is the pH of a 0.03 M solution of CaO? HINT: CaO is ionic and dissociates into ions. What is the oxygen ion that results? What kind of an acid or base is it? You need to write out the...
You will write a program that loops until the user selects 0 to exit. In the...
You will write a program that loops until the user selects 0 to exit. In the loop the user interactively selects a menu choice to compress or decompress a file. There are three menu options: Option 0: allows the user to exit the program. Option 1: allows the user to compress the specified input file and store the result in an output file. Option 2: allows the user to decompress the specified input file and store the result in an...
1.) You will work with 0.10 M acetic acid and 17 M acetic acid in this...
1.) You will work with 0.10 M acetic acid and 17 M acetic acid in this experiment. What is the relationship between concentration and ionization? Explain the reason for this relationship 2.) Explain hydrolysis, i.e, what types of molecules undergo hydrolysis (be specific) and show equations for reactions of acid, base, and salt hydrolysis not used as examples in the introduction to this experiment 3.) In Part C: Hydrolysis of Salts, you will calibrate the pH probe prior to testing...
I did already posted this question before, I did get the answer but i am not...
I did already posted this question before, I did get the answer but i am not satisfied with the answer i did the code as a solution not the description as my solution, so i am reposting this question again. Please send me the code as my solution not the description In this project, build a simple Unix shell. The shell is the heart of the command-line interface, and thus is central to the Unix/C programming environment. Mastering use of...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT