×
Samples Blogs Make Payment About Us Reviews 4.9/5 Order Now

Create a Program to Create DJ Playlist Manager in C++ Assignment Solution

July 09, 2024
Dr. Olivia Bennett
Dr. Olivia
🇦🇺 Australia
C++
Dr. Olivia Bennett holds a PhD in Computer Science from a prestigious university in the UK. With over 800 completed orders, she specializes in GUI development and database integration in Qt programming. Her expertise lies in crafting intuitive user interfaces and seamlessly integrating database functionalities into Qt applications.
Key Topics
  • Instructions
    • Objective
  • Requirements and Specifications
Tip of the day
Use meaningful variable and method names in your C# assignments to enhance readability and debugging. Well-structured code not only helps you understand your logic better but also makes collaboration easier with peers or instructors.
News
The Library Carpentry curriculum has released a major update to its Python lesson, integrating JupyterLab, Pandas, and Plotly to enhance data analysis for library professionals

Instructions

Objective

Write a C++ assignment program to create DJ playlist manager.

Requirements and Specifications

DJ Playlist Manager: You will develop a program for a DJ. The DJ needs to be able to enter data about his or her music collection, such as title, artist, length, genre, and so on. The user should be able to create individual playlists from a subset of the entire music collection. A report should be available showing the songs on a particular playlist, as well as their total length and average song length. There should also be a report showing the names of all the playlists and the total length of each playlist. Your final project must include all of the following. Your initial submission will start simple, and you will add features each week. Input and output Use of variables Use of conditional statements Use of loops Use of modules Use of arrays Ability to save and retrieve data microsoft visual studio windows 2019 edtion

Source Code

#include #include #include #include "Playlist.h" using namespace std; void displayMenu() { cout << "1) Create Playlist" << endl; cout << "2) Save current Playlist" << endl; cout << "3) Display current Playlist" << endl; cout << "4) Add song to Playlist" << endl; cout << "5) Print report" << endl; cout << "6) Exit" << endl; } int getMenuOption(string message, int lb, int ub) { // this function asks to user an integer between lb and ub displaying the message. // the function will repeat until the user enters a valid value int option; while (true) { cout << message; cin >> option; cin.ignore(); if (option >= lb && option <= ub) return option; else cout << "Please enter a valid integer between " << lb << " and " << ub << "." << endl; } } int main() { // create a vector to store Playlists vector playlists; // Create a playlist object that will store the playlist with which you will be working Playlist playlist; int option; string playlist_name; string song_title; string song_artist; int song_length; int song_year; string song_genre; while (true) { // display menu displayMenu(); // get menu option option = getMenuOption("Enter selection: ", 1, 6); cout << endl; if (option == 1) { // ask for name cout << "Enter Playlist's name: "; getline(cin, playlist_name); // initialize playlist playlist = Playlist(playlist_name); cout << "Playlist: " << playlist_name << " created." << endl; } else if (option == 2) { playlists.push_back(playlist); cout << "Playlist: " << playlist.getName() << " saved!"; } else if (option == 3) { cout << playlist; cout << endl; } else if (option == 4) { // Ask title cout << "Enter song title: "; getline(cin, song_title); cout << "Enter song artist: "; getline(cin, song_artist); cout << "Enter song genre: "; getline(cin, song_genre); cout << "Enter song year: "; cin >> song_year; cout << "Enter song length (in seconds): "; cin >> song_length; Song song(song_title, song_artist, song_length, song_genre, song_year); playlist.addSong(song); cout << "The following song has been added to Playlist " << playlist.getName() << ": " << song << endl; } else if (option == 5) { if (playlists.size() > 0) { cout << "The following report contains all playlists created and saved." << endl; for (int i = 0; i < playlists.size(); i++) { cout << playlists[i] << endl << endl; } } else cout << "There are no saved Playlists. You must save a Playlist first to add it to the database." << endl; } else if (option == 6) { cout << "Good Bye!" << endl; break; } cout << endl; } }

Similar Samples

Explore our curated samples at ProgrammingHomeworkHelp.com, showcasing expertly crafted solutions across various programming languages and domains. From Java and Python to SQL and C++, each sample demonstrates our proficiency in tackling diverse programming assignments. Whether you need help with algorithms, web development, or database management, our samples illustrate our dedication to delivering quality programming solutions.