Question
The Golden Sales Company pays it salespeople R12.50 for each item they sell. Given the number of items sold by a salesperson, your program should
The Golden Sales Company pays it salespeople R12.50 for each item they sell. Given the number of items sold by a salesperson, your program should first print a heading, then calculate, and print the amount of pay due. A function named printHeading (with no parameters) displays the following message: *************************************************** GOLDEN SALES COMPANY This program inputs the number of items sold by a Salesperson and prints the amount of pay due. *************************************************** Another function, calculatePay displays the amount pay due to a salesperson. The function multiples the numer of items sold with 12.50 to compute the pay to be payed out. The function has one value parameter items representing the number of items sold by a salesperson. A main program inputs an integer value (items). It displays the description of the program by calling the function printHeading. The program then calls the function calculatePay to calculate and display the amount of pay due. Sample run: *************************************************** GOLDEN SALES COMPANY This program inputs the number of items sold by a Salesperson and prints the amount of pay due. *************************************************** Please input the number of items sold 125 The amount pay due is R 1562.50
Question 1.
a. Write the functions printHeading and calculatePay as well as the main program
b. Change the program so that the pay amount is displayed in the main program instead of function calculatePay.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started