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
What is the name of the table tools contextual tab that appears once you insert a table?
Maksim231197 [3]

In MS-word the table tools is used. In open MS-word document end user has insert table and select no rows and columns.

<u>Explanation:</u>

Once end user inserted the table, layout in design has to be fixed. Insert table can also use in MS- PowerPoint presentation also.

Same away it is also possible in MS-excel also.

Contextual tab:- it is special types which is available in MS—word or MS-excel or PowerPoint. It is applied or selected from ribbon tab.

Contextual tab is used to insert images or formatting the data in insert table.

4 0
3 years ago
Read 2 more answers
Hey Yo, i need some help, Whats 2+2?
Goryan [66]

Answer:

4

Explanation:

4 0
3 years ago
Read 2 more answers
Discuss the various types of keys available on a computer keyboard.<br>No spam answer needs!❌❌​
olga nikolaevna [1]

Answer:• Alphanumeric keys – all of the letters and numbers on the keyboard. A-Z and 0-9.

• Punctuation keys – All of the keys associated with punctuation such as the comma,

period, semicolon, brackets, parenthesis and so on. Also, all of the mathematical

operators such as the plus sign, minus sign, and equal sign.

• Special keys – All of the other keys on the computer keyboard such as the function

keys, control keys, arrow keys, caps lock key, delete key, etc.

Special keys on a PC Keyboard

• Alt key – Short for Alternate, this key is like a second control key.

• Arrow Keys – Most keyboards have four arrow keys that enable you to move the

cursor (or insertion point) up, down, right, or left. Used in conjunction with the Shift

or Alt keys, the arrow keys can move the cursor more than one position at a time, but

this depends on which program is running.

• Backspace key – Deletes the character just to the left of the cursor (or insertion

point) and moves the cursor to that position.

• Caps Lock Key – A toggle key that, when activated, causes all alphabetic characters

to be uppercase.

• Ctrl key – Short for Control, this key is used in conjunction with other keys to

produce control characters. The meaning of each control character depends on which

program is running.

• Delete Key – Sometimes labeled Del, deletes the character at the current cursor

position, or the selected object, but does not move the cursor. For graphics-based

applications, the Delete key deleted the character to the right of the insertion point.

• Enter Key – Used to enter commands or to move the cursor to the beginning of the

next line. Sometimes labeled Return instead of Enter.

• Esc Key – Short for Escape, this key is used to send special codes to devices and to

exit (or escape) from programs and tasks.

• Function Keys – Special keys labeled F1 to F12. These keys have different meaning

depending on which program is running.

Explanation: use quillbot or wordtune to change the words

3 0
2 years ago
Write a program that asks for the names of three runners and the time, in minutes (no seconds, etc.), it took each of them to fi
Crank

Answer:

Complete python code with explanation and output results is given below

Explanation:

User is asked to input names of runners and their finishing time

We have to determine first, second and third according to their finishing time.

if else conditioning is used to determine who has lowest finishing time.

Outer if is used to decide first position and inner if is used to decide second and third position.

str() function is used to concatenate the integer variable with string

Code:

runner1 = input("Please enter name of the runner1 ")

time1 = int(input("Please enter the time of runner1 "))

runner2 = input("Please enter name of the runner2 ")

time2 =int(input("Please Enter name of the runner2 "))

runner3 = input("Please enter name of the runner3 ")

time3 =int(input("Please Enter name of the runner3 "))

if(time1 < time2 and time1 < time3):  

   if(time2 < time3): // to decide 2nd and 3rd position

       print(runner1+" has finished First with time: "+str(time1))

       print(runner2+" has finished Second with time: "+str(time2))

       print(runner3+" has finished Third with time: "+str(time3))

   else:

       print(runner1+" has finished First with time: "+str(time1))

       print(runner3+" has finished Second with time: "+str(time3))

       print(runner2+" has finished Third with time: "+str(time2))

if(time2 < time1 and time2 < time3):  

   if(time1 < time3):

       print(runner2+" has finished First with time: "+str(time2))

       print(runner1+" has finished Second with time: "+str(time1))

       print(runner3+" has finished Third with time: "+str(time3))

   else:

       print(runner2+" has finished First with time: "+str(time2))

       print(runner3+" has finished Second with time: "+str(time3))

       print(runner1+" has finished Third with time: "+str(time1))

if(time3 < time1 and time3 < time2):

   if(time2 < time1):    

       print(runner3+" has finished First with time: "+str(time3))

       print(runner2+" has finished Second with time: "+str(time2))

       print(runner1+" has finished Third with time: "+str(time1))

   else:

       print(runner3+" has finished First with time: "+str(time3))

       print(runner1+" has finished Second with time: "+str(time1))

       print(runner2+" has finished Third with time: "+str(time2))

Output:

Program has been tested with multiple inputs and results are accurate as per problem specifications.

Please enter name of the runner1 danny

Please enter the time of runner1  45

Please enter name of the runner2  sam

Please enter the time of runner2  34

Please Enter name of the runner3  tedd

Please enter the time of runner3  23

tedd has finished First with time: 23

sam has finished Second with time: 34

danny has finished Third with time: 45

5 0
4 years ago
Denalee<img src="https://tex.z-dn.net/?f=denalee%20quevedo" id="TexFormula1" title="denalee quevedo" alt="denalee quevedo" align
baherus [9]

Answer:

pop off

Explanation:

6 0
3 years ago
Other questions:
  • Which of the following is not a standard method called as partof the JSP life cycle?
    5·1 answer
  • Who will win the premier league
    9·2 answers
  • On most computers, the default font size in word is ____. 8 11 14 16
    8·2 answers
  • Communication is defined as__________.
    10·1 answer
  • What does a capitalist economy allow people to do?
    11·2 answers
  • Which activity represents a violation of the licensing agreement?
    13·2 answers
  • What are three key characteristics of an OS process?
    11·1 answer
  • Analyzing the role of elements in audio editing and Video
    7·1 answer
  • For what purpose power point is used?​
    5·2 answers
  • The area of ai that investigates methods of facilitating communication between computers and people is?.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!