230F09Assign2 - .5 3 Enter the first number 3 Enter the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE/EEE 230 Fall 2009 Assignment 2 Due Sept 22 11:59PM Write a program to do the following: 1. Print your name 2. Using a bottom testing loop, prompt the user to enter a number from 1 to 5. If the number entered is not 1. .5, print a message. Your program should continue to prompt and read until a value from 1. .5 is entered. 3. Using a top testing loop, repeat the following. The number of times to repeat is the number entered in step 2 (1. .5). a. Prompt for and read two integers. b. Print the absolute value of the difference of the numbers. c. If the first is less than or equal to the second, print the sum of the numbers from the first THROUGH the second. Otherwise print an error message. 4. Print a message and then stop Example input and output Tom Smith Enter a number 1. .5: 0 Input is out of range Enter a number 1.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: .5: 3 Enter the first number: 3 Enter the second number: 3 Absval of difference = 0 Sum of values = 3 Enter the first number: 2 Enter the second number: 8 Absval of difference = 6 Sum of values= 35 Enter the first number: 5 Enter the second number: -2 Absval of difference = 7 Sum of values cannot be determined Program ending Specifics: Use only the instructions covered to date. Add labels as needed for the if-else and loop. Your program will end whe – this is expected. Document the beginning of your program with your name, class, and assignment number. Document every instruction. Assignment 1 submittal: Submit your assembly language program file. Remember you can only submit once. If your file is correctly uploaded, then you will see an exclamation mark (!) for the grade....
View Full Document

This note was uploaded on 09/28/2009 for the course CSE 230 taught by Professor Calliss during the Spring '08 term at ASU.

Ask a homework question - tutors are online