DevJourney · code I wrote while learning

Daily Workout Tracker

2 items

README.md

Daily Workout Tracker

Single File Programming Question

Problem Statement

Megna, an avid fitness enthusiast, seeks a program to track her daily workouts.

The program must allow her to input calorie burn rates. With the ability to specify exercise counts, Megna desires a tool that computes and displays the total calories burned during her workout sessions, aiding her to sum the calories and monitor her fitness progress efficiently.

Write a program using a generic method named calculateSum and a generic interface NumberProvider to help Megna.

Input:

format :

The first line of input consists of an integer N, representing the number of workouts.

The second line consists of N space-separated integers, representing the calories burnt during each workout.

Output:

format :

The output prints an integer, representing the total calories burnt.

Refer to the sample output for formatting specifications.

Code constraints : 1 ≤ N ≤ 15

Sample test cases :

Input 1:

3
1 4 2
Output 1 :
7
Input 2 :
6
11 23 15 26 19 28
Output 2 :
122