Alternatively the body can be:
To write IsConsonant, just use as the function body:
It's possible to dispense with local variable 'last' and use as the if statement:
and the body of the while loop can be the single statement:
or, alternatively,
Where the put member function is the 'opposite' of the get function.
In main() prompt the user for a file name and open the file:
Then modify Echo() as shown:
To avoid the global variable in the current program, pass output to Echo() each time Echo() is called (make sure to pass streams by reference).
Summary:
0 20 40 0 39 20
You probably want to test "bad" values too:
1 70 80 1 20 90
You may want to test zero values so just hours are added (similarly just minutes or just seconds).
1 0 0 2 0 0
1:16:71 1:62:05 0:00:12 0:00:00