Vous êtes sur la page 1sur 3

Ramesses Fuentes

2/12/2015
Assignment 1 CO INFO 790

1. Write the steps that will allow ask the user for two numbers. Add these numbers and print out the answer
DIM NUMBER 1
DIM NUMBER 2
DIM TOTAL NUMBER
PRINT ENTER FIRST NUMBER
INPUT NUMBER 1
PRINT SECOND FIRST NUMBER
INPUT NUMBER 2
Total = Number 1 + Number 2 Total = 1010001 + 1010010
PRINT TOTALNUMBER
2. Write the steps that will allow ask the user for two numbers. Multiple these numbers then divide the
product by two and print out the answer
DIM NUMBER 1
DIM NUMBER 2
DIM TOTAL NUMBER
PRINT ENTER FIRST NUMBER
INPUT NUMBER 1
PRINT ENTER SECOND NUMBER
INPUT NUMBER 2
TOTAL = (NUMBER 1 * NUMBER 2) / 2
TOTAL = TOTAL / 2

PRINT TOTALNUMBER
3. Write the steps to have the user input the person name, street address, city and state. Then print out the
values
DIM FIRSTNAME
DIM LASTNAME
DIM STREETADDRESS
DIM CITY
DIM STATE
PRINT ENTER YOUR FIRST NAME
INPUT FIRSTNAME
PRINT ENTER YOU LAST NAME
INPUT LASTNAME
PRINT ENTER YOU FULL STREET ADDRESS
INPUT STREETADDRESS
PRINT ENTER YOUR CITY
INPUT CITY
PRINT ENTER YOUR STATE
INPUT STATE
PRINT FIRSTNAME + LASTNAME + STREETADDRESS + CITY + STATE
4. Write the steps to solve the following equation. Answer = (A +B+C)*D
DIM A
DIM B
DIM C

DIM D
DIM ANSWER
PRINT WHAT IS THE FIRST NUMBER
INPUT A
PRINT WHAT IS THE SECOND NUMBER
INPUT B
PRINT ENTER THE THIRD NUMBER
INPUT C
PRINT WHAT IS THE FOURTH NUMBER
INPUT D
ANSWER = (A + B + C) * D
PRINT ANSWER
Were the user inputs the values for the variables A, B, C, D and the program output the answer.

Vous aimerez peut-être aussi