Hi, I'm trying to make a program that lets a user punch in the results from a race. What I got is a loop for entering the contestants startnumber, the time they started the race (hh, mm, ss) and when they finished the race (hh, mm, ss). I'm stuck with a two parted problem (yes I know it's probably simple but I'm new to this. Because I'm new I wanna keep it really simple, just using the basic code, no arrays or functions). Part 1: how do I keep both the fastest time and startnumber in memory? Part 2: how do I convert the times (that I have in seconds) in to a readable hh : mm : ss , preferbly using modulus?
Thankfull for any help.
Urv73
0
Newbie Poster
Recommended Answers
Jump to PostI'm not quite sure what you mean by
how do I keep both the fastest time and startnumber in memory?
Perhaps you just mean store the data for the duration of the programs execution?
The rest is just basic Math.
If you know the start and end time then you …
Jump to PostYou've almost got it by the looks of it.
I've tried to translate it into English so that other people will find it a bit easier to follow the code, I hope you dont mind.#include <iostream> using namespace std; int main () { int start_Nr, start_Hour, …
Jump to PostIts instead of initially setting the fastest time to 999999. If the current runner is the first then just store the time as the fastest.
The way you did it is probably fine for the small scale application but what if all the runners did take longer than 999999 seconds? …
All 9 Replies
Valaraukar
4
Junior Poster
Urv73
0
Newbie Poster
Colezy
4
Light Poster
Valaraukar
commented:
Very concise information provided
+2
Urv73
0
Newbie Poster
Colezy
4
Light Poster
Urv73
0
Newbie Poster
Urv73
0
Newbie Poster
Colezy
4
Light Poster
Urv73
0
Newbie Poster
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.