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
This is a human-made physical system.
Readme [11.4K]
Health care system and school system
4 0
2 years ago
A label control's __________ property determines whether the control automatically sizes to fit its current contents.
Kazeer [188]

Answer:

Option d (Auto Size) is the correct answer.

Explanation:

In a C# programming language, when a user needs to create a Windows Forms Label, then he needs to specify the property of label that how the label will look like and where the label fits and what is the size of that label. Following are the property which has a different meaning and a user need to specify when he creates a label--

  1. Fit states that the label to fix in the size.
  2. Text align states that the item of the toolbar is fixed in the center.
  3. The Middle center states that the item is fixed in the middle.
  4. Auto Size helps that the size of the control can be automatically resized.

The above question asked about that property which is used to automatically resize the control. So the answer is Auto size which is described above. Hence Option d is the correct answer while the other is not because--

  • Option a state about 'Fit' property which is used to fix the label size.
  • Option b states about 'Text align' property which is used to fix items of the toolbar in the center.
  • Option c states about 'Middle center' property which is used to fix the item in the middle.
4 0
2 years ago
The ratio of boys and girls is 4:5 calculate the number of boys if the are 1080 learners in schools​
inna [77]

Explanation:

The ratio of Boys =  4x

The ratio of  Girls =  5x

The Number of Boys in the School = 4x + 5x = 1080

                                                          =         9x = 1080

                                                          =           x  = 1080/9

<em>                                                          </em> =           x  = 120

The ratio of Boys = 4x  = 4 x 120 = <em>480</em>

The ratio of  Girls =  5x = 5 x 120 = 600

<u></u>

Answer :-   <u><em>The ratio of Boys =480</em></u>

                 

8 0
2 years ago
How do i do a mutioutput on a mac
Tcecarenko [31]
Here's what I found

To use an aggregate device with Logic:
Open Logic Pro or Logic Express.
Choose Logic Pro > Preferences > Audio or Logic Express > Preferences > Audio and select the Devices tab.
Select the Output Device drop-down menu and choose the aggregate device from the list. ...
Click Apply Changes at the bottom-right of the window.
4 0
3 years ago
If you had an idea for a new software company, what would be the best approach to help make it a successful business? develop a
Klio2033 [76]

Answer:

develop a business plan to describe how to maintain and grow revenues

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following should be considered when conducting an audience analysis ?
    13·2 answers
  • HELP ASAP
    10·2 answers
  • If we can lock a file, we can solve the race condition problem by locking a file during the check-and-use window, because no oth
    14·1 answer
  • Joann wants to insert page numbers at the bottom of the pages of her document using the Field option in Quick
    12·2 answers
  • You need to replace a broken monitor on a desktop system. You decide to replace it with a spare monitor that wasn't being used.
    15·2 answers
  • What is the difference between MySQL and MariaDB?
    9·1 answer
  • What is the difference between a crosstab query and a subquery?
    11·2 answers
  • You should move around and take a rest for 30 minutes every 5 minutes.<br><br>True Or False​
    9·1 answer
  • The disk you inserted was not readable by this computer
    11·1 answer
  • The quickest way to change a word is to double
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!