Common Computer Science References
At the end of this lesson, you will be able to:
understand the six (6) steps to solve any problem
understand how to use built in modules
review doing basic mathematical operations in code
the six (6) steps to solve a problem (or variations of this, see image below: ↓) are well known and used all the time
read Problem Solving, from textbook Computer Based Problem Solving
read the "Problem Solving" section, "Steps in Problem Solving" and "Example Problems"
up to and including "Folding Paper" example
go over modules and how to import them
import math
see video "Importing modules, in Python"
do "Folding Paper" experiment
read Problem Solving, Computer Based Problem Solving
read the "Problem Solving" section, "Steps in Problem Solving" and "Example Problems"
create a program that calculates the circumference of a circle with diameter 42 mm, with proper style and shows 5 decimal places (see terminal output below: ↓)
remember to use math.pi and not 3.14
C = πd
come up with this time just one (1) test case, BEFORE YOU WRITE THE CODE to ensure you know what the answer should be BEFORE you start coding
then check to ensure your answers are correct!
create the same above program in C
in C π is M_PI
in C we will be using "Libraries"
what we did above in python is actually a library as well, it is just more commonly referred to as a module
C has modules using an import statement as well, there are technical differences though
NOTE: You can turn on "Closed Captions" to see a printout of what is being said by selecting the "CC" button.
You can also have it translate the closed captions by going to "Settings, Subtitles/CC, Auto-translate" and then pick your prefered language.
NOTE: You can turn on "Closed Captions" to see a printout of what is being said by selecting the "CC" button.
You can also have it translate the closed captions by going to "Settings, Subtitles/CC, Auto-translate" and then pick your prefered language.