Search Header Logo
Intro to Algorithms, Programming, and Compilers

Intro to Algorithms, Programming, and Compilers

Assessment

Presentation

Computers

9th - 12th Grade

Practice Problem

Easy

Created by

Katherine Valenti

Used 3+ times

FREE Resource

78 Slides • 10 Questions

1

Intro to Algorithms, Programming, and Compilers

2

Students will be able to...

  • Define and construct step-by-step algorithms for real-world and computing tasks

  • Identify the structure of a basic Java program and use System.out.println() to display output

  • Describe and demonstrate the compilation and execution process of a Java program

  • Identify and correct syntax errors through debugging exercises

3

Warm Up

4

Open Ended

What are some tasks you do every day that involve steps?

5

Warm Up

  • Making lunch

  • Brushing your teeth

  • Tying your shoes

6

Open Ended

What would happen if someone skipped a step or got them out of order?

7

Warm Up

  • The task might not work

    • Your sandwich is missing something

    • Shoes may come untied

8

Open Ended

What do you think a computer needs in order to complete a task?

9

Warm Up

  • Needs a list of steps to follow

10

media

11

media

12

Algorithms

  • Computers aren’t very good at coming up with ideas for themselves

    • They’re very good at following step-by-step instructions

  • Algorithms are at the heart of computer programming

media

13

media

14

media

15

media

16

media

17

media

18

media

19

Open Ended

Choose a task that you do frequently, such as making the bed, driving to school, making your lunch, or packing your backpack. Create an algorithm for your task by writing a list of step-by-step instructions. Try to break the task down into small steps so that anyone could follow your steps.

20

Example

  1. Brush bottom-right quadrant of teeth for 30 seconds.

  2. Brush top-left quadrant of teeth for 30 seconds.

  3. Brush bottom-left quadrant of teeth for 30 seconds.

  4. Spit out toothpaste.

  5. Turn on water.

  6. Drink some water, rinse, and spit.

  7. Turn off water.

  8. Put down toothbrush.

  1. Get toothbrush and toothpaste

  2. Turn water on.

  3. Get the bristles of the toothbrush wet.

  4. Turn the water off.

  5. Open toothpaste lid and squeeze a pea-sized amount of paste on the bristles of toothbrush.

  6. Brush top-right quadrant of teeth for 30 seconds.

21

media

22

media

23

media

24

media

25

media

26

media

27

media

28

media

29

media

30

media

31

media

32

Creating the Main Class

  • Notice that each word is lowercase

  • public means that something is accessible by everyone

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

49

media

50

media

51

media

52

media

53

media

54

Text Editor

  • A plain text editor is one of the most basic text editing programs

    • You can create and edit text, but there is no text formatting or styling

  • A text editor also isn’t able to run code

media

55

media

56

media

57

media

58

media

59

media

60

media

61

Syntax

media
media

62

media

63

media

64

media

65

media

66

media

67

media

68

media

69

media

70

media

71

media

72

media

73

media

74

media

75

media

76

Open Ended

Write an analogy to describe the process of compiling and executing code. Think of a real-world activity that mirrors the steps of writing, compiling, and running a program.

77

Compilation and Execution

  1. Writing the code is like writing the recipe

    1. You decide what ingredients to use, what steps to follow.

  2. Compiling the code is like prepping all the ingredients—chopping, measuring, and organizing them

    1. This ensures everything is in the right form and ready to go

    2. If there’s something missing or prepared incorrectly (like a syntax error), you’ll catch it before cooking.

78

Compilation and Execution

  1. Running the code is like making and baking the cake

    1. You mix all of the ingredients together and put your batter in the oven (execute the program)

    2. If everything is done correctly, you get a delicious cake (the desired output)

    3. If there’s an issue, like overcooking or missing a step (runtime error), the cake won’t turn out right

79

Now it's Your Turn!

  • Head to CodeHS and access the Introduction to Algorithms, Programming, and Compilers modules. Complete the following:

    • Debugging: Quotes

    • Compiling and Running Java

    • Explore the Exception Error

80

Wrap Up

81

Match

Match the following concepts

Fixing a problem in your code

Error in the sequence of words or rules in a program that prevents the program from running

Set of steps or rules to follow to solve a particular problem

Rules for writing code in a specific programming language

Debugging

Syntax Error

Algorithm

Syntax

82

Match

Match the following concepts

Java method that lets us print out a line of output to the user

Java method that lets us print output to the user, without ending the line printed

Java type that represents a string of characters (text)

System.out.println

System.out.print

String

83

Open Ended

What command is used to print in Java?

84

Wrap Up

  • System.out.println("text");

85

Open Ended

What happens if you forget the quotation marks or semicolon?

86

Wrap Up

  • A syntax error

    • Java expects specific formatting

87

Open Ended

Why is it important to understand how a program is compiled and executed?

88

Wrap Up

  • Helps you to understand how your code is translated into actions

  • Makes debugging earlier

Intro to Algorithms, Programming, and Compilers

Show answer

Auto Play

Slide 1 / 88

SLIDE