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]
3 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]3 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
Which word is most appropriate to describe a laptop?
Thepotemich [5.8K]
The best word to describe a laptop would be Portable
8 0
3 years ago
You want to chart your daily water intake over the next three months. Which type of chart would be best for this purpose? Line P
diamong [38]

The best type of chart to illustrate the daily water intake that you would be taking in the next three months would be (A) Line.

Line is most suitable because it will show the progression – be it the increase and decrease – of your water intake clearly, compared to using bar, which is more suitable if you would like to contrast your water intake with your soda intake, for example.

7 0
2 years ago
Using selection sort, how many times longer will sorting a list of 40 elements take compared to a list of 5 elements
Hoochie [10]

It will take 8 times more time to sort a 40-element list compared to the time spent on a 5-element list.

We can arrive at this answer as follows:

  • We can see that if we divide a group of 40 elements into groups containing 5 elements, we will have 8 groups.
  • In this case, the time it would take to sort the list of one group of 5 elements would be repeated 8 times so that we could sort all the groups and their elements.

Another way to do this is to divide the number 40 by 5. We would have the number 8 as a result, which indicates that we would need 8 times more time to sort a list of 40 elements, compared to a list of 5 elements.

You can get more information about lists at this link:

brainly.com/question/4757050

5 0
2 years ago
What is the output of a hash function called?
ruslelena [56]

Answer:

cryptographic hash collision.

Explanation:

4 0
2 years ago
When the wires are connected to the terminals of the battery, what causes electric current in the circuit?
Anastaziya [24]

Answer: The battery provides a voltage between terminals. The electric field set up in a wire connected to the battery terminals causes the current to flow, which occurs when the current has a complete conducting path from one terminal of the batter to the other. This is called a circuit.

Explanation:

4 0
3 years ago
Other questions:
  • An employee’s total weekly pay equals the hourly wage multiplied by the total number of regular hours plus any overtime pay. Ove
    13·1 answer
  • What should be used to clean LCD monitors? Liquid window cleaner Ammonia wipes Windshield washer liquid Antistatic monitor wipes
    15·1 answer
  • How do emotions affect purchasing decisions?
    6·1 answer
  • Differences between barcode reader and character recognition devices​
    9·2 answers
  • Any executable files???
    5·1 answer
  • PLEASE HURRY I WILL GIVE BRAILIEST TO WHO EVER ANSWERS AND IS CORRECT
    14·2 answers
  • 30 points Fill in the blanks,<br> Plz leave a explanation
    5·2 answers
  • Identify when programmers use an Else statement.
    15·2 answers
  • How is data written to a blockchain?
    10·1 answer
  • Explain how communication facilitate cordination​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!