summary05 - • Value Returned – the output from the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Examples of Predefined Functions 2.0 == sqrt(4.0) 8.0 == pow(2.0, 3.0) 7 == abs(-7) 70000 == labs(-70000) 7.5 == fabs(-7.5) 4.0 == ceil(3.9) 3.0 == floor(3.2) Summary Ch 3.1 – 3.2 Chapter 3.1 Top-Down Design Top-down design- Simplify complex programs by dividing into subtasks, or functions Functions make it easier for different people to work on subtasks Chapter 3.2 Predefined Functions Argument - the value inputted into the function; can be more than 1 argument in function
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: • Value Returned – the output from the function • #include <cmath> sqrt – square root o pow- powers o fabs-absolute value for double o ceil- ceiling (round up) o floor – floor (round down) • #include <cstdlib> o abs – absolute value for int o labs – absolue value for long • Important to typecast using o static_cast<double>(Expression_of_Type_int)...
View Full Document

This note was uploaded on 08/26/2009 for the course CS 140 taught by Professor Staff during the Fall '08 term at Southern Illinois University Edwardsville.

Ask a homework question - tutors are online