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
steposvetlana [31]
4 years ago
13

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

s neutral, base, and acid: 0,0,1 if pH is less than 7 0,1,0 if pH is greater than 7 1,0,0 if pH is equal to 7 History:
Computers and Technology
2 answers:
levacccp [35]4 years ago
4 0

Answer:

if (pH<7.0){

          neutral=0;

          base=0;

          acid=1;

      }

      else if (pH>7.0){

          neutral=0;

          base=1;

          acid=0;

      }

      else if (pH==7.0){

          neutral=1;

          base=0;

          acid=0;

      }

Explanation:

As required by the question, if and else statements have been used to test the value of the pH and assign the apropriate values to the variables neutral, base and acid.

The code snippet below can be used to prompt the user to enter values for pH

<em>import java.util.Scanner;</em>

<em>public class pHTest {</em>

<em>   public static void main(String[] args) {</em>

<em>      Scanner scr = new Scanner(System.in);</em>

<em>       System.out.println("Enter a value for the pH");</em>

<em>       int neutral, base, acid;</em>

<em>       double pH = scr.nextDouble();</em>

<em> if (pH<7.0){</em>

<em>           neutral=0;</em>

<em>           base=0;</em>

<em>           acid=1;</em>

<em>       }</em>

<em>       else if (pH>7.0){</em>

<em>           neutral=0;</em>

<em>           base=1;</em>

<em>           acid=0;</em>

<em>       }</em>

<em>       else if (pH==7.0){</em>

<em>           neutral=1;</em>

<em>           base=0;</em>

<em>           acid=0;</em>

<em>       }</em>

<em>} }</em>

san4es73 [151]4 years ago
3 0

Answer:

Their answeres choices

Explanation:

You might be interested in
The ____ statement is used to execute specific programming code if the evaluation of a conditional expression returns a value of
OverLord2011 [107]

Answer: if statement

Explanation:

The statements executes when a specific conditions are true.

5 0
3 years ago
A retailer is able to track which products draw the most attention from its customers through the use of 5g-enabled motion senso
Minchanka [31]

The technology combines with 5g capabilities to allow the monitoring of shopping trends in this way is called internet of things

For better understanding, lets explain what internet of things means.

  • Internet of things is simply known to be a network of Internet-Enabled objects that is often combined along with web services as they often interact with these objects.
  • There is a known development of the Internet where objects always have network connectivity giving them room to send and receive data.

From the above, we can therefore say that the answer The technology combines with 5g capabilities to allow the monitoring of shopping trends in this way is called internet of things is correct.

Learn more about internet of things from:

brainly.com/question/19995128

7 0
3 years ago
Technology is defined as human ________________ in action that involves the generation of knowledge and processes to develop sys
Alenkasestr [34]

Answer:

Innovation:

Explanation:

Technology is defined as human innovation in action that involves the generation of knowledge and processes to develop systems that solve problems and extend human capabilities.

To innovate is to make changes in something established, especially by introducing new methods, ideas, or products.

5 0
2 years ago
Which key should you press to change the cell contents to your typed data
Free_Kalibri [48]

You can edit the contents of a cell directly in the cell. You can also edit the contents of a cell by typing in the formula bar.

When you edit the contents of a cell, Excel is operating in Edit mode. Some Excel features work differently or are unavailable in Edit mode.

4 0
3 years ago
Read 2 more answers
Giving Brainliest IFFF CORRECT
prohojiy [21]

Answer:

line graph

Explanation:

the change in weight is linear

5 0
4 years ago
Other questions:
  • Peter recently bought a media player and a digital camera he wants to buy memory card for the devices which memory device should
    10·2 answers
  • Which of the following is NOT an example of a font style?
    13·1 answer
  • In JavaScript, which of the statements below can be used for string declaration?
    11·1 answer
  • What is good prossesser
    15·2 answers
  • If the user does NOT click the button what color will "topButton" be when this program finishes running?
    6·1 answer
  • How do I change my name on my Brainly Profile?
    15·2 answers
  • Iam trying to find a way to code in Scratch that will let me take away the first two and last two letters of a word. For example
    15·1 answer
  • So has anyone opened the link/file those people are giving out as answers? Like what are they, viruses, answers, nothing??? Some
    9·2 answers
  • Select the correct answer.
    14·1 answer
  • Cisco cyber security would classify this email?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!