1 / 7

Seating “ chart ”

Seating “ chart ”. Front. 4 rows. 5 rows. 5 rows. 4 rows. 2 rows. 2 rows. 5 rows. 5 rows. 4 rows. Back. 10/17/2014. Switch Intro and a few odds and ends. Character data type explained. Characters take 2 bytes in memory Under the covers they are ints

rwhitby
Download Presentation

Seating “ chart ”

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Seating “chart” Front 4 rows 5 rows 5 rows 4 rows 2 rows 2 rows 5 rows 5 rows 4 rows Back

  2. 10/17/2014 Switch Intro and a few odds and ends

  3. Character data type explained • Characters take 2 bytes in memory • Under the covers they are ints • Each int has a corresponding text symbol associated with it. • See CharDemo.java

  4. Ints and doubles compared • Just like any other operation, relational operators can only operate on the same data type. • So in a mixed operation, Java will attempt to widen the operands so that they match one another. • See CharDemo.java

  5. boolean data type • Variables of boolean type hold true or false. • We can declare variables of boolean and assign them values. • A boolean expression is anything that evaluates to true of false. A boolean expression must go in the parentheses of an if statement. • See CharDemo.java

  6. Logic problems • Your cell phone rings. Return true if you should answer it. • Normally you answer, except in the morning you only answer if it is your mom calling. • In all cases, if you are asleep, you do not answer. • Answer demo

  7. Switches • Given a value, choose from among many options. • Uses: • Menus • Options • Anything that has multiple discrete choices See SwitchDemo.java

More Related