Question: Write a program that determines which of a companys four divisions (Northeast, Southeast, Northwest, and Southwest) had the greatest sales for a quarter. It should
Write a program that determines which of a companys four divisions (Northeast, Southeast, Northwest, and Southwest) had the greatest sales for a quarter. It should include two functions that are called by main: getSales and findHighest.
Modularity:
main will call the getSales function 4 times, passing it the division name, each time getting the quarterly sales from a different division. It will then call the findHighest function, passing it the four sales figures, which will determine and display the highest.
getSales will accept input of the quarterly sales from the user, using the division name passed by main to prompt the user. It will return the quarterly sales amount to main. Input validation Validate that the sales amount entered is greater than zero.
findHighest will accept the four sales figures from each division as parameters and determine which is the highest of the four. It will display the division name and amount that is the highest.
Use named constants for numeric literals in the program and do not use global variables.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
