c03_ps02_sol

c03_ps02_sol - C3 Solutions 1. Distance_With_Errors Listing...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
C3 Solutions 1. Distance_With_Errors Listing File GNAT 3.13 p ( 20000509 ) Copyright 1992 - 2000 Free Software Foundation, Inc. Compiling: c:/docume~ 2 /joeb/desktop/adatex~ 1 /fk3-w95/distance_with_errors.adb (source file time stamp: 1998 - 09 - 13 23 : 11 : 36 ) 1 . WITH Ada.Text_IO; 2 . WITH Ada.Float_Text_IO; 3 . PROCEDURE Distance_with_Errors IS 4 . -------------------------------------------------------------- 5 . --| Finds distance, given travel time and average speed 6 . --| Author: Michael eldman, The George Washington University 7 . --| Last Modified: June 1998 8 . -------------------------------------------------------------- 9 . HowLong : Natural; 10 . HowFast : Float; 11 . HowFar : Natural; 12 . 13 . BEGIN -- Distance_with_Errors 14 . 15 . -- prompt user for hours and average speed 16 . Ada.Text_IO.Put 17 . (Item => "How long will you be driving (integer) ? " ); 18 . Ada.Float_Text_IO.Get (Item => HowLong); | >>> invalid parameter list in call ( use -gnatf for details) 19 . Ada.Text_IO.Put 20 . (Item => "At what speed (miles per hour, integer)?" ); 21 . Ada.Float_Text_IO.Get (Item => HowFast); 22 . 23 . -- compute distance driven 24 . HowFast := HowLong * HowFar; | >>> expected type "Standard.Float" >>> found type "Standard.Integer"
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/28/2012 for the course AERO 16.01 taught by Professor Markdrela during the Fall '05 term at MIT.

Page1 / 4

c03_ps02_sol - C3 Solutions 1. Distance_With_Errors Listing...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online