{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture 14

# Lecture 14 - Computer Applications for Business CS170 Fall...

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

CS170 Computer Applications for Business Fall 2008 Instructor: Kristian Stout Lecture 14 Arrays Readings: Chapter 21

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

View Full Document
Topics Useful String Methods Useful Math Methods Arrays
Useful String Methods var myString = “Foo Bar”; Changing case - myString.toUpperCase(); //returns string as Upper Case - myString.toLowerCase(); //returns string as Lower Case accessing pieces of the string: - myString.substring(0,2) // returns Fo - myString.indexOf('bar'); // returns 4 if nothing is found it returns -1 - myString.charAt(5); // returns a

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

View Full Document
Useful Math Methods var myNum = -1.456; var myNum2 = 1.456; Math.abs(myNum); //returns 1.456 - this returns the absolute value of a number Rounding - Math.round(myNum2) //returns 1 - Math.floor(myNum2) //returns 1 - Math.ceil(myNum2) //returns 2 Math.random() - returns a random number between 0 and 1 eg 0.1213 0.134 0.0563

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

View Full Document
Arrays What is an array ? Why do we need them ? Declaration Assignment Index and Value Accessing array elements Types of array Using Arrays with loops Array Examples

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 ]}