Introduction to CSE 121: Types and Simple Expressions - Autumn 2022

Slide Note
Embed
Share

Today's lesson in CSE 121 covers types and simple expressions in Java. Reviewing integers, doubles, strings, and booleans. Understanding operator precedence and practice problems. Explore how Java handles different types in expressions. Engage with TAs and classmates for assistance.


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. Welcome (back) to CSE 121! Brett Wortzman/Elba Garza Miya Natsuhara (just for today) Autumn 2022 Music: Hunter and Miya s Awesome CSE 122 22au Playlist

  2. Plan for Today Types and Simple Expressions (Review from the Pre-Class Work) int, double, String, boolean Operators Precedence (order of operations) Practice! Work with folks around you! TAs and I will be wandering around Lesson 2 - Autumn 2022 2

  3. Questions For logistical questions, post on the Megathread for today s lecture! (Members of the course staff will be monitoring) For questions for me during class, raise your hand or submit a questions anonymously: or visit: https://sli.do and use #cse121 Lesson 2 - Autumn 2022 3

  4. Types in Java ints (whole numbers) doubles (real numbers) Strings booleans (true or false) Lesson 2 - Autumn 2022 4

  5. Operators (for numerical and String values) + Addition - Subtraction * Multiplication / Division % Modulo or Mod + Concatenation Lesson 2 - Autumn 2022 5

  6. Precedence Parentheses Multiplication, Modulo, Division Addition (and Concatenation), Subtraction If multiple operators at the same level of precedence? Evaluate subexpressions from L to R Lesson 2 - Autumn 2022 6

  7. Work on Expressions/Types Practice Problems Part 1 Ed lesson linked from the course calendar Work with the folks around you! TAs and I will be walking around to help Lesson 2 - Autumn 2022 7

  8. Mixing Types When mixing types in an expression, Java will convert one type to the other and then perform the operation normally ints can be converted to doubles Both ints and doubles can be converted to Strings Lesson 2 - Autumn 2022 8

  9. Work on Expressions/Types Practice Problems Part 2 Ed lesson linked from the course calendar Work with the folks around you! TAs and I will be walking around to help Lesson 2 - Autumn 2022 9

  10. Boolean Operators ! Logical Not < > <= >= Relational Operators == != Relational Operators (equality) && Logical And || Logical Or Lesson 2 - Autumn 2022 10

  11. Work on Expressions/Types Practice Problems Part 3 Ed lesson linked from the course calendar Work with the folks around you! TAs and I will be walking around to help Lesson 2 - Autumn 2022 11

Related