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

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

Slides 1/26 COP 3330

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

View Full Document
Topics Math Methods Errors Classes and methods
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

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

View Full Document
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
Errors Compilation Errors - Syntax Errors - Sematic Errors Runtime Errors Logic Errors

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

View Full Document
Syntax Errors A syntax error is when the grammar of the language is broken Common examples - Missing semicolon - Unmatched curly brace - Misspelled keyword
Semantic Errors A semantic error is when the syntax is valid, but a statement has an invalid

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.

## 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
Ask a homework question - tutors are online