Проблем със задача - Programming Fundamentals - Arrays and List Algorithms - Exercise, Задача 6
6. Batteries
You are in a battery manufacturing plant. Your task is to stress test the latest batch of batteries for longevity.
You will receive an array of doubles on the console (first line, space-separated), indicating the capacities of the different batteries in the batch (in mAh). On the next line, you will receive the usage per hour for each battery as an array of doubles (second line, space-separated).
Next, you will receive the amount of hours you have to stress test each battery for (as an integer). Each of the batteries drains by its capacity until either the testing hours are over, or the battery dies (reaches 0 capacity).
Print the status of all the batteries at the end of the testing session (in percentage). If any batteries die, along with the percentage, print how many hours it took. The capacity and percentage are rounded to the 2nd decimal point.
------------------------------------------------------------------------------------
Процентите накрая не ми се получават. Някой има ли идея как да ги оправя?
https://pastebin.com/2LNqA2uF
-Благодаря предварително.
Прочети в интернет за референтни и стоиностни типове (reference type value type)
"Някой знае ли защо става така?"
Става така заради типа данни, който ползват масивите - https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/reference-types
Изгледай още веднъж видеата на Преслав. Няколко пъти той обяснява разликите между reference types и value types.