Input
This is how information is obtained from a user. The syntax is:
Input variablename
When a user enters a value, then the variable named will contain that value.
Set
This is a statement that sets the value of a variable. The syntax is:
Set variablename = expression
To the left of the equal sign is a variable name. To the right is an expression. When the expression is evaluated, the result is placed into the variable name.
For example:Declare var1 as IntegerSet var1 = 4 //This statement sets the value of var1 to 4Set var1 = var1 * 5 //This statement takes the value of var1, which is 4, multiplies it by 5, the result is 20, then 20 is then assigned to var1WriteThis statement writes information to a user display. You can write text and variables. The syntax is:Write expressionThe expression can be text strings and/or variables. You use the + operator, which in the Write statement means concatenation, to merge strings together.For example, if you had this code:Declare var1 as IntegerSet var1 = 4Set var1 = var1 * 5 Write “The value of var1 is “ + var1The user would see this output:The value of var1 is 20 Any questions on the above, post them here. | |
Write a program that computes and displays a 15 percent tip when the price of