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 has nothing to do with anything school related, but I'm new to car audio and I was wondering, what happens or what would ha
DerKrebs [107]
It most likely can but It may damage your system. So you should seek out professional help from a car dealership and do more research.

Hope this helps.<span />
7 0
2 years ago
What is redo and undo?​
umka21 [38]

Answer:

Answer in the below

Explanation:

Redo means the previous one and undo means removing it... i am not so sure..

3 0
1 year ago
What are the advantages and disadvantages of using wireless communications? What are the advantages and disadvantages of using w
Nimfa-mama [501]

Answer:

<u>Advantages of wireless communication:-</u>

  • Flexibility in transferring the message through communication for which the sender and receiver can be in any place.
  • Speed of the communication is accurate and fast
  • Due to no wiring , the cost of the wireless communication is less.

<u>Disadvantages of wireless communication:-</u>

  • The security is less as the data can be accessed by unauthorized sources at times.
  • The setting up of wireless communication complex and expensive.

<u>Advantages of wired communication:-</u>

  • Simple configuration
  • Higher bandwidth is present in the cable
  • High reliability

<u>Disadvantages of wired communication:-</u>

  • Mobility is present for communication
  • Installation requires lot of time due to cabling
  • Requires extra devices for covering large areas for communication

Wireless communication is more preferable than wired communication in the conditions like communication connection that should face low damage and longer life which is not present in cable connection as they break or get disrupted.The flexibility of moving while communication is required by most people so, they use wireless communication .

8 0
3 years ago
What is the proper citation for a video source? A. Video: Hank Aaron. Dir. Don Donto. VidCassette. 1985. DVD. Home Video, 1986.
VashaNatasha [74]
The answer it had to be B
6 0
2 years ago
What is the name of an instruction that interrupts a program being executed and requests a service from the operating system
tresset_1 [31]
“Interrupt” is what I think the answer is
7 0
2 years ago
Other questions:
  • Which of the following is the correct order for arranging these titles in a subject filing system? A. Applications, Banking Serv
    5·1 answer
  • What are options in the Advanced tab in the Share Workbook dialog box? Check all that apply
    14·2 answers
  • Word processing software, spreadsheet software, database software, and presentation software are examples of what category of co
    12·1 answer
  • 1.Write the Qbasic program to find sum of any 10 different numbers.
    12·1 answer
  • Where can you find your EFC
    8·2 answers
  • Which of the following is part of Connections Academy's AUP regarding the use of the school'supplied technology
    7·2 answers
  • Which of the following activities does an effective team do?
    15·2 answers
  • Write a loop that subtracts 1 from each element in lowerScores. If the element was already 0 or negative, assign 0 to the elemen
    14·1 answer
  • What is a complier in computers
    9·2 answers
  • 2.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!