Page 1 of 1

I'm having issues with my code Write a program (Python) that determines which of a company’s four divisions (Northeast,

Posted: Sun May 15, 2022 8:21 am
by answerhappygod
I'm having issues with my code
I M Having Issues With My Code Write A Program Python That Determines Which Of A Company S Four Divisions Northeast 1
I M Having Issues With My Code Write A Program Python That Determines Which Of A Company S Four Divisions Northeast 1 (38.7 KiB) Viewed 64 times
Write a program (Python) that determines which of a company’s
four divisions (Northeast, Southeast, Northwest, and Southwest) had
the greatest sales for a quarter. It should include the following
two functions, which are called by the main function.
double getSales() is passed the name of a
division. It asks the user for a division’s quarterly sales figure,
validates that the input is not less than 0, then returns it. It
should be called once for each division.
void findHighest() is passed the four
sales totals. It determines which is the largest and prints the
name of the high grossing division, along with its sales
figure.
Sample output:
I M Having Issues With My Code Write A Program Python That Determines Which Of A Company S Four Divisions Northeast 2
I M Having Issues With My Code Write A Program Python That Determines Which Of A Company S Four Divisions Northeast 2 (16.18 KiB) Viewed 64 times
def getsales(divisions): val = float(input("Enter %s division's quarterly sales figure: "(divisions))) if val>O: return val else: getSales(divisions) adef findHighest (divisionData, divisions): _max=0# store index of maximum sales figure for i in range(len(divisions): if divisionData>divisionData[_max]: _max=i print("%s is the high grossing division, with quarterly sales figures of %d" (divisions, (divisionData))) def main(): divisions=["Northeast", "Southeast", "Northwest", "Southwest"] divisionData=[] for i in range(len(divisions)): divisionData.append(getSales(divisions)) findHighest (divisionData, divisions)

Enter the quarterly sales for the Northeast division: 38 Enter the quarterly sales for the Southeast division: 90 Enter the quarterly sales for the Northwest division: 23 Enter the quarterly sales for the Southwest division: 12 The Southeast division had the highest sales this quarter. Their sales were $90.00