=====
CS 111 - Week 11 Lecture 2 - 2025-11-06
=====
=====
TODAY WE WILL:
=====
* announcements
* Exam 2 Review
* if time: continue with local variables,
hopefully adding in some interactive input
* prep for next class
=====
* should be working on Homework 9!
* at-least-first-attempts due by 11:59 pm on Friday, November 7!
* TOMORROW, Friday, November 7
* Humboldt CS alum Sierra Ventuleth
* Site Reliability Engineer at Google
* Holding an AMA (Ask Me Anything) Event
in BSS 204 from 1:00 - 3:00 pm
* if not yet done for Spring 2026 advising:
MEET WITH YOUR ADVISOR(S)!
* RE-CREATE your DARS plan!
* get ready to REGISTER for SPRING 2026 between November 10-21!
* CS and SE majors:
* in Spring 2026, you should take:
CS 112 - CS Foundations 2
Math 253 - Discrete Math
* You CAN take Math 101T - Trigonometry and Math 253 CONCURRENTLY
* You CAN ask to switch to another ENGL 103 section if it conflicts
with a major requirement such as CS 112 or Math 253 that you need
to stay on-track in your major!
=====
UPCOMING SCHEDULE NOTES
=====
* EXAM 2 is THURSDAY, NOVEMBER 13
* we'll review for that in-class TODAY
* yes! clicker questions! and an exam review handout!
* Friday, November 7 - there IS a lab exercise!!!
* and at least 1st attempts at Homework 9 due by
11:59 pm on Friday, November 7
* final improved versions of problems from Homeworks 7-9
are due by 11:59 pm on MONDAY, NOVEMBER 10
so that example solutions to these can be available
on Canvas at 12:01 am on TUESDAY, NOVEMBER 11
* Tuesday, November 11 - Humboldt's Veterans Day Holiday - campus
is closed
* Wednesday, November 12 - LA-run Exam 2 Review Sessions
* 9:00 am - 10:50 am - Kai and Enrique
* 3:00 pm - 4:50 pm - Ambrose and Raul
* LOCATIONS TO BE ANNOUNCED
* 4.5 clicker bonus points for attending and participating
in one or both of these
* (OK to come to part of one if your class conflicts, etc.,
as long as you participate...)
* Thursday, November 13 - EXAM 2
* Friday, November 14 - there WILL be a lab...!
=====
cin and getline - two iostream tools for interactive
input in C++
=====
* cin is an object defined in the iostream library
cin has an operator >>
* when followed by something that can be assigned to --
such as a local variable --
then the program stops, waits for the user to
enter something into standard input (typically the
keyboard),
and based on the type of the local variable
tries to convert what was typed into a value of that
type and assign it to that local variable
* NOTE: the user needs to be TOLD somehow that they need
to enter something!
* (otherwise the program just stops and waits for
them to enter something, and they do no know why!)
...so typically there is a cout statement
BEFORE the statement using cin and >>
asking the user to enter something!
* that is, use cout to print an appropriate
prompt message!
* for example (and this is also demo'd in 111lect11-2.cpp):
char desired_grade;
cout << "Enter a desired letter grade: ";
// because desired_grade is of type char,
// the program will stop, wait for the user
// to enter a non-blank-or-newline character,
// then will read it in, try to convert it to
// char, and try to assign it to desired_grade
cin >> desired_grade;
// and now that local variable desired_grade contains
// what the user entered
cout << "The description for that grade is: "
<< describe_grade(desired_grade) << endl;