Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You have been hired by a file hosting streaming service to write a program that will calculate the cost of a user to store and
You have been hired by a file hosting streaming service to write a program that will calculate the cost of a user to store and stream audio files. The streaming platform hosts two types of audio files: MPEGLayer MP and Waveform Audio WAV These files can be streamed in three different sound qualities, where WAV files can also be streamed in Mono or Stereo. Your source code must use menudriven logic to allow for the user to enter the following audio file information: the file type, the bitrate of sound quality, and the sound type for WAV files After entering the audio file information, the user must enter the duration of the file in minutes and seconds. On this streaming service, files have a maximum duration of total minutes per file. Once the file information and the duration of the stream have been entered, the file size must be calculated in Megabytes MB based on the file information and duration. For metrics purposes, the cost per minute of the stream as well as the cost per MB of the stream must be calculated. Calculate the total cost of the stream including tax and display a bill for the stream of the file. See the Sample Output. The streaming service tax rate is Use named constants declared in your program using the 'const double naming convention to hold the cost per minute bitrate of each of audio quality types, the base subtotal of the stream based on duration in total minutes and seconds and the streaming service tax rate. Use the constants in your calculations and wherever else they are appropriate in your program.
Use the following table to calculate bitrates for streams based on File Types, Sound Type where applicable and Sound Quality. Each bitrate must be stored in a named constant in your source file based on the instructions above:
NOTE MP Files on this platform do not have 'Sound Type' attributes, only WAV files.
File Type Quality Bitrate
MP Standard kbps MB per minute
Premium kbps MB per minute
Ultra Quality kbps MB per minute
WAV Sound Type Quality Bitrate
Mono Standard Quality bit, KHz MB per minute
Premium Quality bit, KHz MB per minute
Ultra Quality bit, KHz MB per minute
Stereo Standard Quality bit, KHz MB per minute
Premium Quality bit, KHz MB per minute
Ultra Quality bit, KHz MB per minute
Use the following table to calculate the subtotal based on the duration of the stream in total minutes and seconds.
NOTE: Each base subtotal must be stored in a named constant per the instructions above.
Stream Length Base Subtotal
minutes or less $
more than minutes and less than minutes $
more than minutes and less than minutes $
more than minutes $
Project is a continuation of Project For this part of the project, you will add a third menu to control the operation of the program. This menu should give the user the ability to process a single MP or WAV file, process multiple randomly generated recording files, or quit the program. For this new menu only, you must validate the users menu choice so that only values of A B or C are accepted and users have an unlimited number of chances to enter a valid menu choice. Your program must continue to run until the user chooses the quit option from your menu.
Steps:
Add a menu to offer the user a choice of processing a single recording file, processing multiple recording files, or quit the program. This menu must consist of the first outputs displayed when your program begins executing. The menu format should match the one in the Sample Run Video.
If option A is selected, the program must allow for the user to enter and process the same information for a single audio file from project
Allow the user to continue making menu choices until they choose the option to quit. Always display the menu before prompting the user for a menu option. Properly handle an invalid menu choice. Your program code must allow the the user to have an unlimited number of chances to enter a valid menu choice.
Update all previous input validations from Project to allow the user unlimited chances to enter valid information if an invalid input of a menu choice or value is entered. Since this is a level course, cross data type input validation is not required.
Add functionality to display randomly generated recordings. When the user selects the option to process multiple recording files, file information must be created and displayed for every file generated. The user must be asked to enter the number of recording files they would like to generate, then random values must be used to generate the audio file type MP or WAV the bitrate quality, and the mono or stereo file type if a WAV file is generated and the duration in minutes and seconds if necessary up to total minutes per recording Eac
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