Programming Exercises

1:Write the pseudocode for an algorithm that determines the maximum number of two given numbers. Hint: Use the following logic: If number1 is greater than number2, number1 is the maximum number; otherwise, number2 is greater than or equal to number1.
2:Write the pseudocode for an algorithm that determines the maximum number in a given list of numbers. The list can contain any amount of numbers. Hint: Keep a variable called maxSoFar (written on the paper, with zero as the initial value). Go through the list one by one and compare each number with maxSoFar. Any number found to be greater than maxSoFar becomes equal to maxSoFar. At the end of the list, maxSoFar represents the largest number in the list.
3:Change the average-calculating ...

Get C# Primer Plus now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.