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
umka2103 [35]
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 int variable

s neutral, base, and acid: a. 0,0,1 if pH is less than 7 b. 0,1,0 if pH is greater than 7 c. 1,0,0 if pH is equal to 7
Computers and Technology
1 answer:
Brilliant_brown [7]3 years ago
4 0

Answer:

int main()

{

   double pH;

   int neutral;

   int base;

   int acid;

   cout<<"Enter a pH Value";

   cin>> pH;

   if(pH<7.0){

       neutral =0;

       base=0;

       acid= 1;

   }

   else if (pH=7.0){

       neutral =1;

       base=0;

       acid= 0;

   }

   else{

       neutral =0;

       base=1;

       acid= 0;

   }

   cout <<"The neutral, Base and Acid Values are: "<<neutral<<","<<base<<","<<acid<<" Respectively"<<endl;

   return 0;

}

Explanation:

Using multiple if/elseif/else statement the following problem is solved with C++

You might be interested in
What is the name of a statement written to retrieve specific data from a table?
Shkiper50 [21]
The answer is b.record
4 0
3 years ago
Comments should
suter [353]

Answer:

Correct answer is:

communicate the purpose of the code that follows it.

Explanation:

Let have a look at each option

comment should give the reader the background of the programmer.

Comments are unable to do so.

Be written on every line

No, it is not need as comment are useful only to explain difficult or complex part of code.

communicate the purpose of the code that follows it.

yes, this option is true, as comments will give hints to programmer about the piece of code.

give information about how many hours it took to write the code

No, comments can answer it,

3 0
3 years ago
Read 2 more answers
The theory of continental drift is supported by all of the following EXCEPT
Stels [109]
Climate seems like the correct answer
8 0
3 years ago
A high school teacher conducted a test of a new approach to teaching math. Students were given a pretest when their math class b
MakcuM [25]

Answer:

It represents a threat of instrument change.

Explanation:

Internal validity is a method to determine if research has been performed properly. It is based on the number of confounding variables present in the experiment. If an experiment is carried out and confounding variables are avoided, the internal validity is high, and viceversa. In an ideal context, the experiment's internal validity will be high, which will mean its results will be trustworthy.

The students, by making use of a computer software, lowered the validity of the test performed by the teacher.

5 0
4 years ago
1.Which of the following class definitions defines a legal abstract class?a. class A { abstract void unfinished() { } }b. class
xxMikexx [17]

Answer:(c) abstract class A { abstract void unfinished(); }

Explanation:

A legal abstract class must have the keyword abstract before the class and an abstract class has abstract functions with the keyword abstract written and a void as the return type.

8 0
4 years ago
Other questions:
  • To create an individual version of a slide, you would click
    9·1 answer
  • How do you close a document but keep the word processing program open?
    11·2 answers
  • What is the target audience for this poster?
    5·2 answers
  • What is a butt cap? (0.5 points)
    15·1 answer
  • _____ are agencies that specialize in offering services, such as database management, and the ability to create, produce, and di
    9·1 answer
  • Meg[] elements = {new Lois(), new Stewie(), new Meg(), new Brian()}; for (int i =0; i
    15·1 answer
  • Which command can be used to find errors on a hard drive​
    6·1 answer
  • The ______ printers are the most popular type of printer in small office/home office and large office environments.
    5·1 answer
  • If you decide you want to meet someone you met online, what should you do first? A. Tell your best friend. B. Call the person yo
    12·1 answer
  • What kind of script is used to run code on the client
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!