Intro to Computer Science CS1510 Dr. Sarah Diesburg

Slides:



Advertisements
Similar presentations
By Alexa.A and Andrew.L. Original Country The original country that the sport, Biathlon, is from is Scandinavia.
Advertisements

Convert fractions to decimals Addition of decimal numbers Compare fractions & decimals Multiplication of decimal numbers Convert decimals to fractions.
New Zealand New Zealand is an island country in the southwestern Pacific ocean. New Zealand is approximately 900 miles east of Australia.
SWIMMING TYPE WHERE SPECIAL WORDS SWIMMING STYLES EQUIPMENT
Sochi Olympics Your Name Today’s Date Insert picture.
3-6 Systems with 3 Variables Objectives: To solve systems in 3 variables by elimination. To solve systems in 3 variables by substitution.
12.3 Multiplying Rational Expressions Definitions Formulas & Examples Practice Problems.
Michael Phelps By Adam Livingston. What made Michael Phelps famous? Michael has the record for most gold metals won in the Olympics Michael has broken.
Year 4/5 Sam is 11 years old today. He has invited 6 friends to a party at McDonalds. Each child will have a “Happy Meal” costing £2.99 each. What is the.
Intro to Nested Looping Intro to Computer Science CS1510 Dr. Sarah Diesburg.
Subtract 1Subtract 3 Subtract same number Subtract numbers from their doubles Subtract 2.
Russia’s Summer Olympic Games History. U.S.S.R. The Olympic Games started in 1896 in Athens, Greece The U.S.SR. did not compete until 1952, these games.
Early Program Design Intro to Computer Science CS1510 Dr. Sarah Diesburg.
Thinking about programming Intro to Computer Science CS1510 Dr. Sarah Diesburg.
Problem Solving Intro to Computer Science CS1510 Dr. Sarah Diesburg 1.
Add 2 three digit numbers Balance addition equations Add 3 numbers of 3,2, 1 digits Add 4 digit numbers Complete addition equations.
Thinking about programming
0-4/0-5 Operations with Fractions
Affiliate Digital Offering NBC Sports and Olympics
Who can win more gold medals?
Who can win more gold medals?
Who can win more gold medals?
Module 6 Writing and Solving Two Step Equations
Who can win more gold medals?
Thinking about programming
Arithmetic Sequences and Series
Apply the Counting Principle and Permutations
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Intro to Computer Science CS1510 Dr. Sarah Diesburg
More Nested Loops and Lab 5
Who can win more gold medals?
Who can win more gold medals?
Thinking about programming
3-Variable Systems Algebra II Unit 1.
Who can win more gold medals?
Who can win more gold medals?
Who can win more gold medals?
Who can win more gold medals?
Intro to Nested Looping
Who can win more gold medals?
Thinking about Strings
Who can win more gold medals?
Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
Who can win more gold medals?
Double Your Money.
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Intro to Nested Looping
More Repetition While and For loop variations
Who can win more gold medals?
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Thinking about programming
Example of Country Brochure Project
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Thinking about programming
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
Year 2 Summer Term Week 9 Lesson 5
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Types, Truth, and Expressions
Who can win more gold medals?
0-4/0-5 Operations with Fractions
Who can win more gold medals?
Who can win more gold medals?
Who can win more gold medals?
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Who can win more gold medals?
Who can win more gold medals?
Who can win more gold medals?
Who can win more gold medals?
Pettit 10-2 Notes D1: Read and interpret graphs
Presentation transcript:

Intro to Computer Science CS1510 Dr. Sarah Diesburg Early Program Design Intro to Computer Science CS1510 Dr. Sarah Diesburg

Problem #1 Calculating Olympic Prize Money The USOC pays Olympic athletes who win medals the following in prize money: Gold $25,000 Silver $15,000 Bronze $10,000

Calculating Olympic Prize Money How much money did they pay? Total (46/37/38) *** Michael Phelps (5/1/0) Katie Ledecky (4/1/0) Simone Biles (4/0/1) *** Treats a team medal as one prize, not multiple prizes.

Steps in solving this problem Identify the prize money for each medal type (constant over each athlete). Obtain the number of gold, silver, and bronze medals for the athlete (different for each athlete). For each medal type, multiply the medal count with it’s prize amount. Sum these three values to get total money won Display total amount of money won

We can do that !

Calculating Olympic Prize Money (Summer Olympics) The USOC pays Gold $25,000 Silver $15,000 Bronze $10,000 How much money did they pay? Total (46/37/38) Michael Phelps (5/1/0) Katie Ledecky (4/1/0) Simone Biles (4/0/1)

Rules to Follow Always have a header comment block with a Title, Author, Comment, and Deadline See “Resources” page for Homework Submission Policy Take care of line wrap Good rule of thumb is not to have a line exceeding 60-70 characters Can look at “Col” field at bottom of IDLE to see where you are at

Rules to Follow Put a comment on top of each chunk of code for the human # Get the input for number of medals from user Use a consistent style camelCase c_style_naming Use constants Every time you have a literal number (like 25000) GOLD_PRIZE_AMOUNT=25000