Dry Run Fix it Write a program

Slides:



Advertisements
Similar presentations
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the basic concepts and uses of arrays ❏ To be able to define C.
Advertisements

Computer Science 1 How do you store a bunch of similar stuff?
Computer Science I: Understand how to evaluate expressions with DIV and MOD Random Numbers Reading random code Writing random code Odds/evens/…
Computer Programming 12 Lesson 6 – Loop structure By: Dan Lunney.
Computer Science 2 Arrays of Records. First Record Program Input an unknown number of Team Names, School names, and Total scores. (While loop) –Output:
GCSE COMPUTER SCIENCE Practical Programming using Python
Some Assignments  Write a program which prints the following information about at least 5 persons: NAME MAIL-ID EMPLOYEE-CODE PHONE Eg. Umesh
CSC111 Quick Revision.
Microsoft Visual Basic 2005: Reloaded Second Edition
Looping and Random Numbers
Chapter 8 Arrays Objectives
Program Options: 10 Minutes online
Program options Write a program for one of the following
Java Fix a program that has if Online time for Monday’s Program
How do you store a bunch of similar stuff?
More Loops.
Chapter 8 Arrays Objectives
Computer Science II First With files.
Computer Science II First With files.
int [] scores = new int [10];
Review Dry Run Taking Names Online time Math is Good
Computer Science 2 Arrays of Records.
Computer Science 2 Review the Bubble Sort
Continue on the Array of Records program
Computer Science 2 Arrays of Records.
Computer Science And he made a molten sea, ten cubits from the one brim to the other: it was round all about, and his height was five cubits: and.
Computer Science 2 Getting an unknown # of …. Into an array.
Dry run Fix Random Numbers
Program Options: 10 Minutes online
Java Fix a program that has if Online time for Monday’s Program
Topics discussed in this section:
Repeat Day2 Dry Run Second Repeat Program
Computer Science 1 1/19/2011 On the record (paper) write the following
Arrays.
Computer Science 2 Arrays of Records.
How do you store a bunch of similar stuff?
Computer Science 2 Tally Arrays 2/4/2016.
CS 2 Records 2/22/2018.
What do you do when you don’t know how to get started.
Arrays Part 2.
See requirements for practice program on next slide.
Chapter 8 Arrays Objectives
AP Java 9/21/2018.
Python Basics with Jupyter Notebook
How can you make a guessing game?
Computer Science II Second With files.
Sorting Develop a sorting algorithm
Computer Science 2 More Trees.
Computer Science 1 while
Computer Science 1 For..do loop Dry Run Take notes on the For loop
How can you make a guessing game?
Computer Science
How do you store a bunch of similar stuff?
Computer Science I: Get out your notes.
Continue on the Valentines program
Magpie/Chatbot Activity 5
Program options Write a program for one of the following
Dry Run Fix it Write a program
Hint idea 2 Split into shorter tasks like this.
10/27/2016 Dry Run 2 Case Programs Fix it Second Case Program
int [] scores = new int [10];
Computer Science 1 while
WJEC GCSE Computer Science
Algorithms For use in Unit 2 Exam.
 Is a machine that is able to take information (input), do some work on (process), and to make new information (output) COMPUTER.
Computer Science And he made a molten sea, ten cubits from the one brim to the other: it was round all about, and his height was five cubits: and.
How do you do the following?
A bit of Review Review, Dry Run, Program.
Computer Science II First With files.
Agenda Warmup Lesson 1.9 (random #s, Boolean variables, etc)
Presentation transcript:

Dry Run Fix it Write a program Computer Science 1 Dry Run Fix it Write a program

Learning Objectives Students will be able to read a program that incorporates arrays. Students will be able to write code to declare, input, output and compare values in an array. Students will be able to fix a program that uses arrays. Students will be able to write a program that uses arrays.

Dry Run for pos:= 1 to 5 do info[pos]:= pos*2; for pos := 1 to 5 do begin if (pos div 2) > 2 then info[pos]:= info[pos] + pos else info[pos]:= info[pos]*pos; end; writeln(info[pos]);

Your turn… Write the type and var section to create arrays to store the following 10 names 15 test scores

Try code Write the code to … Input 10 names into the array created previously Input 15 test scores Output all of the names Output all of the test scores Find and show the highest test score from the array

Fix it In the assignments folder there is a program called fixary1.pas It is supposed to input 10 scores, calculate the average of these score and the show all of the scores that are below average. See if you can fix it!!

Program options Enter 10 names and show the names in reverse order. Input: 10 scores Output: The number of scores within 10 points of the average of the 10 scores. (You’ll need to calculate the average before going back and seeing which scores are within 10 points of the average.) Create a random compliment generator using an array to store the compliments. Using a while loop (so the user can be complimented often) have the computer display one of at least 5 random compliments each time the user would like to be complimented.