lab12 - /Find the bugs ! /The program below runs, but gives...

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

View Full Document Right Arrow Icon
//Find the bugs !! //The program below runs, but gives run-time errors. Can you find out why? //Your task is to find the bugs by tracing the code. // !!!!! You are not allowed to run or compile this code !!!!! #include <iostream> using namespace std; //Class Definition class Distance { public: long feet; long yards; long miles; public: void PrintDistance(); //I took the Initialize function out of the //whole program because it isn't needed to make //this program work. }; //Prints Distance void Distance::PrintDistance() { cout<<"feet "<< feet<<", yards "<<yards<<", miles "<<miles<<endl; } int main() { //Declarations Distance distance; //Input cout<<"Enter feet, yards, miles with spaces in between"<<endl; cin>>distance.feet>>distance.yards>>distance.miles; distance.PrintDistance(); return 0; } //******************************************************************
Background image of page 1

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

View Full DocumentRight Arrow Icon
// This file gives the specification of a list abstract data type. // The list components are not assumed to be in order by value
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/25/2010 for the course CECS CIS 150 taught by Professor L.tsui during the Fall '07 term at University of Michigan-Dearborn.

Page1 / 5

lab12 - /Find the bugs ! /The program below runs, but gives...

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

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