Arrays are lists that have a key or index associated with each item.
Ruby supplies the index to indicate the position of each entry on the list. The enumeration begins with
zero, not with the number one.
To initialize the array to let Ruby know we want on
In this session well go over a few routines weve not given enough time to in previous sessions.
We have had instances where we are looking for a certain criteria among several criteria.
When weve tried this in the past, we have used several if statements
Lets begin by creating a simple program.
Open Note Pad or any text-editor you like.
Type in the following:
Save the program:
File Save As save it to a location change the file type to All Files
the extension is impor
Up to now, we have just been writing programs that contain the values we assign to a variable.
We now want to allow the user to input the information, and assign the data to one or more variables.
This, of course, permits intera
There are hundreds of programming languages used today.
Which are the most in demand by employers, and what do they do?
According to Mashable.com the 10 most desired by employers are:
1) Java uses classes and Object Oriented Programming.
Its very accommod
Last Lab session, we actually took a look at variables.
To assign a value to a variable, we need to tell Ruby about it:
myString = '.you can say that again.'
This will display:
.you can say that again.
What do Variables real
In this lab, we want to manipulate text strings
We will write the program in a text-editor (notepad is fine, some people like J-edit, any one is fine).
Save the file as:
Change the File Type selection to A
Loops let us repeat a process until a given condition is met.
This program contains a for loop:
for i in 1.100
The output will be a simple list of all the integers from 1 to 100.
There are specific pieces to this:
For this tells Ruby that what
Flowcharting is a visual depiction of how a program works the algorithm.
Symbols representing points in the flow of the program are connected with lines to give the project team
(and the client) a picture to better understand w
1) Create a program that subtracts a withdrawal from a Savings Account, and returns the following
on the screen:
Starting Balance (This is decided by you)
Amount withdrawn (User input)
If the withdrawal