Problem Solving - Problem 1
Problem Solving - Problem 1
Problem Statement :
5
1. Understand the problem:
Statement to highlight: Your summer
surveying job requires you to study some maps
that give distances in miles. You and your
coworkers prefer to deal in metric
measurements (km). Write a program that
performs the necessary conversion. The
program will display the distance in km.
Formula: (1 mile = 1.609 kilometers)
What are the INPUTs ??? What are the OUTPUTs ???
Output
the distance in kilometers
(K)
Main Problem
8
2. Design the solution (or Algorithm):
Algorithm is a step-by-step problem solving process in which a
solution is arrived at in a finite amount of time.
9
a) Pseudocode
Precise algorithmic description of program logic
Its purpose is to describe, in precise algorithm
detail, what the program being design is to do.
Requires the defining the steps to accomplish the
task in sufficient detail so that they can be
converted into a computer program.
10