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
professor190 [17]
4 years ago
9

Visual Basics: 1 ) Write an if/else statement that compares the double variable pH with 7.0 and makes the following assignments

to the bool variables neutral, base, and acid:
false, false, true if pH is less than 7

false, true, false if pH is greater than 7

true, false, false if pH is equal to 7

2) Visual Basics: Write an if/else statement that adds 1 to the variable minors if the variable age is less than 18, adds 1 to the variable adults if age is 18 through 64, and adds 1 to the variable seniors if age is 65 or older.
Computers and Technology
1 answer:
Lemur [1.5K]4 years ago
6 0

Answer:

visual basic: 1)

Module PHmodule

   Sub Main()

       'Creating a variable for each entity

       dim ph as double = 0.0, neutral,base,acid as boolean

       'Writing a line to show user what to do

       console.writeline("Enter the pH :")

       'Taking the value

       ph=console.readline()

       'using if & elseif statement for distingushing the values into correct catagories

       if ph<7.0 then

       neutral=false:base=false:acid=true

       elseif ph>7.0 then  

       neutral=false:base=true:acid=false

       elseif ph=7.0 then

       neutral=true:base=false:acid=false

       end if

       'Printing the result

       console.writeline(" Neutral :" & Neutral)

       console.writeline(" base :" & base)

       console.writeline(" acid :" & acid)

       'command for staying in the command prompt for reading the result

       console.readline()

   End Sub

End Module

visual basic: 2)

Module AGEmodule()

  Sub Main()

       'Creating a variable for each entity

       dim age,minors,adults,seniors as integer = 0

       'Taking age from user

       console.writeline("Enter the age")

       age=console.readline()

       'using if & elseif statement for checking the age differnce

       if age<18 then'

       minors +=1

       else if age>18 and age<64 then

       adults +=1

       else if age>64 then  

       seniors +=1

       end if

       'printing result

       console.writeline("minors="&minors)

       console.writeline("adults="&adults)

       console.writeline("seniors="&seniors)

       'command for reading the result  

       console.readline()

  End Sub

End Module

Explanation:

visual basic 1) it is very simple program which allow us to find if the substance is acidic, basic or neutral. we use sim statement for making a variable as double (gives value in decimal) which allow to take a value from the user through console.readline() command and then by using the if statement we apply the condition if the ph is less then, greator then or equal to 7.0 value. thus the program gives us the answer. console.writeline() command is used to print a command on the screen while console.readline() command let us read the lines until we press enter.

visual basic 2)a program which allow us to count and add number of persons according to their age. we use dim statement for creating the variable as integers in which we take the age from user and then after checking it through if statement we increment according to three categories i.e. minors, adults, seniors. the console.writeline() command allow us to print anything on screen and console.readline() allowus to take value while compiling.

thank you...

You might be interested in
Without a/an ________. a computer is useless
Len [333]
Without a/an Operating system. a computer is useless
3 0
3 years ago
Which of the following statements will ivoke the function get_course and store the reutrn values correctly? A. get_course(course
Sergio039 [100]

Answer:

Option D is the correct answer for the above question

Explanation:

Missing code: The function code is missing in the question, which defined the two return value.

Detailed Expalanation:

  • The above question code is in python language, which returns the two values. So there are needs of two variable which is needed to hold the returned value from a function.
  • Options b and c both states the two variable for the calling function which needs to hold the returned value and the option D states both option, hence it is a correct option while the other is not because:-
  • Option a states no variable which can hold the returned value.
4 0
3 years ago
Where Can I Get Actual Microsoft AZ-900 Exam Questions?
Pachacha [2.7K]

Answer:

Pls check the site "examtopics"

U fill find ur questions there

8 0
4 years ago
What is pseudocode? O A way of describing a set of instructions in text form using plain english O A diagrammatic representation
Marat540 [252]

The definition of pseudocode is that; A: A way of describing a set of instructions in text form using plain English

<h3>What is Pseudocode? </h3>

In computer science, pseudocode is defined as a plain language description of the steps in an algorithm or another system.

Now, the way Pseudocode works is that it often makes use of structural conventions of a normal programming language to be utilized for human reading instead of machine reading.

Pseudocode usually omits details that are essential for machine understanding of the algorithm, such as variable declarations and language-specific code.

Read more about Pseudocode at; brainly.com/question/11623795

8 0
3 years ago
All sensitive media on a laptop should be encrypted.
Inessa05 [86]

true very very true it could get stolen if not (well either way) but it is better encrypted

8 0
3 years ago
Other questions:
  • What is generalization error in terms of the SVM? a. How accurately the SVM can predict outcomes for unseen data b. How far the
    5·1 answer
  • In the context of wireless signal propagation, the phenomenon that occurs when an electromagnetic wave encounters an obstruction
    14·1 answer
  • Major stress in your life can cause:
    11·2 answers
  • How do you suppose a request travels from one computer to another? How does the request know where to go?
    8·1 answer
  • A web feed:
    7·2 answers
  • Read three integers from user input. Then, print the product of those integers. Ex: If input is 235, output is 30. Note: Our sys
    7·1 answer
  • Software that displays advertising material when online.
    12·2 answers
  • When power is completely removed from your computer
    11·1 answer
  • Which IDEs support multiple high-level programming languages? Select all that apply.
    13·1 answer
  • I just logged onto brainly and all my questions were deleted and i lost 2 brainliest. What has brainly done to my account I also
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!