Slides0126 - COP 3330 Slides 1/26 Topics Math Methods...

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

View Full Document Right Arrow Icon
Slides 1/26 COP 3330
Background image of page 1

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

View Full DocumentRight Arrow Icon
Topics Math Methods Errors Classes and methods
Background image of page 2
Math Methods These are static methods. That means they are called on the Math class (it doesn't make sense to have a Math object) - abs() : Takes in an int and returns its absolute value - sin(), cos(), tan() : Take in doubles and perform trigonometry. These functions use radians, not degrees
Background image of page 3

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

View Full DocumentRight Arrow Icon
Math Methods More Math methods - pow() : Takes in two doubles and returns the first raised to the power of the second - random() : Takes in no parameters and returns a random double in the range from 0.0 to 1.0, including 0, but excluding 1. - sqrt() : Takes in a double and returns its square root
Background image of page 4
Errors Compilation Errors - Syntax Errors - Sematic Errors Runtime Errors Logic Errors
Background image of page 5

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

View Full DocumentRight Arrow Icon
Syntax Errors A syntax error is when the grammar of the language is broken Common examples - Missing semicolon - Unmatched curly brace - Misspelled keyword
Background image of page 6
Semantic Errors A semantic error is when the syntax is valid, but a statement has an invalid
Background image of page 7

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

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

This note was uploaded on 02/09/2010 for the course CS COP 3330 taught by Professor Douglass during the Spring '09 term at University of Central Florida.

Page1 / 20

Slides0126 - COP 3330 Slides 1/26 Topics Math Methods...

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

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