=====
CS 111 - Week 10 Lecture 2 - 2024-10-31
=====
=====
TODAY WE WILL:
=====
* announcements
* several examples of functions using if statements
* prep for next class
* should be working on Homework 8 -
at-least-first-attempts are due by 11:59 pm tomorrow,
Friday, November 1!
* get ready for Spring 2025 preregistration!
get your schedule ready, talk to your advisor, etc.!
=====
reminder: string method at
=====
* (mentioned in a clicker question during Week 10 Lecture 1)
* the at method expects an int, a position within a string,
and returns a char, the character at that position
within the string.
(The only odd part? positions start at 0...!
* The first character's position is 0 -- 0 steps from the beginning;
* the second character's position is 1: 1 step from the beginning;
and so on...)
so? if you declare:
const string LOOKY = "DEMO";
these are bool expressions whose value is true:
LOOKY.at(0) == 'D'
LOOKY.at(1) == 'E'
LOOKY.at(2) == 'M'
LOOKY.at(3) == 'O'