Syntax help

This is a discussion on Syntax help within the C++ Programming forums, part of the General Programming Boards category; I am stuck at the very last part. I really cant figure the syntax on how to add the numbers. ...

  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    1

    Syntax help

    I am stuck at the very last part. I really cant figure the syntax on how to add the numbers.
    Code:
    #include <iostream>
    using namespace std;
    #include <cstdlib>
    #include <string>
    void getHours (int);
    void getMinutes (int);
    void calcTotalTime (int);
    
    bool isValidMinutes (Minutes Test);
    
    bool isValidHours(Hours Test);
    
    const int MAX_MINS = 59;
    const int MAX_HOURS = 23;
    const int MIN_MINS = 0;
    const int MIN_HOURS = 0;
    
    
    int main ()
    
    {
    
        int hours, minutes;
    	int addedHours, addedMinutes;
    
        cout << "Enter the number of hours for the starting time: ";
    	cin >> hours;
        cout << "Enter the number of minutes for the starting time: ";
    	cin >> minutes;
        cout << "Enter the number of hours to be added to the starting time: ";
    	cin >> addedHours;
        cout << "Enter the number of minutes to be added to the starting time: ";
    	cin >> addedMinutes;
    	getHours(hours);
    	getMinutes(minutes);
        calcTotalTime (int);
    
        cout << "\nThe total time is " << hours << " hours and "
    
                << minutes << " minutes." << endl;
    
        return 0;
    
    }
    
    bool isValidMinutes (Minutes Test)
    {
    	if ( Minutes < 0 || Minutes > 60)
    		cout << "Invalid number: \n" ;
    	else
    		return true
    }
    
    bool isValidHours(Hours Test)
    {
    	if ( Hours < 0 || or Hours > 23)
    		cout << "Invalid number: \n" ;
    	else
    		return true
    }
    
    
    void getHours (int i)
    {
    	cout << " Total number of hours: " << i <<endl;
    }
    
    void getMinutes (int x)
    {
    	cout << " Total number of minutes: " << x << endl;
    }
    
    void calcTotalTime (int )
    {

  2. #2
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    You have to state what your goal is, i.e. what you want to happen with some given input.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 08:26 AM
  2. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 04:45 PM
  3. Using VC Toolkit 2003
    By Noobwaker in forum Windows Programming
    Replies: 8
    Last Post: 03-13-2006, 06:33 AM
  4. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 09:33 AM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21