Glen ross vacation property sales employs seven

This preview shows page 48 - 55 out of 77 pages.

We have textbook solutions for you!
The document you are viewing contains questions related to this textbook.
Programming Logic and Design, Introductory
The document you are viewing contains questions related to this textbook.
Chapter 6 / Exercise 19
Programming Logic and Design, Introductory
Farrell
Expert Verified
12.Glen Ross Vacation Property Sales employs seven salespeople, as shown in the Table 6-8.ID NumberSalesperson Name103Darwin104Kratz201Shulstad319Fortune367Wickert388Miller435VickTable 6-12Glen Ross salespeopleWhen a salesperson makes a sale, a record is created including the date, time, and dollar amount of the sale. The time is expressed in hours and minutes, based on a 24-
We have textbook solutions for you!
The document you are viewing contains questions related to this textbook.
Programming Logic and Design, Introductory
The document you are viewing contains questions related to this textbook.
Chapter 6 / Exercise 19
Programming Logic and Design, Introductory
Farrell
Expert Verified
Programming Logic and Design, 8eSolutions 6-hour clock. The sale amount is expressed in whole dollars. Salespeople earn a commission that differs for each sale, based on the rate schedule in the Table 6-9.Sale Amount ($)Commission Rate (%)0 – 50,999451,000 - 125,9995126,000 - 200,9996201,000 and up7Table 6-9Glen Ross commission scheduleDesign an application that produces each of the following:a. A list of each salesperson number, name, total sales, and total commissions
49
Programming Logic and Design, 8eSolutions 6-Pseudocode:50
Programming Logic and Design, 8eSolutions 6-startDeclarationsnum datenum hoursnum minutesnum saleAmtnum idNumnum personnum xstring datenum SSIZE = 4num PSIZE = 7num totalSales[PSIZE] = 0num totalComms[PSIZE] = 0num ID_NUMS[PSIZE] = 103, 104, 201, 319, 367, 388, 435string NAMES[PSIZE] = “Darwin”, “Kratz”, “Shulstad”, “Fortune”,“Wickert”, “Miller”, “Vick”num SALE_AMTS[SSIZE] = 0, 51000, 126000, 201000num COMM_RATES[SSIZE] = 0.04, 0.05, 0.06, 0.07getReady()while not eofdetailLoop()endwhilefinishUp()stopgetReady()output “Enter the salesperson ID number”input idNumreturndetailLoop()person = 0while person < PSIZE AND idNum not equal to ID_NUMS[person]person = person + 1endwhileif person = PSIZE thenoutput “An invalid number has been entered, please try again”elseinput date, hours, minutes, saleAmttotalSales[person] = totalSales[person] + saleAmtx = SSIZE – 1while saleAmt < SALE_AMTS[x]x = x – 1endwhiletotalComms[person] = totalComms[person] + (COMM_RATES[x] * saleAmt)endifoutput “Enter the salesperson ID number”input idNumreturnfinishUp()x = 0while x < PSIZEoutput ID_NUMS[x], NAMES[x], totalSales[x], totalComms[x]51
Programming Logic and Design, 8eSolutions 6-x = x + 1endwhilereturnb. A list of each month of the year as both a number and a word (for example, 01 January), and the total sales for the month for all salespeopleAnswer: A sample solution followsFlowchart:52
Programming Logic and Design, 8eSolutions 6-Pseudocode:startDeclarationsnum hours, minutesnum month, day, year53
Programming Logic and Design, 8eSolutions 6-num saleAmtnum idNumnum person, xnum SSIZE = 4num PSIZE = 7num MSIZE = 12num totalSales[MSIZE] = 0num totalComms[PSIZE] = 0num ID_NUMS[PSIZE] = 103, 104, 201, 319, 367, 388, 435string NAMES[PSIZE] = “Darwin”, “Kratz”, “Shulstad”, “Fortune”,“Wickert”, “Miller”, “Vick”num SALE_AMTS[SSIZE] = 0, 51000, 126000, 201000num COMM_RATES[SSIZE] = 0.04, 0.05, 0.06, 0.07string MONTHS[MSIZE] = “January”, “February”, “March”“April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December”getReady()while not eofdetailLoop()endwhilefinishUp()stopgetReady()output “Enter the salesperson ID number”input idNumreturndetailLoop()person = 0while person < PSIZE AND idNum not equal to ID_NUMS[person]person = person + 1endwhile

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture