2
The 52 week challenge is a way to save money. For example, Week 1, you save $1.00. Week 2 you save $2.00, and it continues through the year, adding one more dollar to each week’s savings goal. By Week 52, you’ll set aside $52.00, which will bring the year’s total savings to $1,378! Of course, you can decide how much money you start saving and how many weeks.
Given an amount for Week 1 and the number of weeks the challenge should run for, return the total amount saved at the end of the challenge.
Week 2 will have as twice the amount of Week 1, Week 3 will have thrice the amount of Week 1, etc.
Examples
1
and 52
weeks: 1378
5
and 6
weeks: 105
.25
and 100
weeks: 1262.5
10
and 1
week: 10
7
and 0
weeks: 0
0
and 30
weeks: 0
0
and 0
weeks: 0
2This challenge is very poorly specified; the task is unclear and it lacks any winning or validity criterion. Please respecify it so the exact task is clear and it is easy to determine if a submission is valid and which submissions win. – HyperNeutrino – 2017-12-21T18:54:35.090
2
Hi, Welcome to PPCG! We generally host programming competitions, and the challenges here should have a clear specification in order to indisputably decide whether an answer is valid and a winning criterion to determine which submission wins. For guidance, you can visit this meta thread: How does this site work? It might be worth reading through this too. For future challenges, we can help you improve them with the Sandbox. :-)
– Mr. Xcoder – 2017-12-21T20:01:21.5132
I've edited your post to conform to our standards while following a possible interpretation of your original text. If it doesn't suit you, feel free to roll the edit back.
– Adám – 2017-12-21T20:03:49.740I think this challenge has one thing preventing it being reopened: How does setting aside $52 bring the year's total to $1378? What mapping is being done? – caird coinheringaahing – 2017-12-21T20:23:38.440
3@cairdcoinheringaahing That's $1+$2+$3+…+$52=$1378. – Adám – 2017-12-21T20:50:58.367
1
I've voted to close this as a duplicate of sum all integers from 1 to n, because it requires simply computing that result and multiplying it by another input.
– Post Rock Garf Hunter – 2017-12-21T22:34:48.813