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

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter14: Introduction To Swing Components
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

 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

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

The total of all playlists needs to be $2.23 how do we fix this?

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Software Development
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage