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

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

View Full Document Right Arrow Icon
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. To print out a number as a char you simply type cast it with System.out.println((char)
Background image of page 1

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

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

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 Right Arrow Icon
Ask a homework question - tutors are online