You work for an online song distribution company. 2. Code a modular program that will accept an order of playlists that allows users to pick the platform and the number of songs in the playlist. 3. Your program will calculate the total of the order of playlists. 4. Do not accept any values for playlists other than the possible menu options. Use the table below to calculate the individual playlist costs. Playlist Platform Playlist length Cost Per Playlist Jim Bob’s Pretty Good Music Three Songs $2.23 Five Songs $3.99 Ten Songs $6.69 Suzy Bob’s Better Music Three Songs $3.52 Five Songs $5.05 Ten Songs $8.77 In In addition to main, the program must contain the following functions: getPlaylists() o Ask the user how many playlists will be ordered. Validate the input of the number of playlists so that the user must enter at least one playlist before proceeding with the program. Function must return the validated number of playlists. getPlatform() o Use a menu to prompt the user for the streaming platform. This should be done using a function that accepts a number for the current playlist number and displays the playlist platform menu. This function must prompt the user for a selection and return the choice. User must be given an unlimited number of chances to enter a valid playlist platform choice. Function must return the validated streaming platform. getPlaylistLength() o Prompt the user for the playlist length using a menu. This should be done using a function that accepts the current playlist number. User must be given an unlimited number of chances to enter a valid playlist length. Function must return the validated playlist length. calculatePlaylistCost() o Include a function that calculates the cost of a playlist. This function should accept the streaming platform and the playlist length. Function must return the mask cost. Use global constants stored as lists for the cost of playlist amounts. Calculate and display the total cost of the order of all playlists. Dollar amounts should be properly formatted. Input and Output (formatting, spacing, and indentation should be as shown below) – Input is in bold Enter the number of playlists (min: 1): -99 ** ERROR: INVALID NUMBER OF PLAYLISTS ** Enter the number of playlists: 3 Select from one of the following streaming platforms: 1. Jim Bob’s 2. Suzy Bob’s Please choose the streaming platform for playlist #1: 3 ** ERROR: INVALID STREAMING PLATFORM ** Select from one of the following streaming platforms: 1. Jim Bob’s 2. Suzy Bob’s Please choose the streaming platform for playlist #1: 1 Select from one of the following playlist lengths: 1. 3 Songs 2. 5 Songs 3. 10 Songs Please choose the length of playlist #1: -1 ** ERROR: INVALID PLAYLIST LENGTH ** Select from one of the following playlist lengths: 1. 3 Songs 2. 5 Songs 3. 10 Songs Please choose the length of playlist #1: 1 The total of all playlists: $2.23
1. You work for an online song distribution company. 2. Code a modular program that will accept an order of playlists that allows users to pick the platform and the number of songs in the playlist. 3. Your program will calculate the total of the order of playlists. 4. Do not accept any values for playlists other than the possible menu options. Use the table below to calculate the individual playlist costs. Playlist Platform Playlist length Cost Per Playlist Jim Bob’s Pretty Good Music Three Songs $2.23 Five Songs $3.99 Ten Songs $6.69 Suzy Bob’s Better Music Three Songs $3.52 Five Songs $5.05 Ten Songs $8.77 In In addition to main, the program must contain the following functions: getPlaylists() o Ask the user how many playlists will be ordered. Validate the input of the number of playlists so that the user must enter at least one playlist before proceeding with the program. Function must return the validated number of playlists. getPlatform() o Use a menu to prompt the user for the streaming platform. This should be done using a function that accepts a number for the current playlist number and displays the playlist platform menu. This function must prompt the user for a selection and return the choice. User must be given an unlimited number of chances to enter a valid playlist platform choice. Function must return the validated streaming platform. getPlaylistLength() o Prompt the user for the playlist length using a menu. This should be done using a function that accepts the current playlist number. User must be given an unlimited number of chances to enter a valid playlist length. Function must return the validated playlist length. calculatePlaylistCost() o Include a function that calculates the cost of a playlist. This function should accept the streaming platform and the playlist length. Function must return the mask cost. Use global constants stored as lists for the cost of playlist amounts. Calculate and display the total cost of the order of all playlists. Dollar amounts should be properly formatted. Input and Output (formatting, spacing, and indentation should be as shown below) – Input is in bold Enter the number of playlists (min: 1): -99 ** ERROR: INVALID NUMBER OF PLAYLISTS ** Enter the number of playlists: 3 Select from one of the following streaming platforms: 1. Jim Bob’s 2. Suzy Bob’s Please choose the streaming platform for playlist #1: 3 ** ERROR: INVALID STREAMING PLATFORM ** Select from one of the following streaming platforms: 1. Jim Bob’s 2. Suzy Bob’s Please choose the streaming platform for playlist #1: 1 Select from one of the following playlist lengths: 1. 3 Songs 2. 5 Songs 3. 10 Songs Please choose the length of playlist #1: -1 ** ERROR: INVALID PLAYLIST LENGTH ** Select from one of the following playlist lengths: 1. 3 Songs 2. 5 Songs 3. 10 Songs Please choose the length of playlist #1: 1 The total of all playlists: $2.23
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 3 images
The total of all playlists needs to be $2.23 how do we fix this?