A standard triathlon event involves a continuous timed race over various distances combining the three disciplines of swimming, cycling and running. Triathlon events occur in that order a swim, followed by a cycle ride, followed by a run. Write a complete Java program to determine the winner of a triathlon based on the average point of all three disciplines. Assume the number of athlete is five (5) and each athlete will be given an ID. The program will first accept the athlete ID and then followed by the points for the three disciplines in the stated order. Sample input Sample output 1001 88.3 98.5 87.0 The winner is athlete ID 2000 2000 100.0 97.0 90.0 With average point : 95.67 1502 77.8 100.0 98.0 2230 89.2 85.0 90.1 4107 86.9 87.7 91.2
Addition of Two Numbers
Adding two numbers in programming is essentially the same as adding two numbers in general arithmetic. A significant difference is that in programming, you need to pay attention to the data type of the variable that will hold the sum of two numbers.
C++
C++ is a general-purpose hybrid language, which supports both OOPs and procedural language designed and developed by Bjarne Stroustrup. It began in 1979 as “C with Classes” at Bell Labs and first appeared in the year 1985 as C++. It is the superset of C programming language, because it uses most of the C code syntax. Due to its hybrid functionality, it used to develop embedded systems, operating systems, web browser, GUI and video games.
Step by step
Solved in 4 steps with 2 images