Miles to Kilometers problem

Slides:



Advertisements
Similar presentations
Introduction to Programming in C++ John Galletly.
Advertisements

Knapsack Problem Section 7.6. Problem Suppose we have n items U={u 1,..u n }, that we would like to insert into a knapsack of size C. Each item u i has.
Figure 4.1. The function f (x1, x2, x3) =  m(0, 2, 4, 5, 6).
$100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300.
EXAMPLE 5 Use unit analysis with operations a. You work 4 hours and earn $36. What is your earning rate? SOLUTION 36 dollars 4 hours = 9 dollars per hour.
1 Lab-1 CSIT-121 Spring 2005 Lab Targets Solving problems on computer Programming in C++ Writing and Running Programs Programming Exercise.
The Program Development Cycle and Program Design Tools
Repetition Repetition Important  Do things over and over thousands of times.  Computer fast, accurate and doesn't get bored. Example  count.c.
Algorithms. Software Development Method 1.Specify the problem requirements 2.Analyze the problem 3.Design the algorithm to solve the problem 4.Implement.
Introduction to C++ Programming CS 117 Section 2 and KNET Sections Spring 2001 MWF 1:40-2:30.
NFA- to NFA conversion. Purpose This presentation presents an example execution of the algorithm which takes as input an NFA with -transitions and produces.
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
1 Lab-1 CSIT-121 Fall 2004 Lab Targets Solving problems on computer Programming in C++ Writing and Running Programs Programming Exercise.
Dimensional Analysis Converting units from one unit to another.
COS120 Software Development Using C++ AUBG Fall semester 2010
CS 115 Chapter 1 Overview of Programming and Problem Solving.
Measures of Length: Converting Units and the Metric System
MEASUREMENT 1.3.
U NDERSTANDING P ROBLEMS AND HOW TO S OLVE THEM BY USING C OMPUTERS.
Chapter 4 Programming Concepts Dept. of Computer Engineering Khon Kaen University.
Physical Science and You Chapter One: Studying Physics and Chemistry Chapter Two: Experiments and Variables Chapter Three: Key Concepts in Physical Science.
Problem Solving and Program Design in C (5th Edition) by Jeri R. Hanly and Elliot B. Koffman CPCS 202 Chapter 2 – Input/Output
$100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300.
CISC105 General Computer Science Class 1 – 6/5/2006.
CS 127 Writing Simple Programs.  Stages involved  Analyze the problem  Understand as much as possible what is trying to be solved  Determine Specifications.
Section 1.3 Linear Function. Last section we discussed average rate of change over a certain interval When a function has a constant rate of change (i.e.
1 CSC 221: Introduction to Programming Fall 2012 Functions & Modules  standard modules: math, random  Python documentation, help  user-defined functions,
CSEB114: Principle of programming
MEASUREMENT. Chapter One: Measurement  1.1 Measurements  1.2 Time and Distance  1.3 Converting Measurements  1.4 Working with Measurements.
1 Special Programming Workshop CSIT-120 Fall 2000 Workshop Targets Solving problems on computer Programming in C++ Writing and Running Programs Programming.
The Development Process Problem Solving. Problem Solving - Dr. Struble 2 What Is Asked of Computer Programmers? Input Transformation Output Write a computer.
Problem Solving and Program Design in C (5th Edition) by Jeri R. Hanly and Elliot B. Koffman Chapter 1 (Software Development Method) © CPCS
Section Units and Dimensional Analysis Bill Vining SUNY College at Oneonta.
Software Development Method Reference : Problem Solving & Program Design in C ; Jeri R.Hanly, Elliot B.Koffman.
 Fold and cut paper as instructed  Label each section  Rectangle  Triangle  Trapezoid  Circle  Write formulas for perimeter and area under each.
Distance & Motion Problems d=rt formula distance chart Copyright © 2013 by Lynda Aguirre1.
GUI Applications ButtonGroup and JRadioButton. Contents A.Problem: The Metric Converter Application B.Solution C.Exercise: Moving all calculations into.
Multiple Unit Multipliers Conversion of Units of Area
Notes Over 4.8 Identifying Functions A relation where each input has exactly one output. Function Decide whether the relation is a function. If it is.
1 8/31/05CS150 Introduction to Computer Science 1 Hello World!
Introduction to Standard and Metric Measurement
X = Unit you want to change Unit you are changing into Conversion Factor 1.Start with the unit you want to change. 2.Multiply it by a blank fraction. 3.The.
Section 1.3 Problems Question 1
Lecture2.
Week 2 – BITE 1513 Computer Game Programming
Program Development Cycle
You Friend EXAMPLE 1 Understanding and Planning
Converting units from one unit to another
Unit you are changing into
Word Problems Involving Ratios
Units of Measure Algebra 1.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
CS1001 Programming Fundamentals 3(3-0) Lecture 2
Units of Measure Algebra 1.
Hire Toyota Innova in Delhi for Outstation Tour
Compiled and ready to run Memory Stack /*
WU: Convert the following:
CC213 Programming Applications
Vendor Optimizer Part of Radar/Space-Time
Homework Reading Tokheim, Section 5-10, 7-4.
Bell Ringer What is the formula for work?
Lecture3.
Understanding Problems and how to Solve them by using Computers
Intro to Programming & Algorithm Design
Exercise Solution First questions What's output What's input
Evaluating Logarithms
Relations.
Metric –U.S. Customary Comparisons
Chapter 2: Overview of C++
Presentation transcript:

Miles to Kilometers problem developing a solution

Your summer surveying job requires you to study some maps that give distances in kilometers and some that use miles. You and your coworkers prefer to deal in metric measurements. Write a program that performs the necessary conversion.

Your summer surveying job requires you to study some maps that give distances in kilometers and some that use miles. You and your coworkers prefer to deal in metric measurements. Write a program that performs the necessary conversion. Inputs: distance in miles

Your summer surveying job requires you to study some maps that give distances in kilometers and some that use miles. You and your coworkers prefer to deal in metric measurements. Write a program that performs the necessary conversion. Inputs: distance in miles Outputs: distance in kilometers

Your summer surveying job requires you to study some maps that give distances in kilometers and some that use miles. You and your coworkers prefer to deal in metric measurements. Write a program that performs the necessary conversion. Inputs: distance in miles Outputs: distance in kilometers Constants: 1 mile = 1.609 kilometers 1.609 kilometers per mile Formulas: kilometers = kilometers per mile * miles

Your summer surveying job requires you to study some maps that give distances in kilometers and some that use miles. You and your coworkers prefer to deal in metric measurements. Write a program that performs the necessary conversion. Algorithm: Get the distance in miles. Convert the distance to kilometers. Display the distance in kilometers.

Your summer surveying job requires you to study some maps that give distances in kilometers and some that use miles. You and your coworkers prefer to deal in metric measurements. Write a program that performs the necessary conversion. Algorithm: Deskcheck: Get the distance in miles. 10 miles Convert the distance to kilometers. 1.609 * 10 = 16.09 Display the distance in kilometers. 16.09 kilometers

Coding: Put the Algorithm in a module as comments Your summer surveying job requires you to study some maps that give distances in kilometers and some that use miles. You and your coworkers prefer to deal in metric measurements. Write a program that performs the necessary conversion. Coding: Put the Algorithm in a module as comments # milesToKilometers.py # by Ima Converter, Section M4 # Convert miles to Kilometers #Get the distance in miles. #Convert the distance to kilometers. #Display the distance in kilometers.

Coding: Implement the code for each comment Your summer surveying job requires you to study some maps that give distances in kilometers and some that use miles. You and your coworkers prefer to deal in metric measurements. Write a program that performs the necessary conversion. Coding: Implement the code for each comment ... #Get the distance in miles. miles = eval(input("Enter miles"))

Your summer surveying job requires you to study some maps that give distances in kilometers and some that use miles. You and your coworkers prefer to deal in metric measurements. Write a program that performs the necessary conversion. Testing