Final answer:
To write a program that takes any number of non-negative integers as input and outputs the max and average, you can use a loop to continuously read the input until the user enters a negative number, and keep track of the maximum value and calculate the average.
Step-by-step explanation:
To write a program that takes any number of non-negative integers as input and outputs the max and average, you can use a loop to continuously read the input until the user enters a negative number, indicating the end of the input. Within the loop, you can keep track of the maximum value encountered so far by comparing each input with the current maximum.
Additionally, you can keep a running total of all the inputs to calculate the average at the end. Finally, you can use the built-in functions in your programming language to round the average to two decimal places and display the results.