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
Consider two decision problems X and Y. If X reduces in polynomial time to 3-SAT and 3-SAT reduces in polynomial time to Y. Whic
tekilochka [14]

Answer:

X is in NP and Y is in NP-HARD ( A )

Explanation:

X is in NP and Y is in NP-HARD can be inferred from the previous statement made in the problem above because  problem decision X  can be in NP if it can BE reducible to a 3-SAT polynomial real time, if that can be achieved then  3SAT will be in NP since SAT is in NP as well.

also problem decision Y  can be in NP-HARD if 3SAT can be reducible to it in polynomial time as well hence option A is the correct option

8 0
3 years ago
Desinated for a network connection within a largecity or multiple small citys
frozen [14]

I think it is WAN (Wide Area Network).

6 0
3 years ago
How many types of windows does Python use?
Ksivusya [100]

Answer:

Four types

Explanation:

The python windows starts form windows 7.

All types of python windows are

  1. Windows 7
  2. Windows 8
  3. Windows 10
  4. Windows 11
5 0
3 years ago
Which one is better AMD Ryzen 5 Or Nvidia Gtx 2080 ti
Oliga [24]

Answer:

The NVIDIA GTX 2030 Ti

Explanation:

The AMD Ryzen 5 is good for a starting gaming PC, but if you are looking for a gaming PC that could run a lot more games, use the NVIDIA GTX 2080 Ti.

8 0
3 years ago
Answer ASAP, I'll try to give a brainliest answer, five stars, and a thanks.
4vir4ik [10]
I would say it is a short term effect because things like wheat grow back, and the other ingredients are generally also able to be replenished. You wouldn’t be taking resources that are nonrenewable.
7 0
3 years ago
Read 2 more answers
Other questions:
  • If it malfunctions and I can throw it, then it's a hardware problem; if I have to yell at it because there is nothing to pick up
    14·2 answers
  • what is the opportunity cost of buying a $.75 soda everyday at school for 3 years instead of drinking water ? assume you are in
    10·2 answers
  • I NEED HELP RIGHT NOW !!!!!!!!!!!!!!!1
    10·2 answers
  • What is the first thing you should do before constructing a window in the IDE?
    14·1 answer
  • 6. What are the two keyboard keys you can press at the same time to use the Copy command? (1.0 points)
    12·1 answer
  • A(n) ________ CPU has two processing paths, allowing it to process more than one instruction at a time.
    9·2 answers
  • Ian recently earned his security certification and has been offered a promotion to a position that requires him to analyze and d
    6·1 answer
  • If the executives for Office Max LLC, a chain of office supply stores, developed the chain's objectives by asking buyers and sto
    11·1 answer
  • The winning design is typically that which most closely meets the design
    11·1 answer
  • What is the launching of a 3-D map called?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!