CSE 121 Sickness Edition - Autumn 2022 Lecture Highlights

Slide Note
Embed
Share

Dive into the world of CSE 121 with lead TAs Brett Wortzman and Elba Garza in the Autumn 2022 edition focused on sickness. Explore topics such as variables, strings, data types, and more. Stay updated on announcements, reminders, and assignments while learning about manipulating strings, string methods, and the importance of mixing types cautiously.


Uploaded on Sep 24, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. CSE 121: Sickness Edition! Brett Wortzman/Elba Garza CSE 121 Lead TAs Autumn 2022

  2. Announcements, Reminders Creative Project 0 due last night! How did it go? Programming Assignment 0 released; Due October 11th Reminder: Course website + Ed for all; not using Canvas Be respectful: In lectures, arrive & leave on time Lesson 3 - Autumn 2022 2

  3. Last Time Types & Simple Expressions int, double, String, boolean Mixing Types convert, or risk data loss! Operators For String & numericals Boolean Operators Precedence/ PeMMDAS Lesson 3 - Autumn 2022 3

  4. Plan for Today Variables & Strings Declaration & Initialization Manipulation Strings & chars String Methods Evermore Practice Work with folks around you! TAs will be wandering around Lesson 3 - Autumn 2022 4

  5. Variables Containers that store values of a specific data type. int version; // declare version = 5; // initialize To create a variable: 1. Declaration: Specify a data type (e.g. int, double, or String) and a name/label 2. Initialization: Store a value into it // declare AND initialize int version = 5; Lesson 2 - Autumn 2022 5

  6. Variables They re made to be manipulated, modified, re-used! int myFavoriteNumber = 27; int doubleFV = myFavoriteNumber * 2; myFavoriteNumber = myFavoriteNumber + 3; myFavoriteNumber = doubleFV; Lesson 2 - Autumn 2022 6

  7. Work on Variables Problems Ed lesson linked from the course calendar Work with the folks around you! TAs will be walking around to help Lesson 2 - Autumn 2022 7

  8. Strings String = sequence of characters treated as one, yet be indexed to individual parts Zero-based indexing Side note: new data type! char, represents a single character, thus use single quotes ;) Lesson 2 - Autumn 2022 8

  9. String Methods Methods used to manipulate/extract information from Strings Usage: <string variable>.<method>(<parameters>) Examples: length(): returns number of characters in String charAt(int): returns char at a specific index (int) of String indexOf(char/String): returns int index position of char/String equals(String): returns boolean whether Strings fully match or not contains(String): returns boolean whether String fully present or not Note: Methods do not modify the String variable they re called upon. Rather, you receive information! Lesson 2 - Autumn 2022 9

  10. Work on String Problems Ed lesson linked from the course calendar Work with the folks around you! TAs will be walking around to help Lesson 2 - Autumn 2022 10

Related


More Related Content