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
slamgirl [31]
3 years ago
13

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:
Neko [114]3 years ago
8 0

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;

       }

   }

}

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

You might be interested in
News writers get story leads from____.
Andrei [34K]
I believe the answer is B.Press releases! Hope this helps:)
4 0
3 years ago
When a primary key combines two or more fields, it is called a ____ key?
Tanya [424]
<span>When a primary key combines two or more fields, it is called a ____ key
the answer is Constructed key</span>
6 0
3 years ago
What is fruit nursery?​
Natasha2012 [34]
A place where young plants are produced through different ways is a nursery. The main work of nursery is to supply young plants and seeds for cultivation purposes for both fruits and vegetables. ... An appropriate environment for germination of seed. The nursery is also very useful for purpose of vegetation propagation.
7 0
3 years ago
Read 2 more answers
when doing a complex presentation which of the fallowing will be the best tool to begin designing your presentation
qaws [65]

but where are the option bro

7 0
2 years ago
Read 2 more answers
For each of the following memory accesses indicate if it will be a cache hit or miss when carried out in sequence as listed. Als
nika2105 [10]

Answer:

Explanation:

Operation Address Hit? Read Value

Read 0x834 No Unknown

Write 0x836 Yes (not applicable)

Read 0xFFD Yes CO

6 0
3 years ago
Other questions:
  • Which logic gate produces an output of 1 only if both it’s inputs are 0?
    10·2 answers
  • Which of the following queries can have a Fully Meets result? Select all that apply. True False [adobe website], English (US) Tr
    7·1 answer
  • Which of the following is a central feature of agroup?interactionmutual influenceinterdependenceall of the given options
    10·1 answer
  • Sam wants to use the rule of thirds to capture the essence of his image. How will he apply this rule in his image to get a pleas
    6·1 answer
  • Please help! In your own words explain the difference between a problem and an algorithm.
    13·2 answers
  • My brainly isnt working it isnt showing and answers wats going on? wat do i do
    14·2 answers
  • A system of classifying and organizing online content into categories by the use of user-generated metadata such as keywords is
    8·1 answer
  • Describing Work Styles for Farmworkers and Laborers, Crop
    6·2 answers
  • Doctrine Creative is a video production company with its own file server within its business office. The company needs to be abl
    8·2 answers
  • 4. Return the card number, first name, last name, and average late fee of each customer. Name this column as "Fee".
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!