TrueErase: Secure Deletion on Flash Storage Sarah Diesburg, Chris Meyers, An-I Andy Wang 10/8/2015.
Early Program Design Intro to Computer Science CS1510 Dr. Sarah Diesburg.
-
Upload
hilary-watts -
Category
Documents
-
view
217 -
download
0
Transcript of Early Program Design Intro to Computer Science CS1510 Dr. Sarah Diesburg.
![Page 1: Early Program Design Intro to Computer Science CS1510 Dr. Sarah Diesburg.](https://reader036.fdocuments.in/reader036/viewer/2022082506/5697c00d1a28abf838cc9376/html5/thumbnails/1.jpg)
Early Program Design
Intro to Computer Science
CS1510
Dr. Sarah Diesburg
![Page 2: Early Program Design Intro to Computer Science CS1510 Dr. Sarah Diesburg.](https://reader036.fdocuments.in/reader036/viewer/2022082506/5697c00d1a28abf838cc9376/html5/thumbnails/2.jpg)
Problem #1Calculating 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
2
![Page 3: Early Program Design Intro to Computer Science CS1510 Dr. Sarah Diesburg.](https://reader036.fdocuments.in/reader036/viewer/2022082506/5697c00d1a28abf838cc9376/html5/thumbnails/3.jpg)
Calculating Olympic Prize Money How much money did they pay?
Total (46/29/29) *** Michael Phelps (4/2/0) Missy Franklin (4/0/1) Ryan Lochte (2/2/1)
*** Treats a team medal as one prize, not multiple prizes.
3
![Page 4: Early Program Design Intro to Computer Science CS1510 Dr. Sarah Diesburg.](https://reader036.fdocuments.in/reader036/viewer/2022082506/5697c00d1a28abf838cc9376/html5/thumbnails/4.jpg)
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
4
![Page 5: Early Program Design Intro to Computer Science CS1510 Dr. Sarah Diesburg.](https://reader036.fdocuments.in/reader036/viewer/2022082506/5697c00d1a28abf838cc9376/html5/thumbnails/5.jpg)
We can do that !
5
![Page 6: Early Program Design Intro to Computer Science CS1510 Dr. Sarah Diesburg.](https://reader036.fdocuments.in/reader036/viewer/2022082506/5697c00d1a28abf838cc9376/html5/thumbnails/6.jpg)
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/29/29) Michael Phelps (4/2/0) Missy Franklin (4/0/1) Ryan Lochte (2/2/1)
![Page 7: Early Program Design Intro to Computer Science CS1510 Dr. Sarah Diesburg.](https://reader036.fdocuments.in/reader036/viewer/2022082506/5697c00d1a28abf838cc9376/html5/thumbnails/7.jpg)
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
7
![Page 8: Early Program Design Intro to Computer Science CS1510 Dr. Sarah Diesburg.](https://reader036.fdocuments.in/reader036/viewer/2022082506/5697c00d1a28abf838cc9376/html5/thumbnails/8.jpg)
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
8