Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Coding assignment Follow these comments and write a code that will make each comment true: // note this function is output only, so a

Python Coding assignment Follow these comments and write a code that will make each comment true: // note this function is output only, so a return statement is not required Subprogram writeNameAssn() Write "My name is: "  Write "This is assignment: " End Subprogram 
Subprogram getName() Declare text As String Write "Enter the salesperson's Name." Write "Enter * when done." Input text Return text End Subprogram Subprogram getFloat() Declare num As float Write "Enter the salesperson's monthly sales." Write "Enter 0 when done." Input num Return num End Subprogram Main Call writeNammeAssn() Declare Names[5] As String Declare Sales[5] As Float Set Max = 0 Set K = 0 Set Index = 0 Names[K] = getName() Sales[K] = getFloat() While Names[K] != "*" If Sales[K] > Max Then Set Index = K Set Max = Sales[Index] End If Set K = K + 1 Names[K] = getName() Sales[K] = getFloat() End While Write "Maximum sales for the month: " + Max Write "Salesperson: " + Names[Index] End Main Execute Main 

---------------------------------

Sample output/interaction should look like this:

My name is (Username) This is assignment (Assignment Number) Enter the salesperson's Name. Enter * when done: Tom Enter the salesperson's monthly. Enter 0 when done: 21000 Enter the salesperson's Name. Enter * when done: Nick Enter the salesperson's monthly. Enter 0 when done: 34000 Enter the salesperson's Name. Enter * when done: Herman Enter the salesperson's monthly. Enter 0 when done: 10000 Enter the salesperson's Name. Enter * when done: * Enter the salesperson's monthly. Enter 0 when done: 0 Maximum sales for the month: 34000.0 Salesperson: Nick 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions

Question

Discuss compensation for contingent workers.

Answered: 1 week ago

Question

What were the reasons for your conversion or resistance?

Answered: 1 week ago