Lab3-701 - ENGR 1412 INTRODUCTION TO COMPUTER PROGRAMMING F...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
ENGR 1412 – INTRODUCTION TO COMPUTER PROGRAMMING FALL 2011 Additional Project#3 Objectives For Parts 2b and 2c of the project, make sure that your program checks for valid inputs and prints (returns) a solution only if the user provides a valid input. Example: Consider a function to calculate the area of a circle. What is a valid input for this function? Can you have a negative value as an input for the radius? Can you calculate the area if the user inputs the character ‘a’ as an input for the radius? Make sure your final spreadsheet takes these points into account. So, if the user gave an input of ‘-1’ for the radius, your output should be something that tells the user ‘Invalid input. Only positive, numeric data allowed’. (You need to use what is called as the ‘if-else’ structure to accomplish this). General Syntax of the If-Else Structure: If expression Then Operations to perform - - - - - - - - - - - - - - Else Operations to perform - - - - - - - - - - - - - - End If
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 3

Lab3-701 - ENGR 1412 INTRODUCTION TO COMPUTER PROGRAMMING F...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online