Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OutputClass GetOutput(InputClass input)
- {
- OutputClass output = new OutputClass();
- double sum = 0;
- foreach (double val in input.tubeValues)
- {
- if (val % 2 == 0)
- {
- output.warningsCards.Add("Divisible by 2!");
- }
- if (val % 3 == 0)
- {
- output.warningsTubes.Add("Divisible by 3!");
- }
- sum += val;
- }
- output.result = sum.ToString();
- return output;
- }
Add Comment
Please, Sign In to add comment