{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# LAB4 - CS180 Lab 4 Lab Goals For this lab you will learn...

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

CS180 Lab 4 Lab Goals For this lab you will learn how to use ratio's to change the result of print statements. Use parsing/casting to determine letter grade from number grade. Using Ratio's For this lab you will have to use an ascii table, found here http://www.asciitable.com/. if you recall an int truncates all numbers, so 3.24 becomes just 3. This can be very valuable since it becomes very easy to round off numbers and determine if they are within a set range. Say you are filling a cylinder with water and you want to know if the water is in the top half or bottom, by dividing the current level of the water by the half way marker and type casting it as an int you are able to get a 0 if it is in the lower half and a 1 if it is in the lower half. This is also very valuable for something such as a well which has a cylinder with spherical ends, each of which needs a different calculation for area, you can determine which calculation of area to use by using ratios.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

LAB4 - CS180 Lab 4 Lab Goals For this lab you will learn...

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

View Full Document
Ask a homework question - tutors are online