C Primer Plus (5th Edition)
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 pseudocode in the section "Algorithms and Pseudocode" so that it doesn't perform division by zero, even when no numbers are provided. |
4: | Write, compile, and run a C# program that writes the following on the console: Our alien friend lives on planet Blipos far far away |