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
How to write a self-analysis essay
Ray Of Light [21]

Self-assessment essay writing steps

Outline your thesis.

Describe your performance on recent projects.

Describe your strengths and weaknesses.

Describe your goals.

<h3>HOPE THIS ANSWER IS HELPFUL TO U :)</h3>
4 0
3 years ago
What operating system was most commonly used by early personal computers? Apple Mac MS-DOS Windows
marshall27 [118]
Windows, its oldest
8 0
2 years ago
Read 2 more answers
Among your selection in different online interfaces, which are your top three favorites?​
topjm [15]
What is this ? History or ?
6 0
3 years ago
Read 2 more answers
There have not been any changes to instruments or music in the last 50 years. The technology in music is still the same.
aliya0001 [1]

Answer:

False i hope this is rigth

7 0
2 years ago
George enters the types of gases and the amount of gases emitted in two columns of an Excel sheet. Based on this data he creates
Alex777 [14]

Answer:

data source

Explanation:

The main aim of a data source is for the gathering of all necessary information that is needed to access a data. Since he has used the information to create a pie chart, this means that some data were used for the creation of this pie chart. Hence the information used for the creation of the pie chart is the data source for the information illustrated on the pie chart.

3 0
3 years ago
Other questions:
  • An is auditor reviewing a network log discovers that an employee ran elevated commands on his/her pc by invoking the task schedu
    10·1 answer
  • Pressing the e key while in edit mode will exit the interaction mode<br><br> true<br><br> false
    7·1 answer
  • What output is displayed when the code that follows is executed? HashMap sales = new HashMap&lt;&gt;(); sales.put("January", 389
    12·1 answer
  • ALGUEM SABE COMO MUDA O NOME DE PERFIL!?!?!? SE SOUBER ME AJUDA!!
    14·1 answer
  • What is trouble shoot​
    11·1 answer
  • What are the four types of technical drawing?​
    9·1 answer
  • Technologies can offer safety and protection for people
    11·1 answer
  • Help with this quiz question thank you!
    12·2 answers
  • Snippet 1: check_file_permissions.c #include
    9·1 answer
  • Do you guys answer questions about cyber security?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!