I was trying to link those file but it occur the compiling error
anyhellp would be appriciated
Se7Olutionyg -7 Junior Poster
//******************************************************
// Filename: Lab_07_Testing_Shell.cpp
// Purpose: To create and test some Specific Task functions
// Author: Ken Busbee; 2009 Kenneth Leroy Busbee
// Date: Jan 2, 2009
// Licensed by: Kenneth Leroy Busbee under a
// Creative Commons Attribution License (CC-BY 3.0)
// http://creativecommons.org/licenses/by/3.0/
//******************************************************
// Comments: These functions will be placed into a user
// header file so that they may be referenced by any
// program that the user creates.
//******************************************************
// Headers and Other Technical Items
#include <iostream>
using namespace std;
#include "udst_monitor.h"
// Function Prototypes
double inch_to_cm(double inches);
double feet_to_meters(double feet);
double miles_to_kilometers(double miles);
// Variables
double hot_dog;
double driveway_depth;
double distance_to_work;
//******************************************************
// main
//******************************************************
int main(void)
{
// Input Test Data - 4.5, 36.75, 7.3
cout << "\nIn inches, how long is a hot dog? ----->: ";
cin >> hot_dog;
cout << "\nIn feet, how long is your driveway? --->: ";
cin >> driveway_depth;
cout << "\nIn miles, how far is it to work? --_--->: ";
cin >> distance_to_work;
cout << "\n\n";
// Output Test Results - 11.43, 11.2088, 11.753
cout << "\nA hot dog is " << inch_to_cm(hot_dog) << " centimeters long.\n";
cout << "\nYour driveway is " << feet_to_meters(driveway_depth) << " meters long.\n";
cout << "\nYour commute is " << miles_to_kilometers(distance_to_work) << " kilometers.\n";
system("pause");
return 0;
}
//******************************************************
// inch_to_cm
//******************************************************
double inch_to_cm(double inches)
{
return 2.54 * inches;
}
//******************************************************
// feet_to_meters
//******************************************************
double feet_to_meters(double feet)
{
return 0.305 * feet;
}
//******************************************************
// miles_to_kilometers
//******************************************************
double miles_to_kilometers(double miles)
{
return 1.61 * miles;
}
//******************************************************
// End of Program
//******************************************************
//******************************************************
// Filename: Monitor_Verify_Header.cpp
// Purpose: To verify that the header file is working
// Author: Ken Busbee; 2009 Kenneth Leroy Busbee
// Date: Jan 7, 2009
// Licensed by: Kenneth Leroy Busbee under a
// Creative Commons Attribution License (CC-BY 3.0)
// http://creativecommons.org/licenses/by/3.0/
//******************************************************
// Headers and Other Technical Items
#include <iostream>
using namespace std;
#include "udst_monitor.h"
// Variables
int age;
//******************************************************
// main
//******************************************************
int main(void)
{
cout << "\nEnter your age --->: ";
cin >> age;
pause_m();
clear_m();
cout << "\nEnter your age --->: ";
cin >> age;
delay_m(25);
return 0;
}
//******************************************************
// End of Program
//******************************************************
//******************************************************
// Filename: udst_monitor.h
// Purpose: Header File for several Specific Task functions
// Author: Ken Busbee; 2009 Kenneth Leroy Busbee
// Date: Jan 7, 2009
// Licensed by: Kenneth Leroy Busbee under a
// Creative Commons Attribution License (CC-BY 3.0)
// http://creativecommons.org/licenses/by/3.0/
//******************************************************
#include <ctime>
//******************************************************
// clear_m
//******************************************************
void clear_m(void)
{
system("CLS");
return;
}
//******************************************************
// delay_m
//******************************************************
void delay_m(int tenths_second)
{
clock_t mark_the_time = clock(); // long int, 1000's of seconds
while(clock() < (mark_the_time + (tenths_second * 100)));
return;
}
//******************************************************
// pause_m
//******************************************************
void pause_m(void)
{
cout << "\n\n";
system("PAUSE");
cout << "\n\n";
return;
}
//******************************************************
// End of File
//******************************************************
Dave Sinkula 2,398 long time no c Team Colleague
Don't put function definitions in a header file.
You can only have one main() function.
Edited by Dave Sinkula because: n/a
Se7Olutionyg -7 Junior Poster
that was the file from the lab
and this is the error
15 C:\Users\se7olutionyg\Desktop\New Folder (2)\udst_monitor.cpp udst_monitor.h: No such file or directory.
although i included the .h file into the cpp file at the same folder
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.