Answer:
public class PhTester {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("What is the pH Value");
double pH = in.nextDouble();
boolean neutral,base,acid;
if (pH<7.0)
{
neutral=false;
base=false;
acid=true;
}
else if (pH>7.0)
{
neutral=false;
base=true;
acid=false;
}
else if (pH==7.0)
{
neutral=true;
base=false;
acid=false;
}
}
}
Step-by-step explanation:
A complete java code is given above:
1. the variables neutral, acid, base are declared as booleans
2. Scanner class is used to request the user to enter a value for the pH
3. If/else statements are used to assign values to the variables