Programming is a branch of Problem Solving
•Programming is a branch of problem solving by
giving instructions to computers through a
programming language like python, C, Java, etc.
•The domain of problem can be anything like
academics, healthcare, business, physical or social
sciences, arts, etc.
Problems can be simple
• Create a program that will calculate the user’s BMI.
• Create a program that will convert temperature from Fahrenheit to
Celsius.
• Given a student's grades for all of the assignments, calculate the final
score.
• A program that gives an employee $50 bonus for every 500 items sold
in a week.
• Given a DNA strings of length at most 1000 nt, return four integers
(separated by spaces) counting the respective number of times that
the symbols 'A', 'C', 'G', and 'T' occur in s.
Problems can be complex
• Given a set of random numbers like 3,2,55,43,65,100,1, sort them in
ascending order.
• Finding Disjoint Motifs in a Gene.
• Medical Image Analysis: Developing algorithms for the automated
analysis and interpretation of medical images such as X-rays, MRI
scans, and CT scans. This can involve tasks such as tumor detection,
organ segmentation, or anomaly identification.
• Clinical Decision Support Systems: Creating software tools that
integrate patient data, medical knowledge, and algorithms to assist
healthcare professionals in making clinical decisions. These systems
can help in diagnosis, treatment planning, and predicting patient
outcomes.
Strategy to solve the problems?
In order to solve a problem by giving instructions to computers
using any programming language in any field of domain we
must know:
1. How to understand the problem? This requires
knowledge of the field of domain of the problem.
2. How to design algorithm or the step-by-step solution of
problem. This requires knowledge of capabilities of
computers or what a computer can do?
3. Finally, how to develop the program? This requires rules
of programming language to give instructions to
computers.
1. Problem Identification:
1. Read and understand the “Original” problem statement by getting core and little bit additional
knowledge of that specific area of domain.
2. Define the problem by:
a. Identify different perspective of problems and remove ambiguities of both core and associated
problems by asking as many questions as you can.
b. Get Answers of the questions in step (a).
c. In the light of (b) clearly write/define the problem – “Redefined” Original Problem.
d. (If needed) Evaluate (c) and by simplifying (b)
Break down a big problem into sub-problems
Or
Make a simpler version of a complex problem.
e. In the light of (d) clearly re-write/re-define the problem – “Reduced” Redefined Original
Problem (x), where x is the number of reduced version.
Now here at this step we will move to Design algorithm step and then development step and then
will come back to problem identification step when there is versioning (d and e steps) of problem.
2. Design algorithm (Steps to solve the problem)
To design the algorithm, we must first know what are the basic capabilities of computer.
So computer basically follows Input-Process-Output(IPO) model to solve any problem. And to
carry out IPO, it needs to store the data.
Your analysis starts
here
The requirements of the Output
(Output here means the result of
program not the instructions of
output) , more than anything else,
will determine the requirements of
the System.
• Nearly every program you create in this course will follow these basic operations in that order exactly.
• As the programs grow in scale you may repeat this process multiple times in the same program.
I = Input
• Input is something from the external environment that is fed into the
system.
• In an information system, the inputs may be raw data "captured" in
some way or pre-existing data which has been provided by an external
system.
• In either case, the data input is provided by an external entity.
P = Process
• The transformation process is the most important element of a
system.
• The process accepts the inputs into the system and performs some
type of operation on it which transforms it into some other state. In
the simplest of terms, the process is at the heart of any system.
• In a computerised information system, the process is normally the
storage, retrieval and modification of data which is accomplished by
hardware and software.
O = Output
• Output from the system which is the result of processing the input.
• Without output, a system has no link back into it's external
environment.
• Output of an information system may be reports generated by an
information system, or a picture on a computer monitor, or even data
that is fed into another external system.
3. Develop the program:
Storage/Data Structures:
Steps to complete an IPO Model
Steps
1. Identify the output (result of program)
• Visualize the result of program and decide what data you will need for this
output.
2. Decide what data (the inputs) is required in order to get the required
output
• Sometimes these will be given to you, sometimes not, which means you
may need to invent inputs.
3. Once you have the outputs and the inputs you need to determine how
the inputs can be transformed into the required outputs. This is a
dynamic process which may mean you need to continually return to
the previous steps.
Example:
Original Problem Statement:
Create a program to “compute”
the BMI.
Example - Problem Identification:
a. Understand the problem:
Possible Questions:
Q Q
What is the purpose of program?
-Just to calculate BMI?
-Also generate remarks?
-Also give advices according to remarks like actions needed (This
may require additional data like age, gender, etc.)
-Is this intended to find insights from the data or any prediction or
something like that? (See comments)
Which formula to be used?
Should the program be designed for a “group” of specific audience
such as adults, children, athletes, etc.? Or just a single user?
Does program has the ability to input/output data from/to
files?
What output format is desired for the BMI result? Should it be
rounded to a specific number of decimal places?
Do we need to output the result with a chart or graph?
Should the program handle errors or invalid inputs gracefully?
Are there any specific design or user interface requirements for the
program, such as command-line interface (text-based), graphical
user interface, or web-based interface?
Example - Problem Identification:
b. Understand the problem:
Possible Questions with Answers:
Questions Answers Questions Answers
What is the purpose of program?
-Just to calculate BMI?
-Also generate remarks?
-Also give advices according to remarks
like actions needed (This may require
additional data like age, gender, etc.)
-Is this intended to find insights from
the data or any prediction or something
like that? (See comments)
Insights:
Analyzing aggregated BMI data to reveal
trends in population health, i.e. the
prevalence of obesity, overweight, and
underweight individuals within different
age groups.
Which formula to be used? As data can be given or taken in
any unit so all possible formulae
would be used in processing.
Should the program be designed for a
“group” of specific audience such as
adults, children, athletes, etc.? Or just a
single user?
Yes program will take data of a group of
individuals.
Does program has the ability to
input/output data from/to files?
Yes program should have ability to
read write using files also.
What output format is desired for the
BMI result? Should it be rounded to a
specific number of decimal places?
Rounded. Do we need to output the result
with a chart or graph?
yes.. As much as possible.
Should the program handle errors or
invalid inputs gracefully?
Should handle errors and allow for
retaking the inputs.
Are there any specific design or user
interface requirements for the program,
such as command-line interface (text-
based), graphical user interface, web-
based interface or file processing?
Program should allow both text and file
input.
Example - Problem Identification:
c. Define the problem – Redefined Original Problem
Develop a program that calculates BMI and analyzes trends in population health data such as
overweight, obesity and underweight individuals within different age groups.
The program should be able to handle different input formats including text and data files.
It should also be able to provide feedback or advice on how to improve health based on the user's BMI.
The results should be presented with no fractional part (i.e. should be rounded) for the BMI output and
if a chart or graph is needed.
The program should handle errors and allow for retaking the inputs.
Program result would be like this:
Example - Problem Identification:
d. Evaluate the Redefined original problem:
• Reduced Redefined Original Problem (1):
The simplest version:
Develop a program that calculates BMI of a user using metric system using text-based interface and display it with username. No error handling and no rounding is
required.
Questions Answers Questions Answers
What is the purpose of program?
-Just to calculate BMI?
-Also generate remarks?
-Also give advices according to remarks like
actions needed (This may require additional
data like age, gender, etc.)
-Is this intended to find insights from the data
or any prediction or something like that? (See
comments)
Just to calculate BMI Which formula to be used? Metric formula
Should the program be designed for a “group”
of specific audience such as adults, children,
athletes, etc.? Or just a single user?
Single user Does program has the ability to
input/output data from/to files?
No
What output format is desired for the BMI
result? Should it be rounded to a specific
number of decimal places?
No need to Round. Do we need to output the result with a
chart or graph?
No
Should the program handle errors or invalid
inputs gracefully?
No need to handle errors.
Are there any specific design or user interface
requirements for the program, such as
command-line interface (text-based), graphical
user interface, web-based interface or file
processing?
Text-based
Example - Problem Identification:
d. Evaluate the definition:
• Simplest version:
Develop a program that calculates BMI of a user using metric system using
text-based interface and display it with username. No error handling and no rounding.
Steps to complete an IPO Model
Steps:
1. Identify the output (result of program):
-Visualize the result of program:
Enter username: Asad Ali
Enter your weight (Kg): 65
Enter your height(cm): 180
Result:
Hello, Asad. Your BMI is 20.1 kg/(m^2).
-Decide what data you will need for this output:
Username, weight, height, First name, BMI, Unit of BMI.
2. Decide what data is required to input with data types in order to get the
required output. Sometimes these will be given to you, sometimes not, which
means you may need to invent inputs.
Then decide what instructions are required to get data.
3. Then processing i.e. how the inputs can be transformed into the required
outputs.
For this Decide what further data is required for processing with data types.
Then decide what instructions are required to process data.
4. Then for output, Decide what further data is required for output with data
types.
Then decide what instructions are required to output data.
INPUT PROCESSING OUTPUT
Containers Username(te
xt),
weight(float),
height(float)
FirstName, BMI,
RBMI
UnitofBMI
Instructions
Get Username,
weight, height
Calculate BMI as
weight/height2
(Formula BMI =
weight (kg) /
height2 (m))
Display FirstName,
RBMI, UnitofBMI
Round BMI
Extract First Name
from username
3. Development/coding in python
• Now in order to convert this IPO model in python code, we need to
learn following topics of Python language:
• Introduction to syntax of python language like case-sensitivity,
indentation, statement termination, etc.
• Introduction to Containers in python (with charts of containers)
and details of variables only.
• Introduction to input techniques in python and details of text-
based (CLI-based) inputs. Here you will also introduce print
statement as print, although an output instruction but also used in
inputting.
• Introduction to processing
Example:
2. Algorithm (IPO Model):
• Formula BMI = weight (kg) / height2 (m)
• Do we need to just output BMI or also generate remarks
like underweight, overweight, etc.? No
Input
What output/s are required?
Problem Statement
A student's final grade for a course is a weighted
average of two tests, a final exam, and four projects.
Each test is worth 15%, the final is worth 30%, and the
projects are worth a total of 40% (10% each). Given a
student's grades for all of these assignments, calculate
the final score.
What input/s are require?
Problem Statement
A student's final grade for a course is a weighted
average of two tests, a final exam, and four projects.
Each test is worth 15%, the final is worth 30%, and the
projects are worth a total of 40% (10% each). Given a
student's grades for all of these assignments, calculate
the final score.
What process/es are require?
Problem Statement
A student's final grade for a course is a weighted
average of two tests, a final exam, and four projects.
Each test is worth 15%, the final is worth 30%, and the
projects are worth a total of 40% (10% each). Given a
student's grades for all of these assignments, calculate
the final score.
Problem Statement
A student's final grade for a course is a weighted average of two tests, a final exam, and
four projects. Each test is worth 15%, the final is worth 30%, and the projects are worth a
total of 40% (10% each). Given a student's grades for all of these assignments, calculate the
final score.
Input Process Output
Get Result of Test1
Get Result of Test2
Get Result of FinalExam
Get Result of Project1
Get Result of Project2
Get Result of Project3
Get Result of Project4
1. Calculate FinalScore
2. FinalScore = (Test1 + Test2) *
15/100 + Test3 * 30/100 +
(Project1 + Project2 +
Project3 + Project4) * 40/100
FinalScore
Design Exercises
1. Consider a student file that contains the following data fields:
First Name Last Name Course Grade
Would this set of data be suitable and sufficient to use to test each of the following programs?
Explain why or why not.
• A program that prints a list of SDD students
• A program that prints a list of students nearly failing - those with a grade is less than 50%
• A program that prints a list of student on the Principal’s list
• A program that prints a list of students from Parramatta
• A program that prints a list of female students.
2. Construct an IPO chart for a program that gives an employee $50 bonus for every
500 items sold in a week.
3. Construct an IPO chart for a program that will output a student's grading based on
letter grades (A, B, C, D, or F) in five courses.
Example
Analysis for Celsius To Fahrenheit Program:
• Input
degrees Celsius
• Process
F = C * 9/5 + 32
• Output
degrees Fahrenheit
2 * IPO Examples
Input Processing Output
original number 1. calculate the squared value by multiplying the original number by
itself
2. display the squared value
squared value
Input Processing Output
state1 sales
state2 sales
commission rate
1. enter state1 sales, state2 sales, and commission rate
2. calculate the total commission by adding the state1 sales to the state2
sales, and then multiplying the result by the commission rate
3. display the total commission
commission
Describe what these two IPO models
are doing…
2 more IPO Examples
Input Processing Output
Sales
Commission rate
1. Enter the sales and Commission rate
2. Calculate the commission rate by multiplying sales time Commission
rate
3. Display the Commission rate
Commission Rate
Describe what these two IPO models
are doing…
Input Processing Output
Original number 1. Enter the Original Number
2. If the original number is less than or equal to zero then display an error
message, otherwise calculate the squared value by multiplying the
Original number by itself.
3. Display the squared value
Squared value
https://www.google.com/search?sca_esv=93371214c77afbba&rlz=1C1CH
BF_enPK1095PK1095&sxsrf=ADLYWIK70Z44XxJf0iDPba9RKAwJMWpOOw:
1715562890627&q=ipo+chart+programming+example&uds=ADvngMgZvk
NwI-
rS2fvwLGvpiEIUVIEbjnzzyocpdsR4fwl0nIwGR0G35FdGJtU3cgFLQCvLCP4ut
hV5FZL4UtyJKpCIvw5o-Mpx1eDAvpdp8B0cX1o8t9zhO-URC58E-
wZnwW_B0woMa4nVIYImZtgkd8A-
bozUUe_NrqDdAo8eGf0ZeOQq7vS0CUnrNVKaU3wr-
dD1vll0aeJdVOsUmfpJTx3hsQxg5HCc13eI4XrU3zRlpPH6lerWiTAFjbBbSOAr
Bw0cdGncCkD12jvEYtzT_ZC05sIfvxdW7YztziI0FUHt88y7azFnulGCi937pVIz
RRS_3YwVzuCWELDMDwutuElfFMgwOg71dk51anAJPYDE2n53awwJ3PEXF
ocy8Jf-g-
63LVP9&udm=2&sa=X&ved=2ahUKEwiU4r3luYmGAxX49AIHHYnWBy0QxK
sJegUIigEQAQ&ictx=0&biw=911&bih=411&dpr=1.5
Middle School Grade: 6 - 8 CCSS, NGSS
Problem Solving using Python
Middle School Grade: 6 - 8 CCSS, NGSS
Problem Solving using Python
Middle School Grade: 6 - 8 CCSS, NGSS
Problem Solving using Python

Fundamentals of Problem Solving using Python.pptx

  • 1.
    Programming is abranch of Problem Solving •Programming is a branch of problem solving by giving instructions to computers through a programming language like python, C, Java, etc. •The domain of problem can be anything like academics, healthcare, business, physical or social sciences, arts, etc.
  • 2.
    Problems can besimple • Create a program that will calculate the user’s BMI. • Create a program that will convert temperature from Fahrenheit to Celsius. • Given a student's grades for all of the assignments, calculate the final score. • A program that gives an employee $50 bonus for every 500 items sold in a week. • Given a DNA strings of length at most 1000 nt, return four integers (separated by spaces) counting the respective number of times that the symbols 'A', 'C', 'G', and 'T' occur in s.
  • 3.
    Problems can becomplex • Given a set of random numbers like 3,2,55,43,65,100,1, sort them in ascending order. • Finding Disjoint Motifs in a Gene. • Medical Image Analysis: Developing algorithms for the automated analysis and interpretation of medical images such as X-rays, MRI scans, and CT scans. This can involve tasks such as tumor detection, organ segmentation, or anomaly identification. • Clinical Decision Support Systems: Creating software tools that integrate patient data, medical knowledge, and algorithms to assist healthcare professionals in making clinical decisions. These systems can help in diagnosis, treatment planning, and predicting patient outcomes.
  • 4.
    Strategy to solvethe problems? In order to solve a problem by giving instructions to computers using any programming language in any field of domain we must know: 1. How to understand the problem? This requires knowledge of the field of domain of the problem. 2. How to design algorithm or the step-by-step solution of problem. This requires knowledge of capabilities of computers or what a computer can do? 3. Finally, how to develop the program? This requires rules of programming language to give instructions to computers.
  • 5.
    1. Problem Identification: 1.Read and understand the “Original” problem statement by getting core and little bit additional knowledge of that specific area of domain. 2. Define the problem by: a. Identify different perspective of problems and remove ambiguities of both core and associated problems by asking as many questions as you can. b. Get Answers of the questions in step (a). c. In the light of (b) clearly write/define the problem – “Redefined” Original Problem. d. (If needed) Evaluate (c) and by simplifying (b) Break down a big problem into sub-problems Or Make a simpler version of a complex problem. e. In the light of (d) clearly re-write/re-define the problem – “Reduced” Redefined Original Problem (x), where x is the number of reduced version. Now here at this step we will move to Design algorithm step and then development step and then will come back to problem identification step when there is versioning (d and e steps) of problem.
  • 6.
    2. Design algorithm(Steps to solve the problem) To design the algorithm, we must first know what are the basic capabilities of computer. So computer basically follows Input-Process-Output(IPO) model to solve any problem. And to carry out IPO, it needs to store the data. Your analysis starts here The requirements of the Output (Output here means the result of program not the instructions of output) , more than anything else, will determine the requirements of the System. • Nearly every program you create in this course will follow these basic operations in that order exactly. • As the programs grow in scale you may repeat this process multiple times in the same program.
  • 7.
    I = Input •Input is something from the external environment that is fed into the system. • In an information system, the inputs may be raw data "captured" in some way or pre-existing data which has been provided by an external system. • In either case, the data input is provided by an external entity.
  • 8.
    P = Process •The transformation process is the most important element of a system. • The process accepts the inputs into the system and performs some type of operation on it which transforms it into some other state. In the simplest of terms, the process is at the heart of any system. • In a computerised information system, the process is normally the storage, retrieval and modification of data which is accomplished by hardware and software.
  • 9.
    O = Output •Output from the system which is the result of processing the input. • Without output, a system has no link back into it's external environment. • Output of an information system may be reports generated by an information system, or a picture on a computer monitor, or even data that is fed into another external system.
  • 10.
    3. Develop theprogram: Storage/Data Structures:
  • 13.
    Steps to completean IPO Model Steps 1. Identify the output (result of program) • Visualize the result of program and decide what data you will need for this output. 2. Decide what data (the inputs) is required in order to get the required output • Sometimes these will be given to you, sometimes not, which means you may need to invent inputs. 3. Once you have the outputs and the inputs you need to determine how the inputs can be transformed into the required outputs. This is a dynamic process which may mean you need to continually return to the previous steps.
  • 14.
    Example: Original Problem Statement: Createa program to “compute” the BMI.
  • 15.
    Example - ProblemIdentification: a. Understand the problem: Possible Questions: Q Q What is the purpose of program? -Just to calculate BMI? -Also generate remarks? -Also give advices according to remarks like actions needed (This may require additional data like age, gender, etc.) -Is this intended to find insights from the data or any prediction or something like that? (See comments) Which formula to be used? Should the program be designed for a “group” of specific audience such as adults, children, athletes, etc.? Or just a single user? Does program has the ability to input/output data from/to files? What output format is desired for the BMI result? Should it be rounded to a specific number of decimal places? Do we need to output the result with a chart or graph? Should the program handle errors or invalid inputs gracefully? Are there any specific design or user interface requirements for the program, such as command-line interface (text-based), graphical user interface, or web-based interface?
  • 16.
    Example - ProblemIdentification: b. Understand the problem: Possible Questions with Answers: Questions Answers Questions Answers What is the purpose of program? -Just to calculate BMI? -Also generate remarks? -Also give advices according to remarks like actions needed (This may require additional data like age, gender, etc.) -Is this intended to find insights from the data or any prediction or something like that? (See comments) Insights: Analyzing aggregated BMI data to reveal trends in population health, i.e. the prevalence of obesity, overweight, and underweight individuals within different age groups. Which formula to be used? As data can be given or taken in any unit so all possible formulae would be used in processing. Should the program be designed for a “group” of specific audience such as adults, children, athletes, etc.? Or just a single user? Yes program will take data of a group of individuals. Does program has the ability to input/output data from/to files? Yes program should have ability to read write using files also. What output format is desired for the BMI result? Should it be rounded to a specific number of decimal places? Rounded. Do we need to output the result with a chart or graph? yes.. As much as possible. Should the program handle errors or invalid inputs gracefully? Should handle errors and allow for retaking the inputs. Are there any specific design or user interface requirements for the program, such as command-line interface (text- based), graphical user interface, web- based interface or file processing? Program should allow both text and file input.
  • 17.
    Example - ProblemIdentification: c. Define the problem – Redefined Original Problem Develop a program that calculates BMI and analyzes trends in population health data such as overweight, obesity and underweight individuals within different age groups. The program should be able to handle different input formats including text and data files. It should also be able to provide feedback or advice on how to improve health based on the user's BMI. The results should be presented with no fractional part (i.e. should be rounded) for the BMI output and if a chart or graph is needed. The program should handle errors and allow for retaking the inputs. Program result would be like this:
  • 18.
    Example - ProblemIdentification: d. Evaluate the Redefined original problem: • Reduced Redefined Original Problem (1): The simplest version: Develop a program that calculates BMI of a user using metric system using text-based interface and display it with username. No error handling and no rounding is required. Questions Answers Questions Answers What is the purpose of program? -Just to calculate BMI? -Also generate remarks? -Also give advices according to remarks like actions needed (This may require additional data like age, gender, etc.) -Is this intended to find insights from the data or any prediction or something like that? (See comments) Just to calculate BMI Which formula to be used? Metric formula Should the program be designed for a “group” of specific audience such as adults, children, athletes, etc.? Or just a single user? Single user Does program has the ability to input/output data from/to files? No What output format is desired for the BMI result? Should it be rounded to a specific number of decimal places? No need to Round. Do we need to output the result with a chart or graph? No Should the program handle errors or invalid inputs gracefully? No need to handle errors. Are there any specific design or user interface requirements for the program, such as command-line interface (text-based), graphical user interface, web-based interface or file processing? Text-based
  • 19.
    Example - ProblemIdentification: d. Evaluate the definition: • Simplest version: Develop a program that calculates BMI of a user using metric system using text-based interface and display it with username. No error handling and no rounding.
  • 20.
    Steps to completean IPO Model Steps: 1. Identify the output (result of program): -Visualize the result of program: Enter username: Asad Ali Enter your weight (Kg): 65 Enter your height(cm): 180 Result: Hello, Asad. Your BMI is 20.1 kg/(m^2). -Decide what data you will need for this output: Username, weight, height, First name, BMI, Unit of BMI. 2. Decide what data is required to input with data types in order to get the required output. Sometimes these will be given to you, sometimes not, which means you may need to invent inputs. Then decide what instructions are required to get data. 3. Then processing i.e. how the inputs can be transformed into the required outputs. For this Decide what further data is required for processing with data types. Then decide what instructions are required to process data. 4. Then for output, Decide what further data is required for output with data types. Then decide what instructions are required to output data. INPUT PROCESSING OUTPUT Containers Username(te xt), weight(float), height(float) FirstName, BMI, RBMI UnitofBMI Instructions Get Username, weight, height Calculate BMI as weight/height2 (Formula BMI = weight (kg) / height2 (m)) Display FirstName, RBMI, UnitofBMI Round BMI Extract First Name from username
  • 21.
    3. Development/coding inpython • Now in order to convert this IPO model in python code, we need to learn following topics of Python language: • Introduction to syntax of python language like case-sensitivity, indentation, statement termination, etc. • Introduction to Containers in python (with charts of containers) and details of variables only. • Introduction to input techniques in python and details of text- based (CLI-based) inputs. Here you will also introduce print statement as print, although an output instruction but also used in inputting. • Introduction to processing
  • 22.
    Example: 2. Algorithm (IPOModel): • Formula BMI = weight (kg) / height2 (m) • Do we need to just output BMI or also generate remarks like underweight, overweight, etc.? No Input
  • 23.
    What output/s arerequired? Problem Statement A student's final grade for a course is a weighted average of two tests, a final exam, and four projects. Each test is worth 15%, the final is worth 30%, and the projects are worth a total of 40% (10% each). Given a student's grades for all of these assignments, calculate the final score.
  • 24.
    What input/s arerequire? Problem Statement A student's final grade for a course is a weighted average of two tests, a final exam, and four projects. Each test is worth 15%, the final is worth 30%, and the projects are worth a total of 40% (10% each). Given a student's grades for all of these assignments, calculate the final score.
  • 25.
    What process/es arerequire? Problem Statement A student's final grade for a course is a weighted average of two tests, a final exam, and four projects. Each test is worth 15%, the final is worth 30%, and the projects are worth a total of 40% (10% each). Given a student's grades for all of these assignments, calculate the final score.
  • 26.
    Problem Statement A student'sfinal grade for a course is a weighted average of two tests, a final exam, and four projects. Each test is worth 15%, the final is worth 30%, and the projects are worth a total of 40% (10% each). Given a student's grades for all of these assignments, calculate the final score. Input Process Output Get Result of Test1 Get Result of Test2 Get Result of FinalExam Get Result of Project1 Get Result of Project2 Get Result of Project3 Get Result of Project4 1. Calculate FinalScore 2. FinalScore = (Test1 + Test2) * 15/100 + Test3 * 30/100 + (Project1 + Project2 + Project3 + Project4) * 40/100 FinalScore
  • 27.
    Design Exercises 1. Considera student file that contains the following data fields: First Name Last Name Course Grade Would this set of data be suitable and sufficient to use to test each of the following programs? Explain why or why not. • A program that prints a list of SDD students • A program that prints a list of students nearly failing - those with a grade is less than 50% • A program that prints a list of student on the Principal’s list • A program that prints a list of students from Parramatta • A program that prints a list of female students. 2. Construct an IPO chart for a program that gives an employee $50 bonus for every 500 items sold in a week. 3. Construct an IPO chart for a program that will output a student's grading based on letter grades (A, B, C, D, or F) in five courses.
  • 28.
    Example Analysis for CelsiusTo Fahrenheit Program: • Input degrees Celsius • Process F = C * 9/5 + 32 • Output degrees Fahrenheit
  • 29.
    2 * IPOExamples Input Processing Output original number 1. calculate the squared value by multiplying the original number by itself 2. display the squared value squared value Input Processing Output state1 sales state2 sales commission rate 1. enter state1 sales, state2 sales, and commission rate 2. calculate the total commission by adding the state1 sales to the state2 sales, and then multiplying the result by the commission rate 3. display the total commission commission Describe what these two IPO models are doing…
  • 30.
    2 more IPOExamples Input Processing Output Sales Commission rate 1. Enter the sales and Commission rate 2. Calculate the commission rate by multiplying sales time Commission rate 3. Display the Commission rate Commission Rate Describe what these two IPO models are doing… Input Processing Output Original number 1. Enter the Original Number 2. If the original number is less than or equal to zero then display an error message, otherwise calculate the squared value by multiplying the Original number by itself. 3. Display the squared value Squared value
  • 31.
  • 32.
    Middle School Grade:6 - 8 CCSS, NGSS Problem Solving using Python
  • 33.
    Middle School Grade:6 - 8 CCSS, NGSS Problem Solving using Python
  • 34.
    Middle School Grade:6 - 8 CCSS, NGSS Problem Solving using Python