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
Jayden wants to take a current theme but just change a little bit of it. Complete the steps to help Jayden.
Georgia [21]

Answer:

Go to the  

✔ Page Layout

tab on the ribbon and the  

✔ Themes

group.

Click Themes and select one.

Go into the workbook, make the changes, and return to the Themes gallery.

Select  

✔ Save Current Theme

to save the changes.

Explanation:

yup

4 0
3 years ago
Write a class Example() such that it has a method that gives the difference between the size of strings when the '-' (subtractio
Mariulka [41]

Answer:

class Example:

def __init__(self, val):

self.val = val

def __gt__(self, other):

return self.val > other.val

def __sub__(self,other):

return abs(len(self.val) - len(other.val))

def main():

obj1 = Example('this is a string')

obj2 = Example('this is another one')

print(obj1 > obj2)

print(obj1 - obj2)

main()

\color{red}\underline{Output:}

3 0
3 years ago
Write an INSERT statement that adds this row to the Categories table: category_name: Brass Code the INSERT statement so MySQL au
nexus9112 [7]

Answer:

Query:

insert into Categories (category_name) values ('Brass Code');

Explanation:

  • The query is a medium through which a user of the database can communicate with the database or tables or any particular data. It means that when a user wants to access the database or tables or any data then there is a medium of query which is also known as SQL query.
  • The query can help to make the database(which is a collection of tables), make the table in the database, add the data, modify the data or delete the data.
  • For add the data there is a insert query which syntax is as follows: insert into table_name (column_1_name,column_2_name,....,column_n_name) values (column_1_values,column_2_values,....,column_n_values);
  • There is only one column value in the question which a user needs to add so that can be done by the help of a statement that is defined on the answer part.
5 0
4 years ago
Which ribbon tab is used to locate the Backstage view and to configure the global Outlook options?
spayn [35]
The file tab helps with locating the backstage view
7 0
3 years ago
Read 2 more answers
All of the following are likely to be the benefits of a college graduate except:
Firdavs [7]
B. Earn less money over time

Over time, the interest is added to the principal, earning more interest. That's the power of compounding interest. If it is not invested, the value of the money erodes over time.
8 0
2 years ago
Other questions:
  • Assume that we would like to expand the MIPS register file to 128 and keep the size of all other fields as in the original MPIS
    7·2 answers
  • A parameter is a numerical measure that describes a characteristic of a sample. Choose One • 4 points True False
    6·1 answer
  • In a ____ queue, customers or jobs with higher priorities are pushed to the front of the queue.
    14·1 answer
  • ________ development is the term used to describe an information system development methodology that emphasizes flexibility and
    11·1 answer
  • How are computers used in education and entertainment? List them.​
    10·1 answer
  • Write a job back with my best Interest
    6·2 answers
  • What are the common camera hazards? When might you encounter these hazards in your life, and what do you plan to
    14·1 answer
  • Explain how will you know the number of slides used in the presentation.​
    15·1 answer
  • Which section of a PCM is responsible for sending the proper reference voltage to many of the sensors?
    7·1 answer
  • Moses wants to update the interface of a router. He plans on having a check on the current running configuration file and then w
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!