// Marvyn De La Torre    CS1A    Chapter 5, P.294, #6
/**************************************************************
 * Determine Distance Traveled
 *
 * This program calculates and displays the distance a vehicle
 * travels for each hour based on its speed and travel time.
 *
 *INPUT:
 * The speed of the vehicle in miles per hour and the number
 * of hours the vehicle has traveled.
 *
 * OUTPUT:
 * The distance the vehicle has traveled for each hour.
 **************************************************************/

#include <iostream>
using namespace std;

int main()
{
    int speed;
    int hours;

    cout << "What is the speed of the vehicle in mph? ";
    cin >> speed;

    while (speed < 0)
    {
        cout << "Speed cannot be negative. Enter the speed again: ";
        cin >> speed;
    }

    cout << "How many hours has it traveled? ";
    cin >> hours;

    while (hours < 1)
    {
        cout << "Hours must be at least 1. Enter the hours again: ";
        cin >> hours;
    }

    cout << "\nHour Distance Traveled" << endl;

    for (int hour = 1; hour <= hours; hour++)
    {
        cout << hour << "    " << speed * hour << endl;
    }

    return 0;
}