Answered step by step
Verified Expert Solution
Link Copied!

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: MPEG-Layer 3(MP3) 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 menu-driven 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 180 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 7.23%. 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 - MP3 Files on this platform do not have 'Sound Type' attributes, only WAV files.
File Type Quality Bitrate
MP3 Standard -160kbps 1.20 MB per minute
Premium -192kbps 1.44 MB per minute
Ultra Quality -320kbps 2.40 MB per minute
WAV Sound Type Quality Bitrate
Mono Standard Quality -16 bit, 44.1 KHz 5.29 MB per minute
Premium Quality -24 bit, 48 KHz 8.64 MB per minute
Ultra Quality -24 bit, 96 KHz 17.28 MB per minute
Stereo Standard Quality -16 bit, 44.1 KHz 10.58 MB per minute
Premium Quality -24 bit, 48 KHz 17.28 MB per minute
Ultra Quality -24 bit, 96 KHz 34.56 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
10 minutes or less $1.99
more than 10 minutes and less than 30 minutes $5.99
more than 30 minutes and less than 60 minutes $9.99
more than 60 minutes $12.99
Project 2 is a continuation of Project 1. 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 MP3 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 1.
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 1 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 100 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 (MP3 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 180 total minutes per recording). Eac

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions