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
Choose the web design factor from the drop-down menus that best represents each statement. A. Good web pages stick to the point,
Paladinen [302]

Choose the web design factor from the drop-down menus that best represents each statement.

Answer:

A. Good web pages stick to the point, do not have useless information, and showcase important information.

  • Useful content

B. The best websites clearly present a reason for the creation of the site.

  • Purpose

C. The best websites are pleasing to look at and make you want to click further through the pages.

  • Visually appealing

D. It is important for the web designer to understand the needs, interests, and technology level of the target web page visitor.

  • Audience

E. Good websites make it easy to navigate from one page to the other with relevant links in obvious places.

  • Easy to use
4 0
4 years ago
Clunker Motors Inc. is recalling all vehicles from model years 1995-1998 and 2004-2006. Given a variable modelYear write a state
DerKrebs [107]

Answer:

((model years >=1995 && model years <= 1998) || (model years >= 2004 && model years <=2006 ) ? no recall= false : no recall = true;

Explanation:

8 0
3 years ago
20. Modifying a report is easiest from what view. O A. Report O B. Layout O C. Print O D. Design
swat32
The answer is Design
8 0
3 years ago
What Is one reason that more personal computers have windows operating systems as opposed to Mac operating systems
erma4kov [3.2K]

if you search up how windows is better that mac this comes up

"99% of these users will prefer a PC to a Mac because it's the right platform for their needs. Final Cut Pro users use Macs. It doesn't run on Windows.... ... Extreme enthusiasts prefer PCs because they can run better hardware in a PC than they can get in a Mac."

all you have to do is put it in your own words :)

8 0
3 years ago
Read 2 more answers
Which technology can allow a single ground-based telescope to achieve images as sharp as those from the Hubble Space Telescope?
Ganezh [65]

Answer:

The correct answer to the following question will be "Adaptive Optics".

Explanation:

  • AO (Adaptive Optics) is a technique used to enhance optical system performance by reducing the impact of incoming gravitational wave distortions by compressing a mirror to compensate for the distortion.
  • It operates by calculating and compensating for defects in a wave-front with a system that corrects these errors as a deformable mirror or even a liquid crystal collection.
  • It is a technique that can make it possible for a single ground-based telescope to get images as clear as that of the Hubble Space Telescope.
  • Certain methods can achieve power resolution that exceeds the limit set by atmospheric distortion, for example, Aperture synthesis, Lucky imaging, and Speckle imaging.

Therefore, Adaptive Optics is the right answer.

7 0
4 years ago
Other questions:
  • 1. You want to schedule a weekly analysis for the Windows servers in your data center. The command should run as a scheduled job
    15·1 answer
  • All of the following are vertical alignment options except __middle , top, center, or_bottom_.
    12·1 answer
  • Pick the JavaScript code for the following pseudocode. If age &gt;= 65 Then discountRate = 0.10 End If Group of answer choices
    12·1 answer
  • Because collecting the adjustment data requires time, the adjusting entries are often a.estimated and recorded earlier than the
    8·2 answers
  • The term integration refers to the ability to
    9·1 answer
  • What will happen when you run this program?
    12·2 answers
  • PLEASE HELP ME ASAP ITS IMPORTANT
    8·2 answers
  • Please help!! i need this asap &lt;3 <br> (the boxes have the same answer choices in both)
    7·2 answers
  • ? Question<br> How are the Internet and the World Wide Web different from each other?
    11·1 answer
  • This seems like a good time to ask the basic question, “How’s it going in class?” Feel free to offer constructive feedback about
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!