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
Chapter 21 discusses four aspects of the speaking situation you should take into account when planning the graphics you'll use i
choli [55]

Answer:

The answer is "audience aptitude and experience "

Explanation:

The presentation is the ability to provide a variety of audiences with successful and stimulating interactions. The main objective of an oral presentation is to talk formally to a live audience about a particular subject. You have to write an oral speech that engages the audience and fulfills your goals.

In this type of presentation, the Listener-centric concept is effective as the productivity of a speaker is enhanced by creating and presenting the speech throughout the proper manner.

6 0
3 years ago
What does a class do?
SSSSS [86.1K]

Answer:

adds color to words

Explanation:

adds color to words

7 0
3 years ago
Lab 6B: printing a binary number
r-ruslan [8.4K]

Answer:

In Python:

num = int(input("Enter a decimal integer: "))

temp = num

bin = ""

while num > 0:

   bin = str(num%2)+bin

   num//=2

print(str(temp)+" in binary is "+str(bin))

Explanation:

This prompts the user for a decimal number

num = int(input("Enter a decimal integer: "))

This assigns the input number to a temporary variable

temp = num

This initializes the binary output to an empty string

bin = ""

This loop is repeated while num is greater than 0

while num > 0:

This appends the remainder of num divided by 2 to the front of the binary variable bin

   bin = str(num%2)+bin

This calculates the floor division of num and 2

   num//=2

This prints the required output

print(str(temp)+" in binary is "+str(bin))

7 0
3 years ago
Write any two reasons why files are stored in folders​
iogann1982 [59]

Answer:

Explanation:

The answer is The tree structure suggests the main benefit of folders: to organize your files. You can create folders to store and organize your pictures, your documents, your videos, and so on. Folders are also used to separate the files created by different users.

4 0
3 years ago
Read 2 more answers
Key Vocabulary:
telo118 [61]

try is input

And which show after opening is output

4 0
3 years ago
Other questions:
  • Jessica wants to purchase a new hard drive. She wants a drive that has fast access because she will use it to edit videos on her
    12·1 answer
  • What happens to the data in rom when the power is turned off?
    10·1 answer
  • Discuss OPENGL instruction to draw the following drawing primatives:
    14·1 answer
  • In which section of a document would you include image acknowledgments for the images used ?
    8·2 answers
  • The instructions for the OS provided by application software
    14·2 answers
  • Which is a group of related software applications that are bundled and sold together?
    9·2 answers
  • is either the number of bits used to indicate the color of a single pixel, or the number of bits used for each color component o
    7·1 answer
  • Do you think you should learn to program? Why? why not?
    11·1 answer
  • A company has a number of employees. The attributes of EMPLOYEE include Employee ID (identifier), Name, Address, and Birthdate.
    11·1 answer
  • How do I find unwanted programs on my computer?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!