Search Header Logo
Expressions and Output

Expressions and Output

Assessment

Presentation

Computers

9th - 12th Grade

Practice Problem

Easy

Created by

Katherine Valenti

Used 1+ times

FREE Resource

65 Slides • 8 Questions

1

Expressions and Output

2

Students will be able to...

  • Differentiate between System.out.print and System.out.println

  • Format output using escape sequences

  • Write and evaluate arithmetic expressions in Java

  • Predict and explain output of integer vs. floating-point division

3

Warm Up

4

Open Ended

What are some examples of programs or apps that format their output for readability?

5

Warm Up

  • Chat apps

  • Email

  • Game User Interfaces

6

Open Ended

Why might it be important to control where a line break happens in your output?

7

Warm Up

  • Ensure clarity

  • Align Text

  • Match expected formatting

8

Open Ended

What kind of math do you think computer programs need to do?

9

Warm Up

  • Basic addition

  • Complex data analysis

  • Predictions

10

media

11

media

12

media

13

media

14

media

15

media

16

media

17

media

18

media

19

media

20

media

21

media

22

media

23

media

24

media

25

media

26

media

27

media

28

media

29

media

30

media

31

media

32

media

33

media

34

media

35

media

36

media

37

media

38

media

39

media

40

media

41

media

42

media

43

media

44

media

45

media

46

media

47

media

48

media

49

media

50

media

51

media

52

media

53

media

54

media

55

media

56

media

57

media

58

media

59

media

60

media

61

media

62

media

63

media

64

Now It's Your Turn!

  • Head to CodeHS and access the Expressions and Output (Day 2) modules. You will be completing:

    • How Many Gigs?

    • Tricky Integer Division

    • Weight of a Pyramid

    • Tip Calculator

    • Exploration: Temperature Conversion

65

Wrap Up

66

Match

Match the following concepts

Prints out a line of output to the user

Print output to the user, without ending the line printed

Divides 2 numbers and returns the remainder, uses a % symbol

When 2 integers are divided, the decimal values are truncated or chopped off

System.out.println

System.out.print

Modulus/Modulo/Mod

Integer Division

67

Match

Match the following concepts

Characters with special meanings

Combination of numbers, operators, and sometimes variables that compute a value

Trim digits of a double-type number

Escape Sequence

Arithmetic Expression

Truncation

68

Open Ended

How does System.out.print behave differently from System.out.println?

69

Wrap Up

  • print keeps output on the same line

  • println adds a new line after the text

70

Open Ended

Why do we sometimes get unexpected results with integer division?

71

Wrap Up

  • It will truncate the decimal number and not round it

72

Open Ended

How can escape sequences help make your output clearer or more readable?

73

Wrap Up

  • Allow structured, multi-line output while using only one print statement

Expressions and Output

Show answer

Auto Play

Slide 1 / 73

SLIDE