1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
pychu [463]
3 years ago
6

Write an if/else statement that compares the double variable pH with 7.0 and makes the following assignments to the bool variabl

es neutral, base, and acid: a. false, false, true if pH is less than 7 b. false, true, false if pH is greater than 7 c. true, false, false if pH is equal to 7.
Computers and Technology
1 answer:
Volgvan3 years ago
6 0

Answer

       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;

       }

A complete java program that prompts a user for the pH value is provided in the explanation section

Explanation:

import java.util.Scanner;

public class ANot {

   public static void main(String[] args) {

      Scanner in = new Scanner(System.in);

       System.out.println("Enter a value for the pH");

       boolean neutral, base, acid;

       double pH = in.nextDouble();

       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;

       }

}

}

You might be interested in
Can you exclude header rows from sort in excel?
Ad libitum [116K]

Answer:

The easiest way to sort excluding first row must be unselecting the first row. keys simultaneously to quickly select the data range from the second row to the end. Then you can sort the data excluding first row.

Explanation:

yes

4 0
2 years ago
Giving brainliest to the Person finishes this song lyric.
muminat

Answer:

the man on the silver mountain

Explanation:

because it can

5 0
2 years ago
Read 2 more answers
Which of the following is not part of the four ways you can avoid problems with email communication?
UkoKoshka [18]
D you can always find another way or other ways to relay your message 

hope this helps ya :)


3 0
3 years ago
What is the purpose of an internet protocol address (ip address)? it specifies whether a computer is using a broadband network o
Cloud [144]
<span>It uniquely identifies the location of each computer or device connected to the internet?</span>
7 0
3 years ago
Firestick optimizing system storage and applications loop
fiasKO [112]

Answer:

IF THIS DOES OCCUR THEN THE SYSTEM WILL AUTOMATICALLY CUT OFF WITH NO WARNING AT ALL...

Explanation:

ON WHAT INFORMATION AND RESEARCH HAS GIVEN ME IT WILL BE THE  AWNSER GIVEN AT THE TOP...

7 0
2 years ago
Other questions:
  • Pointsyour company environment includes windows server versions 2003, 2008, and 2012. desktops range from windows xp and vista.
    13·1 answer
  • Samantha plans an investigation in which she will study a population of animals. Which of these answers best describes the focus
    8·1 answer
  • If i'm wanting to use hydra on linux to crack a password and the issue regarding hashes occurs, what shall i do?
    12·1 answer
  • The company currently runs 60 autonomous APs and has plans to increase wireless density by 50% in the near future
    13·1 answer
  • In cryptography, the term "Secret algorithm" refers to an algorithm designed in a way that prevents the examination of its inner
    12·2 answers
  • How to use repl.it css
    7·1 answer
  • Which technology will a business use to figure out who accessed confidential files on a company's computer system
    12·1 answer
  • Help help help help help!!!
    7·1 answer
  • 2
    6·1 answer
  • For computer forensics, ____________ is the task of collecting digital evidence from electronic media.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!