Many of us have large digital music collections that are not always very well organized. It would
be nice to have a program that would manipulate our music collection based on attributes such as
artist, album title, song title, genre, song length, number times played, and rating. For this
assignment you will write a basic digital music manager (DMM).
Your DMM program must have a text-based interface which allows the user to select from a
mainmenu of options including: (1) load, (2) store, (3) display, (4) insert, (5) delete, (6) edit, (7)
sort, (8) rate, (9) play, (10) shuffle, and (11) exit. For Part I of the assignment, you will only need
to complete the main menu, (1) load, (2) store, (3) display, (6) edit, (8) rate, (9) play, and (11)
exit features. The other features will be completed in the next part of the assignment.
What must the main menu contain?
The main menu must display the following commands:
(1) load
(2) store
(3) display
(4) insert
(5) delete
(6) edit
(7) sort
(8) rate
(9) play
(10) shuffle
(11) exit
After a command is selected and completed, your program must display the main menu again.
This procedure will continue until the “exit” command is selected.
What must “load” do?
The “load” command must read all records from a file called musicPlayList.csv (you may find a
sample file here) into a dynamic doubly linked list. The doubly linked list is considered the main
playlist. As each record is read from the file, it must be inserted at the front of the list. Each
record consists of the following attributes:
Each attribute, in a single record, will be separated by a comma in the .csv (comma separated
values) file. This means that you will need to design an algorithm to extract the required
attributes for each record. Each field in each record will have a value. You do not need to check
for null or empty values.
You must define a struct called Record to represent the above attributes. Also, do not forget that
the Song Length must be represented by another struct called Duration. Duration is defined as
follows:
Finally, each struct Node in the doubly linked list must be defined as follows:
What must “store” do?
The “store” command writes the current records, in the dynamic doubly linked list, to the
musicPlayList.csv file. The store will completely overwrite the previous contents in the file.
What must “display” do?
The “display” command prints records to the screen. This command must support two methods,
one of which is selected by the user:
Print all records.
Print all records that match an artist.
What must “edit” do?
The “edit” command must allow the user to find a record in the list by artist. If there are multiple
records with the same artist, then your program must prompt the user which one to edit. The user
may modify all of the attributes in the record.
What must “rate” do?
The “rate” command must allow the user to assign a value of 1 – 5 to a song; 1 is the lowest
rating and 5 is the highest rating. The rating will repla.
8.15 Program Playlist (C++) You will be building a linked list. Mak.pdfarenamobiles123
8.15 Program: Playlist (C++) You will be building a linked list. Make sure to keep track of both
the head and tail nodes. (1) Create three files to submit. Playlist.h - Class declaration Playlist.cpp
- Class definition main.cpp - main() function Build the PlaylistNode class per the following
specifications. Note: Some functions can initially be function stubs (empty functions), to be
completed in later steps. Default constructor (1 pt) Parameterized constructor (1 pt) Public
member functions InsertAfter() (1 pt) SetNext() - Mutator (1 pt) GetID() - Accessor
GetSongName() - Accessor GetArtistName() - Accessor GetSongLength() - Accessor GetNext()
- Accessor PrintPlaylistNode() Private data members string uniqueID - Initialized to \"none\" in
default constructor string songName - Initialized to \"none\" in default constructor string
artistName - Initialized to \"none\" in default constructor int songLength - Initialized to 0 in
default constructor PlaylistNode* nextNodePtr - Initialized to 0 in default constructor Ex. of
PrintPlaylistNode output: Unique ID: S123 Song Name: Peg Artist Name: Steely Dan Song
Length (in seconds): 237 (2) In main(), prompt the user for the title of the playlist. (1 pt) Ex:
Enter playlist\'s title: JAMZ (3) Implement the PrintMenu() function. PrintMenu() takes the
playlist title as a parameter and outputs a menu of options to manipulate the playlist. Each option
is represented by a single character. Build and output the menu within the function. If an invalid
character is entered, continue to prompt for a valid choice. Hint: Implement Quit before
implementing other options. Call PrintMenu() in the main() function. Continue to execute the
menu until the user enters q to Quit. (3 pts) Ex: JAMZ PLAYLIST MENU a - Add song d -
Remove song c - Change position of song s - Output songs by specific artist t - Output total time
of playlist (in seconds) o - Output full playlist q - Quit Choose an option: (4) Implement \"Output
full playlist\" menu option. If the list is empty, output: Playlist is empty (3 pts) Ex: JAMZ -
OUTPUT FULL PLAYLIST 1. Unique ID: SD123 Song Name: Peg Artist Name: Steely Dan
Song Length (in seconds): 237 2. Unique ID: JJ234 Song Name: All For You Artist Name: Janet
Jackson Song Length (in seconds): 391 3. Unique ID: J345 Song Name: Canned Heat Artist
Name: Jamiroquai Song Length (in seconds): 330 4. Unique ID: JJ456 Song Name: Black Eagle
Artist Name: Janet Jackson Song Length (in seconds): 197 5. Unique ID: SD567 Song Name: I
Got The News Artist Name: Steely Dan Song Length (in seconds): 306 (5) Implement the \"Add
song\" menu item. New additions are added to the end of the list. (2 pts) Ex: ADD SONG Enter
song\'s unique ID: SD123 Enter song\'s name: Peg Enter artist\'s name: Steely Dan Enter song\'s
length (in seconds): 237 (6) Implement the \"Remove song\" function. Prompt the user for the
unique ID of the song to be removed.(4 pts) Ex: REMOVE SONG Enter song\'s unique ID:
JJ234 \"All For You\" remove.
When performing an investigation it is helpful to be reminded of the powerful options available to the investigator. This document is aimed to be a reference to the tools that could be used.
Can someone please help me implement the addSong function .pdfakshpatil4
Can someone please help me implement the "addSong" function in the code below? Thank
you!
// You are given a partially completed program that creates a list of songs, like a music repository.
// Each song has this information: song's id, song's name, singer's name, genre of the song, and
its published year.
// The struct 'musicRepository' holds information of one song. Genre is enum type.
// An array of structs called 'list' is made to hold the list of songs.
// You should not modify any of the given code, the return types, or the parameters, you will risk of
getting compilation error.
// You are not allowed to modify main ().
// You can use string library functions.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#pragma warning(disable : 4996) // for Visual Studio Only
#define MAX_SONGS 20
#define MAX_SONG_NAME_LENGTH 40
#define MAX_SINGER_NAME_LENGTH 40
typedef enum
{
unclassified = 0,
Pop,
Rock,
Reggae,
Country,
Blues,
Balad,
} genreType; // enum type
struct musicRepository
{
// struct for song details
unsigned int ID;
char songName[MAX_SONG_NAME_LENGTH];
char singerName[MAX_SINGER_NAME_LENGTH];
genreType genre;
unsigned int year;
};
struct musicRepository list[MAX_SONGS]; // declare the list of songs
int numSongs = 0; // the number of songs currently stored in the list (initialized to 0)
// Given functions
void initializeRepository(struct musicRepository repo[], int size);
void printRepository(struct musicRepository repo[], int numSongs);
void flushSngIn();
// functions that need to be implemented by you
int addSong(struct musicRepository repo[], char* songName, char* singerName, char* genre,
unsigned int year, int numSongs);
struct musicRepository* searchSong(struct musicRepository repo[], char* songName, int
numSongs);
void printSong(struct musicRepository repo[], int ID);
int editSong(struct musicRepository* repo, int numSongs, char* songName);
int deleteSongByName(struct musicRepository* repo, char* songName, int numSongs);
// This function takes in an array of musicRepository structures and the size of the array as
parameters. It then loops through each index of the array and sets the values of id, year, genre,
name, and singer to their respective initial values.
// NOTE that strcpy is used to copy an empty string to name and singer, rather than setting them
equal to "". This is because arrays in C are not assignable, so the strcpy function must be used to
copy the empty string into the array.
void initializeRepository(struct musicRepository repo[], int size)
{
for (int i = 0; i < size; i++)
{
repo[i].ID = 0;
repo[i].year = 0;
repo[i].genre = 0;
strcpy(repo[i].songName, "");
strcpy(repo[i].singerName, "");
}
}
// This function takes in the musicRepository array and iterates through each element. If the ID of
the song is not 0, it prints the details of the song.
void printRepository(struct musicRepository repo[], int numSongs)
{
printf("n--- Song Repository ---n");
for (int i = 0; i < numSongs; i++)
{
if (repo[i].ID != 0)
.
Can someone please help me complete the add_song function .pdfakshpatil4
Can someone please help me complete the "add_song" function below. Thank you!
// Each song has this information: song's id, song's name, singer's name, genre of the song, and
its published year.
// The struct 'musicRepository' holds information of one song. Genre is enum type.
// An array of structs called 'list' is made to hold the list of songs.
// You should not modify any of the given code, the return types, or the parameters, you will risk of
getting compilation error.
// You are not allowed to modify main ().
// You can use string library functions.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#pragma warning(disable : 4996) // for Visual Studio Only
#define MAX_SONGS 20
#define MAX_SONG_NAME_LENGTH 40
#define MAX_SINGER_NAME_LENGTH 40
typedef enum
{
unclassified = 0,
Pop,
Rock,
Reggae,
Country,
Blues,
Balad,
} genreType; // enum type
struct musicRepository
{
// struct for song details
unsigned int ID;
char songName[MAX_SONG_NAME_LENGTH];
char singerName[MAX_SINGER_NAME_LENGTH];
genreType genre;
unsigned int year;
};
struct musicRepository list[MAX_SONGS]; // declare the list of songs
int numSongs = 0; // the number of songs currently stored in the list (initialized to 0)
// This function takes in an array of musicRepository structures and the size of the array as
parameters. It then loops through each index of the array and sets the values of id, year, genre,
name, and singer to their respective initial values.
// NOTE that strcpy is used to copy an empty string to name and singer, rather than setting them
equal to "". This is because arrays in C are not assignable, so the strcpy function must be used to
copy the empty string into the array.
void initializeRepository(struct musicRepository repo[], int size)
{
for (int i = 0; i < size; i++)
{
repo[i].ID = 0;
repo[i].year = 0;
repo[i].genre = 0;
strcpy(repo[i].songName, "");
strcpy(repo[i].singerName, "");
}
}
// This function takes in the musicRepository array and iterates through each element. If the ID of
the song is not 0, it prints the details of the song.
void printRepository(struct musicRepository repo[], int numSongs)
{
printf("n--- Song Repository ---n");
for (int i = 0; i < numSongs; i++)
{
if (repo[i].ID != 0)
{
printf("ID: %dn", repo[i].ID);
printf("Name: %sn", repo[i].songName);
printf("Singer: %sn", repo[i].singerName);
if (repo[i].genre == 0)
printf("Genre: unclassifiedn");
else if (repo[i].genre == 1)
printf("Genre: Popn");
else if (repo[i].genre == 2)
printf("Genre: Rockn");
else if (repo[i].genre == 3)
printf("Genre: Reggaen");
else if (repo[i].genre == 4)
printf("Genre: Countryn");
else if (repo[i].genre == 5)
printf("Genre: Bluesn");
else if (repo[i].genre == 6)
printf("Genre: Baladn");
printf("Year: %dn", repo[i].year);
printf("n");
}
}
}
// Problem 2
// struct to hold information about a song
struct Song
{
int id;
char name[MAX_SONG_NAME_LENGTH];
char singer[MAX_SINGER_NAME_LENGTH];
genreType genre;
int year;
struct Song* next;
};
// Function declarati.
8.15 Program Playlist (C++) You will be building a linked list. Mak.pdfarenamobiles123
8.15 Program: Playlist (C++) You will be building a linked list. Make sure to keep track of both
the head and tail nodes. (1) Create three files to submit. Playlist.h - Class declaration Playlist.cpp
- Class definition main.cpp - main() function Build the PlaylistNode class per the following
specifications. Note: Some functions can initially be function stubs (empty functions), to be
completed in later steps. Default constructor (1 pt) Parameterized constructor (1 pt) Public
member functions InsertAfter() (1 pt) SetNext() - Mutator (1 pt) GetID() - Accessor
GetSongName() - Accessor GetArtistName() - Accessor GetSongLength() - Accessor GetNext()
- Accessor PrintPlaylistNode() Private data members string uniqueID - Initialized to \"none\" in
default constructor string songName - Initialized to \"none\" in default constructor string
artistName - Initialized to \"none\" in default constructor int songLength - Initialized to 0 in
default constructor PlaylistNode* nextNodePtr - Initialized to 0 in default constructor Ex. of
PrintPlaylistNode output: Unique ID: S123 Song Name: Peg Artist Name: Steely Dan Song
Length (in seconds): 237 (2) In main(), prompt the user for the title of the playlist. (1 pt) Ex:
Enter playlist\'s title: JAMZ (3) Implement the PrintMenu() function. PrintMenu() takes the
playlist title as a parameter and outputs a menu of options to manipulate the playlist. Each option
is represented by a single character. Build and output the menu within the function. If an invalid
character is entered, continue to prompt for a valid choice. Hint: Implement Quit before
implementing other options. Call PrintMenu() in the main() function. Continue to execute the
menu until the user enters q to Quit. (3 pts) Ex: JAMZ PLAYLIST MENU a - Add song d -
Remove song c - Change position of song s - Output songs by specific artist t - Output total time
of playlist (in seconds) o - Output full playlist q - Quit Choose an option: (4) Implement \"Output
full playlist\" menu option. If the list is empty, output: Playlist is empty (3 pts) Ex: JAMZ -
OUTPUT FULL PLAYLIST 1. Unique ID: SD123 Song Name: Peg Artist Name: Steely Dan
Song Length (in seconds): 237 2. Unique ID: JJ234 Song Name: All For You Artist Name: Janet
Jackson Song Length (in seconds): 391 3. Unique ID: J345 Song Name: Canned Heat Artist
Name: Jamiroquai Song Length (in seconds): 330 4. Unique ID: JJ456 Song Name: Black Eagle
Artist Name: Janet Jackson Song Length (in seconds): 197 5. Unique ID: SD567 Song Name: I
Got The News Artist Name: Steely Dan Song Length (in seconds): 306 (5) Implement the \"Add
song\" menu item. New additions are added to the end of the list. (2 pts) Ex: ADD SONG Enter
song\'s unique ID: SD123 Enter song\'s name: Peg Enter artist\'s name: Steely Dan Enter song\'s
length (in seconds): 237 (6) Implement the \"Remove song\" function. Prompt the user for the
unique ID of the song to be removed.(4 pts) Ex: REMOVE SONG Enter song\'s unique ID:
JJ234 \"All For You\" remove.
When performing an investigation it is helpful to be reminded of the powerful options available to the investigator. This document is aimed to be a reference to the tools that could be used.
Can someone please help me implement the addSong function .pdfakshpatil4
Can someone please help me implement the "addSong" function in the code below? Thank
you!
// You are given a partially completed program that creates a list of songs, like a music repository.
// Each song has this information: song's id, song's name, singer's name, genre of the song, and
its published year.
// The struct 'musicRepository' holds information of one song. Genre is enum type.
// An array of structs called 'list' is made to hold the list of songs.
// You should not modify any of the given code, the return types, or the parameters, you will risk of
getting compilation error.
// You are not allowed to modify main ().
// You can use string library functions.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#pragma warning(disable : 4996) // for Visual Studio Only
#define MAX_SONGS 20
#define MAX_SONG_NAME_LENGTH 40
#define MAX_SINGER_NAME_LENGTH 40
typedef enum
{
unclassified = 0,
Pop,
Rock,
Reggae,
Country,
Blues,
Balad,
} genreType; // enum type
struct musicRepository
{
// struct for song details
unsigned int ID;
char songName[MAX_SONG_NAME_LENGTH];
char singerName[MAX_SINGER_NAME_LENGTH];
genreType genre;
unsigned int year;
};
struct musicRepository list[MAX_SONGS]; // declare the list of songs
int numSongs = 0; // the number of songs currently stored in the list (initialized to 0)
// Given functions
void initializeRepository(struct musicRepository repo[], int size);
void printRepository(struct musicRepository repo[], int numSongs);
void flushSngIn();
// functions that need to be implemented by you
int addSong(struct musicRepository repo[], char* songName, char* singerName, char* genre,
unsigned int year, int numSongs);
struct musicRepository* searchSong(struct musicRepository repo[], char* songName, int
numSongs);
void printSong(struct musicRepository repo[], int ID);
int editSong(struct musicRepository* repo, int numSongs, char* songName);
int deleteSongByName(struct musicRepository* repo, char* songName, int numSongs);
// This function takes in an array of musicRepository structures and the size of the array as
parameters. It then loops through each index of the array and sets the values of id, year, genre,
name, and singer to their respective initial values.
// NOTE that strcpy is used to copy an empty string to name and singer, rather than setting them
equal to "". This is because arrays in C are not assignable, so the strcpy function must be used to
copy the empty string into the array.
void initializeRepository(struct musicRepository repo[], int size)
{
for (int i = 0; i < size; i++)
{
repo[i].ID = 0;
repo[i].year = 0;
repo[i].genre = 0;
strcpy(repo[i].songName, "");
strcpy(repo[i].singerName, "");
}
}
// This function takes in the musicRepository array and iterates through each element. If the ID of
the song is not 0, it prints the details of the song.
void printRepository(struct musicRepository repo[], int numSongs)
{
printf("n--- Song Repository ---n");
for (int i = 0; i < numSongs; i++)
{
if (repo[i].ID != 0)
.
Can someone please help me complete the add_song function .pdfakshpatil4
Can someone please help me complete the "add_song" function below. Thank you!
// Each song has this information: song's id, song's name, singer's name, genre of the song, and
its published year.
// The struct 'musicRepository' holds information of one song. Genre is enum type.
// An array of structs called 'list' is made to hold the list of songs.
// You should not modify any of the given code, the return types, or the parameters, you will risk of
getting compilation error.
// You are not allowed to modify main ().
// You can use string library functions.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#pragma warning(disable : 4996) // for Visual Studio Only
#define MAX_SONGS 20
#define MAX_SONG_NAME_LENGTH 40
#define MAX_SINGER_NAME_LENGTH 40
typedef enum
{
unclassified = 0,
Pop,
Rock,
Reggae,
Country,
Blues,
Balad,
} genreType; // enum type
struct musicRepository
{
// struct for song details
unsigned int ID;
char songName[MAX_SONG_NAME_LENGTH];
char singerName[MAX_SINGER_NAME_LENGTH];
genreType genre;
unsigned int year;
};
struct musicRepository list[MAX_SONGS]; // declare the list of songs
int numSongs = 0; // the number of songs currently stored in the list (initialized to 0)
// This function takes in an array of musicRepository structures and the size of the array as
parameters. It then loops through each index of the array and sets the values of id, year, genre,
name, and singer to their respective initial values.
// NOTE that strcpy is used to copy an empty string to name and singer, rather than setting them
equal to "". This is because arrays in C are not assignable, so the strcpy function must be used to
copy the empty string into the array.
void initializeRepository(struct musicRepository repo[], int size)
{
for (int i = 0; i < size; i++)
{
repo[i].ID = 0;
repo[i].year = 0;
repo[i].genre = 0;
strcpy(repo[i].songName, "");
strcpy(repo[i].singerName, "");
}
}
// This function takes in the musicRepository array and iterates through each element. If the ID of
the song is not 0, it prints the details of the song.
void printRepository(struct musicRepository repo[], int numSongs)
{
printf("n--- Song Repository ---n");
for (int i = 0; i < numSongs; i++)
{
if (repo[i].ID != 0)
{
printf("ID: %dn", repo[i].ID);
printf("Name: %sn", repo[i].songName);
printf("Singer: %sn", repo[i].singerName);
if (repo[i].genre == 0)
printf("Genre: unclassifiedn");
else if (repo[i].genre == 1)
printf("Genre: Popn");
else if (repo[i].genre == 2)
printf("Genre: Rockn");
else if (repo[i].genre == 3)
printf("Genre: Reggaen");
else if (repo[i].genre == 4)
printf("Genre: Countryn");
else if (repo[i].genre == 5)
printf("Genre: Bluesn");
else if (repo[i].genre == 6)
printf("Genre: Baladn");
printf("Year: %dn", repo[i].year);
printf("n");
}
}
}
// Problem 2
// struct to hold information about a song
struct Song
{
int id;
char name[MAX_SONG_NAME_LENGTH];
char singer[MAX_SINGER_NAME_LENGTH];
genreType genre;
int year;
struct Song* next;
};
// Function declarati.
Program 01 For this program you will complete the program in.pdfaddtechglobalmarketi
Program 01
For this program you will complete the program in the a05.c file. Find the places in the code
marked with the ToDo label and complete the work. You should not change any other part of the
code. This includes do not add any global variables or any other function. The program declares a
struct musicRepository with elements for songs ID, songs name, singers name, genre of the song,
and songs year. You will be completing a program that creates a list of songs (array of structs). It
is a menu-driven program where the user is given the following options:
Add a song to the repository - always inserted in the next available space in the array. The next
available array might not be next to the last song added, it might be somewhere in the middle.
Check Delete function below for details. If there is no space to add a new song, the function
should return -1, and 1 otherwise.
Search song by name - given the name of the song, return the struct with the data of the song.
Print a song - given a struct print its content. Please note that the Genre is an enum type;
however, the print function should print a string, not a number for this field.
Edit a song - given the name of the song, find it (using the Search function above), and modify
any of the fields of the song except ID. ID cannot be edited, and all fields should have a valid
value.
Delete a song - given the name of the song, find it (using the Search function above), and modify
the fields of the song (using the Edit function above), making ID, Year, and Genre 0, and name
and author an empty string. Return -1 if the song was not found, 1 if it was deleted.
Print the whole list of songs. Print the list of songs including all the fields of the song except for
ID.
// CSE240 SPRING 2023 Assignment 05
// Enter your name here
// You are given a partially completed program that creates a list of songs, like a
music repository.
// Each song has this information: song's id, song's name, singer's name, genre of
the song, and its published year.
// The struct 'musicRepository' holds information of one song. Genre is enum type.
// An array of structs called 'list' is made to hold the list of songs.
// To begin, you should trace through the given code and understand how it works.
// Please read the instructions above each resquired function and follow the
directions carefully.
// You should not modify any of the given code, the return types, or the
parameters, you will risk of getting compilation error.
// You are not allowed to modify main ().
// You can use string library functions.
// WRITE COMMENTS FOR IMPORTANT STEPS IN YOUR CODE.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#pragma warning(disable : 4996) // for Visual Studio Only
#define MAX_SONGS 20
#define MAX_SONG_NAME_LENGTH 40
#define MAX_SINGER_NAME_LENGTH 40
typedef enum
{
unclassified = 0,
Pop,
Rock,
Reggae,
Country,
Blues,
Balad,
} genreType; // enum type
struct musicRepository
{
// struct for song details
unsigned int ID;
c.
I am having the below compile errors.
*****************************************************************************
******
1>------ Build started: Project: playlist, Configuration: Debug Win32 ------
1> Playlist.cpp
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(74): error
C3867: \'std::list>::size\': non-standard syntax; use \'&\' to create a pointer to member
1> with
1> [
1> _Ty=Playlist
1> ]
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(74): error
C2296: \'>\': illegal, left operand has type \'unsigned int (__thiscall std::list>::* )(void) noexcept
const\'
1> with
1> [
1> _Ty=Playlist
1> ]
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(74): error
C2297: \'>\': illegal, right operand has type \'unsigned int (__thiscall std::list>::* )(void) noexcept
const\'
1> with
1> [
1> _Ty=Playlist
1> ]
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(76): error
C2065: \'it\': undeclared identifier
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(78): error
C2065: \'it\': undeclared identifier
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(78): error
C2227: left of \'->GetID\' must point to class/struct/union/generic type
1> c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(78): note:
type is \'unknown-type\'
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(80): error
C2065: \'it\': undeclared identifier
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(80): error
C2227: left of \'->GetSongName\' must point to class/struct/union/generic type
1> c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(80): note:
type is \'unknown-type\'
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(81): error
C2065: \'it\': undeclared identifier
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(144):
error C3867: \'std::list>::size\': non-standard syntax; use \'&\' to create a pointer to member
1> with
1> [
1> _Ty=Playlist
1> ]
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(144):
error C2446: \'<=\': no conversion from \'unsigned int (__thiscall std::list>::* )(void) noexcept
const\' to \'int\'
1> with
1> [
1> _Ty=Playlist
1> ]
1> c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(144):
note: There is no context in which this conversion is possible
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
****************************************************************
I have three files:
Main.cpp
#include
#include \"Playlist.h\"
using namespace std;
int main()
{
int choice;
string.
8.8 Program Playlist (Java)You will be building a linked list. Ma.pdfARCHANASTOREKOTA
8.8 Program: Playlist (Java)
You will be building a linked list. Make sure to keep track of both the head and tail nodes.
(1) Create two files to submit.
SongEntry.java - Class declaration
Playlist.java - Contains main() method
Build the SongEntry class per the following specifications. Note: Some methods can initially be
method stubs (empty methods), to be completed in later steps.
Private fields
String uniqueID - Initialized to \"none\" in default constructor
string songName - Initialized to \"none\" in default constructor
string artistName - Initialized to \"none\" in default constructor
int songLength - Initialized to 0 in default constructor
SongEntry nextNode - Initialized to null in default constructor
Default constructor (1 pt)
Parameterized constructor (1 pt)
Public member methods
insertAfter() (1 pt)
setNext() - Mutator (1 pt)
getID() - Accessor
getSongName() - Accessor
getArtistName() - Accessor
getSongLength() - Accessor
getNext() - Accessor
printPlaylistSongs()
Ex. of printPlaylistSongs output:
(2) In main(), prompt the user for the title of the playlist. (1 pt)
Ex:
(3) Implement the printMenu() method. printMenu() takes the playlist title as a parameter and
outputs a menu of options to manipulate the playlist. Each option is represented by a single
character. Build and output the menu within the method.
If an invalid character is entered, continue to prompt for a valid choice. Hint: Implement Quit
before implementing other options. Call printMenu() in the main() method. Continue to execute
the menu until the user enters q to Quit. (3 pts)
Ex:
(4) Implement \"Output full playlist\" menu option. If the list is empty, output: Playlist is empty
(3 pts)
Ex:
(5) Implement the \"Add song\" menu item. New additions are added to the end of the list. (2
pts)
Ex:
(6) Implement the \"Remove song\" method. Prompt the user for the unique ID of the song to be
removed.(4 pts)
Ex:
(7) Implement the \"Change position of song\" menu option. Prompt the user for the current
position of the song and the desired new position. Valid new positions are 1 - n (the number of
nodes). If the user enters a new position that is less than 1, move the node to the position 1 (the
head). If the user enters a new position greater than n, move the node to position n (the tail). 6
cases will be tested:
Moving the head node (1 pt)
Moving the tail node (1 pt)
Moving a node to the head (1 pt)
Moving a node to the tail (1 pt)
Moving a node up the list (1 pt)
Moving a node down the list (1 pt)
Ex:
(8) Implement the \"Output songs by specific artist\" menu option. Prompt the user for the
artist\'s name, and output the node\'s information, starting with the node\'s current position. (2 pt)
Ex:
(9) Implement the \"Output total time of playlist\" menu option. Output the sum of the time of
the playlist\'s songs (in seconds). (2 pts)
Ex:
Solution
SongEntry.java
package playlist;
public class SongEntry {
private String uniqueID;
private String songName;
private String artistName.
For this homework, you will write a program to create and manipulate.pdfherminaherman
For this homework, you will write a program to create and manipulate a simple linked list. For
each node in the linked list you will generate a random number, create a node that holds that
number, and insert that node into its sorted position in the linked list. Once the nodes are
inserted, you will traverse the list, printing the value held in each node. Then you will clean up
the list (deleting all the nodes) and exit the program. You will also learn about a tool that you can
use to help you check for memory errors in your code.
Specifications:
Define a struct appropriate for holding a random integer. This struct will also contain a \"next\"
pointer to reference a separate instance of the struct.
You may use the typedef keyword to give your struct a separate typename if you wish, but this is
not a requirement.
The program will read command line arguments. The first argument is the program name (as it
will always be) followed by a random number seed, the number of random numbers to generate
and ending with the Maximum Possible Value of the Random numbers generated (i.e. argc
should be 4).
Your program will use a \"dummy node\" for the linked list. In other words, the head of the list
will be an actual node, but the data field in that node will not be used for sorting purposes.
Your program must contain the following functions:
main() (for obvious reasons)
insertNodeSorted() - You may implement this either of two ways.
One way is to use the head of the list as one parameter and the integer value as the second. The
function will allocate memory for the node, initialize it and then insert it in the proper location in
the list.
The other way is to pass the head of the list as one parameter and a previously allocated and
initialized node as the other. The existing node is inserted in the proper location in the list.
printList() - Takes the head of the list as its only parameter, traverses the list, printing out the
data in sorted order.
deleteList() - Takes the head of the list as its only parameter, traverses the list, deleting all nodes.
The basic algorithm of your program is
Use a loop (based upon command line input values) that:
Generates a random number
Prints the number to stdout
Creates a node that contains that random number
Inserts the new node in sorted order into the existing list
Print the sorted linked list
Delete the linked list
You will use a Makefile to compile your program
Solution
#include
#include
#include
struct test_struct
{
int val;
struct test_struct *next;
};
struct test_struct *head = NULL;
struct test_struct *curr = NULL;
struct test_struct* create_list(int val)
{
printf(\"\ creating list with headnode as [%d]\ \",val);
struct test_struct *ptr = (struct test_struct*)malloc(sizeof(struct test_struct));
if(NULL == ptr)
{
printf(\"\ Node creation failed \ \");
return NULL;
}
ptr->val = val;
ptr->next = NULL;
head = curr = ptr;
return ptr;
}
struct test_struct* add_to_list(int val, bool add_to_end)
{
if(NULL == head)
{
retur.
It's not working what am I doing wrong- Given main()- complete the Son.pdfaanyajoshi90
It's not working what am I doing wrong?
Given main(), complete the SongNode class to include the printSongInfo() method. Then write
the Playlist class' printPlaylist() method to print all songs in the playlist. DO NOT print the
dummy head node.
Ex: If the input is:
the output is:
import java.util.Scanner;
public class Playlist {
// TODO: Write method to ouptut list of songs
public static void printPlaylist(SongNode songs){
SongNode song = song.getNext();
while (song != null) {
song.printSongInfo();
System.out.println();
song = song.getNext();
}
}
public static void main (String[] args) {
Scanner scnr = new Scanner(System.in);
SongNode headNode;
SongNode currNode;
SongNode lastNode;
String songTitle;
int songLength;
String songArtist;
// Front of nodes list
headNode = new SongNode();
lastNode = headNode;
// Read user input until -1 entered
songTitle = scnr.nextLine();
while (!songTitle.equals("-1")) {
songLength = scnr.nextInt();
scnr.nextLine();
songArtist = scnr.nextLine();
currNode = new SongNode(songTitle, songLength, songArtist);
lastNode.insertAfter(currNode);
lastNode = currNode;
songTitle = scnr.nextLine();
}
// Print linked list
System.out.println("LIST OF SONGS");
System.out.println("-------------");
printPlaylist(headNode);
}
}
public class SongNode {
private String songTitle;
private int songLength;
private String songArtist;
private SongNode nextNodeRef; // Reference to the next node
public SongNode() {
songTitle = "";
songLength = 0;
songArtist = "";
nextNodeRef = null;
}
// Constructor
public SongNode(String songTitleInit, int songLengthInit, String songArtistInit) {
this.songTitle = songTitleInit;
this.songLength = songLengthInit;
this.songArtist = songArtistInit;
this.nextNodeRef = null;
}
// Constructor
public SongNode(String songTitleInit, int songLengthInit, String songArtistInit, SongNode
nextLoc) {
this.songTitle = songTitleInit;
this.songLength = songLengthInit;
this.songArtist = songArtistInit;
this.nextNodeRef = nextLoc;
}
// insertAfter
public void insertAfter(SongNode nodeLoc) {
SongNode tmpNext;
tmpNext = this.nextNodeRef;
this.nextNodeRef = nodeLoc;
nodeLoc.nextNodeRef = tmpNext;
}
// Get location pointed by nextNodeRef
public SongNode getNext() {
return this.nextNodeRef;
}
// TODO: Write printSongInfo() method
public void printInfo(){
System.out.println("Title: " + songTitle);
System.out.println("Length: " + songLength);
System.out.println("Artist: " + songArtist);
}
}.
Need help with this java project, as the methods are proving to be p.pdfprajeetjain
Need help with this java project, as the methods are proving to be pretty challenging. Im not
worried about the fields, getters, setters, constructors, ect as those are pretty straightforward, but
any and all help with the methods would be greatly appreciated!
Playable Interface
public interface Playable
Create a Java interface named Playable that includes the following methods (and only the
following methods):
public void play();
public String getName(); // returns the name (for PlayList) or title (for Song) of Playable object.
public int getPlayTimeSeconds(); // For Song: returns the number of seconds in the song. For
PlayList: returns the number of seconds in the entire PlayList
Both the Song and PlayList classes will implement this interface.
Song Class
public class Song
private String artist // the artist performing the song
private String title // the title of the song
private int minutes // number of min in length
private int seconds // number of seconds of length of the song (always less than 60)
// Add Getters / Setters for all fields
// Three constructors (remember to initialize ALL fields in each of the constructors - regardless
of the number of parameters!)
public Song(String artist, String title)
public Song(String artist, String title, int minutes, int seconds)
public Song(Song s)
public boolean equals(Object o) // a song is equal if all four fields are equal
public String toString() { // Use this code for toString EXACTLY
return \"{Song: title = \" + title + \" artist = \" + artist + \"}\";
}
public void play() { // Use this code for play EXACTLY
System.out.printf(\"Playing Song: artist = %-20s title = %s\ \", artist, title);
}
Make the Song class implement the interface Comparable, and make the ordering criteria as
follows: Songs will be ordered by artist in ascending order. If the artists are the same, then by
title in ascending order. If both artist and title are the same, then any order is acceptable.
Don’t forget to include any methods needed to implement the Playable interface.
PlayList Class
public class PlayList
Methods that modify the list should return a boolean return true if they successfully change the
list, otherwise they return false. Note that a PlayList can contain other PlayLists!
Methods that return a Playable element return null if they fail to find the song in question.
private String name // contains the name of the playlist
private ArrayList playableList // ArrayList of Playable elements that make up the play list
// Add Getters / Setters for name and songList
// Add a toString() method that returns the name of the playlist followed by its contents (by
calling toString() on each item it contains). You should only have one name/title per line
// Two constructors (remember to initialize ALL fields in each of the constructors - regardless of
the number of parameters!)
public PlayList() // empty play list named \"Untitled\"
public PlayList(String newName) // empty play list
public boolean loadSongs(String fil.
In C++ please I need output please You will be building a .pdfsunilverma8487
In C++ please I need output please
You will be building a linked list. Make sure to keep track of both the head and tail nodes.
(1) Create three files to submit.
PlaylistNode.h - Class declaration
PlaylistNode.cpp - Class definition
main.cpp - main() function
Build the PlaylistNode class per the following specifications. Note: Some functions can initially be
function stubs (empty functions), to be completed in later steps.
Default constructor (1 pt)
Parameterized constructor (1 pt)
Public member functions
InsertAfter() - Mutator (1 pt)
SetNext() - Mutator (1 pt)
GetID() - Accessor
GetSongName() - Accessor
GetArtistName() - Accessor
GetSongLength() - Accessor
GetNext() - Accessor
PrintPlaylistNode()
Private data members
string uniqueID - Initialized to "none" in default constructor
string songName - Initialized to "none" in default constructor
string artistName - Initialized to "none" in default constructor
int songLength - Initialized to 0 in default constructor
PlaylistNode* nextNodePtr - Initialized to 0 in default constructor
Ex. of PrintPlaylistNode output:
(2) In main(), prompt the user for the title of the playlist. (1 pt)
Ex:
(3) Implement the PrintMenu() function. PrintMenu() takes the playlist title as a parameter and
outputs a menu of options to manipulate the playlist. (1 pt)
Ex:
(4) Implement the ExecuteMenu() function that takes 3 parameters: a character representing the
user's choice, a playlist title, and the pointer to the head node of a playlist. ExecuteMenu()
performs the menu options (described below) according to the user's choice, and returns the
pointer to the head node of the playlist.(1 pt)
(5) In main(), call PrintMenu() and prompt for the user's choice of menu options. Each option is
represented by a single character.
If an invalid character is entered, continue to prompt for a valid choice. When a valid option is
entered, execute the option by calling ExecuteMenu() and overwrite the pointer to the head node
of the playlist with the returned pointer. Then, print the menu, and prompt for a new option.
Continue until the user enters 'q'. Hint: Implement Quit before implementing other options. (1 pt)
Ex:
(6) Implement "Output full playlist" menu option in ExecuteMenu(). If the list is empty, output:
Playlist is empty (3 pts)
Ex:
(7) Implement the "Add song" menu option in ExecuteMenu(). New additions are added to the end
of the list. (2 pts)
Ex:
(8) Implement the "Remove song" menu option in ExecuteMenu(). Prompt the user for the unique
ID of the song to be removed.(4 pts)
Ex:
(9) Implement the "Change position of song" menu option in ExecuteMenu(). Prompt the user for
the current position of the song and the desired new position. Valid new positions are 1 - n (the
number of nodes). If the user enters a new position that is less than 1, move the node to the
position 1 (the head). If the user enters a new position greater than n, move the node to position n
(the tail). 6 cases will be tested:
Moving the head node (1 pt)
.
819 LAB Program Playlist c++ You will be building a li.pdfmeenaaarika
8.19 LAB*: Program: Playlist (c++)
You will be building a linked list. Make sure to keep track of both the head and tail nodes.
(1) Create three files to submit.
PlaylistNode.h - Class declaration
PlaylistNode.cpp - Class definition
main.cpp - main() function
Build the PlaylistNode class per the following specifications. Note: Some functions can initially be
function stubs (empty functions), to be completed in later steps.
Default constructor (1 pt)
Parameterized constructor (1 pt)
Public member functions
InsertAfter() - Mutator (1 pt)
SetNext() - Mutator (1 pt)
GetID() - Accessor
GetSongName() - Accessor
GetArtistName() - Accessor
GetSongLength() - Accessor
GetNext() - Accessor
PrintPlaylistNode()
Private data members
string uniqueID - Initialized to "none" in default constructor
string songName - Initialized to "none" in default constructor
string artistName - Initialized to "none" in default constructor
int songLength - Initialized to 0 in default constructor
PlaylistNode* nextNodePtr - Initialized to 0 in default constructor
Ex. of PrintPlaylistNode output:
(2) In main(), prompt the user for the title of the playlist. (1 pt)
Ex:
(3) Implement the PrintMenu() function. PrintMenu() takes the playlist title as a parameter and
outputs a menu of options to manipulate the playlist. (1 pt)
Ex:
(4) Implement the ExecuteMenu() function that takes 3 parameters: a character representing the
user's choice, a playlist title, and the pointer to the head node of a playlist. ExecuteMenu()
performs the menu options (described below) according to the user's choice, and returns the
pointer to the head node of the playlist.(1 pt)
(5) In main(), call PrintMenu() and prompt for the user's choice of menu options. Each option is
represented by a single character.
If an invalid character is entered, continue to prompt for a valid choice. When a valid option is
entered, execute the option by calling ExecuteMenu() and overwrite the pointer to the head node
of the playlist with the returned pointer. Then, print the menu, and prompt for a new option.
Continue until the user enters 'q'. Hint: Implement Quit before implementing other options. (1 pt)
Ex:
(6) Implement "Output full playlist" menu option in ExecuteMenu(). If the list is empty, output:
Playlist is empty (3 pts)
Ex:
(7) Implement the "Add song" menu option in ExecuteMenu(). New additions are added to the end
of the list. (2 pts)
Ex:
(8) Implement the "Remove song" menu option in ExecuteMenu(). Prompt the user for the unique
ID of the song to be removed.(4 pts)
Ex:
(9) Implement the "Change position of song" menu option in ExecuteMenu(). Prompt the user for
the current position of the song and the desired new position. Valid new positions are 1 - n (the
number of nodes). If the user enters a new position that is less than 1, move the node to the
position 1 (the head). If the user enters a new position greater than n, move the node to position n
(the tail). 6 cases will be tested:
Moving the head node (1 pt)
.
H&M The Challenges of Global Expansion and the Move to adopt Intern.pdffazanmobiles
H&M: The Challenges of Global Expansion and the Move to adopt International Financial
Reporting standards Hennes & Mauritz AB (also known as H&M) , the Swedish MNE that is a
trendsetter in the latest fashion trends, has a stated goal “to give customers unbeatable value by
offering fashion and quality at the best price.” It doesn’t own any factories, but rather outsources
production to independent suppliers, primarily in Asia and Europe. H&M also rents space from
international and local landlords rather than owning its own stores. H&M is a major firm in the
apparel retail market where fashion trends are critical and where goods move quickly. In this
industry, the key buyers are consumers, and the key suppliers are clothing manufacturers and
wholesalers, and designers are king and a fast, well-organized supply chain is essential.
Depending on the individual firm strategy, the apparel retail market doesn’t have to be capital
intensive, but the largest players in the industry are very international, both in retail footprint and
suppliers. The biggest companies in the industry are U.S.-based The Gap, H&M, and Spain-
based Industria de Diseno Textil, S.A. (Inditex), better known by its flagship brand, Zara. All
three companies have different store brands: Gap, Banana Republic, Old Navy, and Athleta for
The Gap; H&M, COS (collection of style), Monki, Weekday, and Cheap Monday for H&M; and
Zara, Bershka, Pull and bear, Massimo Dutti, Stradivarius, Oysho, Zara Home and Uterque for
Inditex. Both of H&M’s competitors are very international. H&M operates about 2,800 stores in
49 markets, whereas The Gap operates 3,100 company stores and over 300 franchise stores
worldwide, and Inditex operates in a network of over 5,000 stores in 77 countries. Zara has the
largest geographic spread within Inditex with stores in 74 countries. Hennes & Mauritz AB
started as a single women’s wear store in Sweden in 1947. Today, H&M’s business is much
broader and currently includes the sales of clothing, accessories, footwear, cosmetics, and home
textiles. Although H&M is known as one of Sweden’s premier MNEs, it generates 21.5% of its
sales in Germany, 8.9% in the United States, and 7.4% in the United Kingdom, compared to only
5.8% of total sales in Sweden. H&M and Zara have very different strategies. Zara delivers new
products to its stores twice a week. Because of its highly organized supply chain, Zara only takes
10–15 days to go from design to the stores. Although it sources its apparel from around the
world, it has adopted just-in-time manufacturing from the auto industry and established 14 highly
automated Spanish factories where robots cut and dye fabrics creating the unfinished “gray
goods” which are the foundation for their final products. It then takes the gray goods and
outsources them to a network of small shops in Portugal and Spain to do the finish work. Store
managers are constantly sending updated information on consumer demand so that they can
move to the n.
C++ ProgrammingYou are to develop a program to read Baseball playe.pdffazanmobiles
C++ Programming
You are to develop a program to read Baseball player statistics from an input file. Each player
should bestored in a Player object. Therefore, you need to reuse the Player class from program 1.
Each playerwill have a first name, last name, a position (strings) and a batting average (floating
point number).
This program adds on to the requirements for Program #1. This will read int he same type of
player data from an input file and write the results to an output file.
New Requirements
You are to reuse your Player class from Program1. You are to implement a PlayerList data
structure/data type that stores players in a Linked List structure (internal to the class). Store the
players in the list in alphabetical order (By lastname, use firstname to further distinguish in the
event there is more than 1 player with the same last name).
You will need to add the class PlayerList and the class Node to facilitate the linked list
operations.
You must implement the following operations on your PlayerList along with any other utility
functionsyou might need. You may also need to add operations to the class Player to facilitate
comparisons sincePlayer data is private.
Operations
Default Constructor
Destructor
Add a Player to the List
Iterate through the List so that you can get each player
Clear out the list to make it empty
Test if a list isEmpty
Get the size of the list
Find a Player in the List (get) - Put a couple of hard-coded calls in your main program to make
sure this feature works.
Summary of Operation
Prompt the user for the input and output file names. DO NOT hardcode file names into your
program.
Open input file
Read each player and add them to your PlayerList Keep track of the number of players in the list
Store the players in the list in alphabetical order (lastname then firstname in the event of
twopeople with the same last name). You should be adding them in between other nodes
asappropriate
Test your find operation a couple of times. This can be hardcoded into your program. You donot
have to prompt the user for players, unless you wish to. Just make sure you test for playersthat
exist and that do not
Open an output file Write each player from the list into the output file, along with any other
output required by theassignment
Split your program code files into the appropriate .cpp and .h files for each of your
classes.(Exception - your NODE class can be defined in the same file as the PlayerList).
Detailed comments describing what is happening
Here is the input file:
Chipper Jones 3B 0.303
Rafael Furcal SS 0.281
Hank Aaron RF 0.305
Here is my player.h file
// Class Definition: Player
// Version 1
// This class defines an object to hold information about
// baseball player for use in a player database.
//--------------------------------------------------------
#include
using namespace std;
class Player {
string m_firstName; // player\'s first name
string m_lastName; // player\'s last name
string m_position; // player\'s primar.
More Related Content
Similar to Many of us have large digital music collections that are not always .pdf
Program 01 For this program you will complete the program in.pdfaddtechglobalmarketi
Program 01
For this program you will complete the program in the a05.c file. Find the places in the code
marked with the ToDo label and complete the work. You should not change any other part of the
code. This includes do not add any global variables or any other function. The program declares a
struct musicRepository with elements for songs ID, songs name, singers name, genre of the song,
and songs year. You will be completing a program that creates a list of songs (array of structs). It
is a menu-driven program where the user is given the following options:
Add a song to the repository - always inserted in the next available space in the array. The next
available array might not be next to the last song added, it might be somewhere in the middle.
Check Delete function below for details. If there is no space to add a new song, the function
should return -1, and 1 otherwise.
Search song by name - given the name of the song, return the struct with the data of the song.
Print a song - given a struct print its content. Please note that the Genre is an enum type;
however, the print function should print a string, not a number for this field.
Edit a song - given the name of the song, find it (using the Search function above), and modify
any of the fields of the song except ID. ID cannot be edited, and all fields should have a valid
value.
Delete a song - given the name of the song, find it (using the Search function above), and modify
the fields of the song (using the Edit function above), making ID, Year, and Genre 0, and name
and author an empty string. Return -1 if the song was not found, 1 if it was deleted.
Print the whole list of songs. Print the list of songs including all the fields of the song except for
ID.
// CSE240 SPRING 2023 Assignment 05
// Enter your name here
// You are given a partially completed program that creates a list of songs, like a
music repository.
// Each song has this information: song's id, song's name, singer's name, genre of
the song, and its published year.
// The struct 'musicRepository' holds information of one song. Genre is enum type.
// An array of structs called 'list' is made to hold the list of songs.
// To begin, you should trace through the given code and understand how it works.
// Please read the instructions above each resquired function and follow the
directions carefully.
// You should not modify any of the given code, the return types, or the
parameters, you will risk of getting compilation error.
// You are not allowed to modify main ().
// You can use string library functions.
// WRITE COMMENTS FOR IMPORTANT STEPS IN YOUR CODE.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#pragma warning(disable : 4996) // for Visual Studio Only
#define MAX_SONGS 20
#define MAX_SONG_NAME_LENGTH 40
#define MAX_SINGER_NAME_LENGTH 40
typedef enum
{
unclassified = 0,
Pop,
Rock,
Reggae,
Country,
Blues,
Balad,
} genreType; // enum type
struct musicRepository
{
// struct for song details
unsigned int ID;
c.
I am having the below compile errors.
*****************************************************************************
******
1>------ Build started: Project: playlist, Configuration: Debug Win32 ------
1> Playlist.cpp
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(74): error
C3867: \'std::list>::size\': non-standard syntax; use \'&\' to create a pointer to member
1> with
1> [
1> _Ty=Playlist
1> ]
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(74): error
C2296: \'>\': illegal, left operand has type \'unsigned int (__thiscall std::list>::* )(void) noexcept
const\'
1> with
1> [
1> _Ty=Playlist
1> ]
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(74): error
C2297: \'>\': illegal, right operand has type \'unsigned int (__thiscall std::list>::* )(void) noexcept
const\'
1> with
1> [
1> _Ty=Playlist
1> ]
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(76): error
C2065: \'it\': undeclared identifier
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(78): error
C2065: \'it\': undeclared identifier
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(78): error
C2227: left of \'->GetID\' must point to class/struct/union/generic type
1> c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(78): note:
type is \'unknown-type\'
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(80): error
C2065: \'it\': undeclared identifier
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(80): error
C2227: left of \'->GetSongName\' must point to class/struct/union/generic type
1> c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(80): note:
type is \'unknown-type\'
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(81): error
C2065: \'it\': undeclared identifier
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(144):
error C3867: \'std::list>::size\': non-standard syntax; use \'&\' to create a pointer to member
1> with
1> [
1> _Ty=Playlist
1> ]
1>c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(144):
error C2446: \'<=\': no conversion from \'unsigned int (__thiscall std::list>::* )(void) noexcept
const\' to \'int\'
1> with
1> [
1> _Ty=Playlist
1> ]
1> c:\\users\ rg\\documents\\visual studio 2015\\projects\\playlist\\playlist\\playlist.cpp(144):
note: There is no context in which this conversion is possible
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
****************************************************************
I have three files:
Main.cpp
#include
#include \"Playlist.h\"
using namespace std;
int main()
{
int choice;
string.
8.8 Program Playlist (Java)You will be building a linked list. Ma.pdfARCHANASTOREKOTA
8.8 Program: Playlist (Java)
You will be building a linked list. Make sure to keep track of both the head and tail nodes.
(1) Create two files to submit.
SongEntry.java - Class declaration
Playlist.java - Contains main() method
Build the SongEntry class per the following specifications. Note: Some methods can initially be
method stubs (empty methods), to be completed in later steps.
Private fields
String uniqueID - Initialized to \"none\" in default constructor
string songName - Initialized to \"none\" in default constructor
string artistName - Initialized to \"none\" in default constructor
int songLength - Initialized to 0 in default constructor
SongEntry nextNode - Initialized to null in default constructor
Default constructor (1 pt)
Parameterized constructor (1 pt)
Public member methods
insertAfter() (1 pt)
setNext() - Mutator (1 pt)
getID() - Accessor
getSongName() - Accessor
getArtistName() - Accessor
getSongLength() - Accessor
getNext() - Accessor
printPlaylistSongs()
Ex. of printPlaylistSongs output:
(2) In main(), prompt the user for the title of the playlist. (1 pt)
Ex:
(3) Implement the printMenu() method. printMenu() takes the playlist title as a parameter and
outputs a menu of options to manipulate the playlist. Each option is represented by a single
character. Build and output the menu within the method.
If an invalid character is entered, continue to prompt for a valid choice. Hint: Implement Quit
before implementing other options. Call printMenu() in the main() method. Continue to execute
the menu until the user enters q to Quit. (3 pts)
Ex:
(4) Implement \"Output full playlist\" menu option. If the list is empty, output: Playlist is empty
(3 pts)
Ex:
(5) Implement the \"Add song\" menu item. New additions are added to the end of the list. (2
pts)
Ex:
(6) Implement the \"Remove song\" method. Prompt the user for the unique ID of the song to be
removed.(4 pts)
Ex:
(7) Implement the \"Change position of song\" menu option. Prompt the user for the current
position of the song and the desired new position. Valid new positions are 1 - n (the number of
nodes). If the user enters a new position that is less than 1, move the node to the position 1 (the
head). If the user enters a new position greater than n, move the node to position n (the tail). 6
cases will be tested:
Moving the head node (1 pt)
Moving the tail node (1 pt)
Moving a node to the head (1 pt)
Moving a node to the tail (1 pt)
Moving a node up the list (1 pt)
Moving a node down the list (1 pt)
Ex:
(8) Implement the \"Output songs by specific artist\" menu option. Prompt the user for the
artist\'s name, and output the node\'s information, starting with the node\'s current position. (2 pt)
Ex:
(9) Implement the \"Output total time of playlist\" menu option. Output the sum of the time of
the playlist\'s songs (in seconds). (2 pts)
Ex:
Solution
SongEntry.java
package playlist;
public class SongEntry {
private String uniqueID;
private String songName;
private String artistName.
For this homework, you will write a program to create and manipulate.pdfherminaherman
For this homework, you will write a program to create and manipulate a simple linked list. For
each node in the linked list you will generate a random number, create a node that holds that
number, and insert that node into its sorted position in the linked list. Once the nodes are
inserted, you will traverse the list, printing the value held in each node. Then you will clean up
the list (deleting all the nodes) and exit the program. You will also learn about a tool that you can
use to help you check for memory errors in your code.
Specifications:
Define a struct appropriate for holding a random integer. This struct will also contain a \"next\"
pointer to reference a separate instance of the struct.
You may use the typedef keyword to give your struct a separate typename if you wish, but this is
not a requirement.
The program will read command line arguments. The first argument is the program name (as it
will always be) followed by a random number seed, the number of random numbers to generate
and ending with the Maximum Possible Value of the Random numbers generated (i.e. argc
should be 4).
Your program will use a \"dummy node\" for the linked list. In other words, the head of the list
will be an actual node, but the data field in that node will not be used for sorting purposes.
Your program must contain the following functions:
main() (for obvious reasons)
insertNodeSorted() - You may implement this either of two ways.
One way is to use the head of the list as one parameter and the integer value as the second. The
function will allocate memory for the node, initialize it and then insert it in the proper location in
the list.
The other way is to pass the head of the list as one parameter and a previously allocated and
initialized node as the other. The existing node is inserted in the proper location in the list.
printList() - Takes the head of the list as its only parameter, traverses the list, printing out the
data in sorted order.
deleteList() - Takes the head of the list as its only parameter, traverses the list, deleting all nodes.
The basic algorithm of your program is
Use a loop (based upon command line input values) that:
Generates a random number
Prints the number to stdout
Creates a node that contains that random number
Inserts the new node in sorted order into the existing list
Print the sorted linked list
Delete the linked list
You will use a Makefile to compile your program
Solution
#include
#include
#include
struct test_struct
{
int val;
struct test_struct *next;
};
struct test_struct *head = NULL;
struct test_struct *curr = NULL;
struct test_struct* create_list(int val)
{
printf(\"\ creating list with headnode as [%d]\ \",val);
struct test_struct *ptr = (struct test_struct*)malloc(sizeof(struct test_struct));
if(NULL == ptr)
{
printf(\"\ Node creation failed \ \");
return NULL;
}
ptr->val = val;
ptr->next = NULL;
head = curr = ptr;
return ptr;
}
struct test_struct* add_to_list(int val, bool add_to_end)
{
if(NULL == head)
{
retur.
It's not working what am I doing wrong- Given main()- complete the Son.pdfaanyajoshi90
It's not working what am I doing wrong?
Given main(), complete the SongNode class to include the printSongInfo() method. Then write
the Playlist class' printPlaylist() method to print all songs in the playlist. DO NOT print the
dummy head node.
Ex: If the input is:
the output is:
import java.util.Scanner;
public class Playlist {
// TODO: Write method to ouptut list of songs
public static void printPlaylist(SongNode songs){
SongNode song = song.getNext();
while (song != null) {
song.printSongInfo();
System.out.println();
song = song.getNext();
}
}
public static void main (String[] args) {
Scanner scnr = new Scanner(System.in);
SongNode headNode;
SongNode currNode;
SongNode lastNode;
String songTitle;
int songLength;
String songArtist;
// Front of nodes list
headNode = new SongNode();
lastNode = headNode;
// Read user input until -1 entered
songTitle = scnr.nextLine();
while (!songTitle.equals("-1")) {
songLength = scnr.nextInt();
scnr.nextLine();
songArtist = scnr.nextLine();
currNode = new SongNode(songTitle, songLength, songArtist);
lastNode.insertAfter(currNode);
lastNode = currNode;
songTitle = scnr.nextLine();
}
// Print linked list
System.out.println("LIST OF SONGS");
System.out.println("-------------");
printPlaylist(headNode);
}
}
public class SongNode {
private String songTitle;
private int songLength;
private String songArtist;
private SongNode nextNodeRef; // Reference to the next node
public SongNode() {
songTitle = "";
songLength = 0;
songArtist = "";
nextNodeRef = null;
}
// Constructor
public SongNode(String songTitleInit, int songLengthInit, String songArtistInit) {
this.songTitle = songTitleInit;
this.songLength = songLengthInit;
this.songArtist = songArtistInit;
this.nextNodeRef = null;
}
// Constructor
public SongNode(String songTitleInit, int songLengthInit, String songArtistInit, SongNode
nextLoc) {
this.songTitle = songTitleInit;
this.songLength = songLengthInit;
this.songArtist = songArtistInit;
this.nextNodeRef = nextLoc;
}
// insertAfter
public void insertAfter(SongNode nodeLoc) {
SongNode tmpNext;
tmpNext = this.nextNodeRef;
this.nextNodeRef = nodeLoc;
nodeLoc.nextNodeRef = tmpNext;
}
// Get location pointed by nextNodeRef
public SongNode getNext() {
return this.nextNodeRef;
}
// TODO: Write printSongInfo() method
public void printInfo(){
System.out.println("Title: " + songTitle);
System.out.println("Length: " + songLength);
System.out.println("Artist: " + songArtist);
}
}.
Need help with this java project, as the methods are proving to be p.pdfprajeetjain
Need help with this java project, as the methods are proving to be pretty challenging. Im not
worried about the fields, getters, setters, constructors, ect as those are pretty straightforward, but
any and all help with the methods would be greatly appreciated!
Playable Interface
public interface Playable
Create a Java interface named Playable that includes the following methods (and only the
following methods):
public void play();
public String getName(); // returns the name (for PlayList) or title (for Song) of Playable object.
public int getPlayTimeSeconds(); // For Song: returns the number of seconds in the song. For
PlayList: returns the number of seconds in the entire PlayList
Both the Song and PlayList classes will implement this interface.
Song Class
public class Song
private String artist // the artist performing the song
private String title // the title of the song
private int minutes // number of min in length
private int seconds // number of seconds of length of the song (always less than 60)
// Add Getters / Setters for all fields
// Three constructors (remember to initialize ALL fields in each of the constructors - regardless
of the number of parameters!)
public Song(String artist, String title)
public Song(String artist, String title, int minutes, int seconds)
public Song(Song s)
public boolean equals(Object o) // a song is equal if all four fields are equal
public String toString() { // Use this code for toString EXACTLY
return \"{Song: title = \" + title + \" artist = \" + artist + \"}\";
}
public void play() { // Use this code for play EXACTLY
System.out.printf(\"Playing Song: artist = %-20s title = %s\ \", artist, title);
}
Make the Song class implement the interface Comparable, and make the ordering criteria as
follows: Songs will be ordered by artist in ascending order. If the artists are the same, then by
title in ascending order. If both artist and title are the same, then any order is acceptable.
Don’t forget to include any methods needed to implement the Playable interface.
PlayList Class
public class PlayList
Methods that modify the list should return a boolean return true if they successfully change the
list, otherwise they return false. Note that a PlayList can contain other PlayLists!
Methods that return a Playable element return null if they fail to find the song in question.
private String name // contains the name of the playlist
private ArrayList playableList // ArrayList of Playable elements that make up the play list
// Add Getters / Setters for name and songList
// Add a toString() method that returns the name of the playlist followed by its contents (by
calling toString() on each item it contains). You should only have one name/title per line
// Two constructors (remember to initialize ALL fields in each of the constructors - regardless of
the number of parameters!)
public PlayList() // empty play list named \"Untitled\"
public PlayList(String newName) // empty play list
public boolean loadSongs(String fil.
In C++ please I need output please You will be building a .pdfsunilverma8487
In C++ please I need output please
You will be building a linked list. Make sure to keep track of both the head and tail nodes.
(1) Create three files to submit.
PlaylistNode.h - Class declaration
PlaylistNode.cpp - Class definition
main.cpp - main() function
Build the PlaylistNode class per the following specifications. Note: Some functions can initially be
function stubs (empty functions), to be completed in later steps.
Default constructor (1 pt)
Parameterized constructor (1 pt)
Public member functions
InsertAfter() - Mutator (1 pt)
SetNext() - Mutator (1 pt)
GetID() - Accessor
GetSongName() - Accessor
GetArtistName() - Accessor
GetSongLength() - Accessor
GetNext() - Accessor
PrintPlaylistNode()
Private data members
string uniqueID - Initialized to "none" in default constructor
string songName - Initialized to "none" in default constructor
string artistName - Initialized to "none" in default constructor
int songLength - Initialized to 0 in default constructor
PlaylistNode* nextNodePtr - Initialized to 0 in default constructor
Ex. of PrintPlaylistNode output:
(2) In main(), prompt the user for the title of the playlist. (1 pt)
Ex:
(3) Implement the PrintMenu() function. PrintMenu() takes the playlist title as a parameter and
outputs a menu of options to manipulate the playlist. (1 pt)
Ex:
(4) Implement the ExecuteMenu() function that takes 3 parameters: a character representing the
user's choice, a playlist title, and the pointer to the head node of a playlist. ExecuteMenu()
performs the menu options (described below) according to the user's choice, and returns the
pointer to the head node of the playlist.(1 pt)
(5) In main(), call PrintMenu() and prompt for the user's choice of menu options. Each option is
represented by a single character.
If an invalid character is entered, continue to prompt for a valid choice. When a valid option is
entered, execute the option by calling ExecuteMenu() and overwrite the pointer to the head node
of the playlist with the returned pointer. Then, print the menu, and prompt for a new option.
Continue until the user enters 'q'. Hint: Implement Quit before implementing other options. (1 pt)
Ex:
(6) Implement "Output full playlist" menu option in ExecuteMenu(). If the list is empty, output:
Playlist is empty (3 pts)
Ex:
(7) Implement the "Add song" menu option in ExecuteMenu(). New additions are added to the end
of the list. (2 pts)
Ex:
(8) Implement the "Remove song" menu option in ExecuteMenu(). Prompt the user for the unique
ID of the song to be removed.(4 pts)
Ex:
(9) Implement the "Change position of song" menu option in ExecuteMenu(). Prompt the user for
the current position of the song and the desired new position. Valid new positions are 1 - n (the
number of nodes). If the user enters a new position that is less than 1, move the node to the
position 1 (the head). If the user enters a new position greater than n, move the node to position n
(the tail). 6 cases will be tested:
Moving the head node (1 pt)
.
819 LAB Program Playlist c++ You will be building a li.pdfmeenaaarika
8.19 LAB*: Program: Playlist (c++)
You will be building a linked list. Make sure to keep track of both the head and tail nodes.
(1) Create three files to submit.
PlaylistNode.h - Class declaration
PlaylistNode.cpp - Class definition
main.cpp - main() function
Build the PlaylistNode class per the following specifications. Note: Some functions can initially be
function stubs (empty functions), to be completed in later steps.
Default constructor (1 pt)
Parameterized constructor (1 pt)
Public member functions
InsertAfter() - Mutator (1 pt)
SetNext() - Mutator (1 pt)
GetID() - Accessor
GetSongName() - Accessor
GetArtistName() - Accessor
GetSongLength() - Accessor
GetNext() - Accessor
PrintPlaylistNode()
Private data members
string uniqueID - Initialized to "none" in default constructor
string songName - Initialized to "none" in default constructor
string artistName - Initialized to "none" in default constructor
int songLength - Initialized to 0 in default constructor
PlaylistNode* nextNodePtr - Initialized to 0 in default constructor
Ex. of PrintPlaylistNode output:
(2) In main(), prompt the user for the title of the playlist. (1 pt)
Ex:
(3) Implement the PrintMenu() function. PrintMenu() takes the playlist title as a parameter and
outputs a menu of options to manipulate the playlist. (1 pt)
Ex:
(4) Implement the ExecuteMenu() function that takes 3 parameters: a character representing the
user's choice, a playlist title, and the pointer to the head node of a playlist. ExecuteMenu()
performs the menu options (described below) according to the user's choice, and returns the
pointer to the head node of the playlist.(1 pt)
(5) In main(), call PrintMenu() and prompt for the user's choice of menu options. Each option is
represented by a single character.
If an invalid character is entered, continue to prompt for a valid choice. When a valid option is
entered, execute the option by calling ExecuteMenu() and overwrite the pointer to the head node
of the playlist with the returned pointer. Then, print the menu, and prompt for a new option.
Continue until the user enters 'q'. Hint: Implement Quit before implementing other options. (1 pt)
Ex:
(6) Implement "Output full playlist" menu option in ExecuteMenu(). If the list is empty, output:
Playlist is empty (3 pts)
Ex:
(7) Implement the "Add song" menu option in ExecuteMenu(). New additions are added to the end
of the list. (2 pts)
Ex:
(8) Implement the "Remove song" menu option in ExecuteMenu(). Prompt the user for the unique
ID of the song to be removed.(4 pts)
Ex:
(9) Implement the "Change position of song" menu option in ExecuteMenu(). Prompt the user for
the current position of the song and the desired new position. Valid new positions are 1 - n (the
number of nodes). If the user enters a new position that is less than 1, move the node to the
position 1 (the head). If the user enters a new position greater than n, move the node to position n
(the tail). 6 cases will be tested:
Moving the head node (1 pt)
.
Similar to Many of us have large digital music collections that are not always .pdf (20)
H&M The Challenges of Global Expansion and the Move to adopt Intern.pdffazanmobiles
H&M: The Challenges of Global Expansion and the Move to adopt International Financial
Reporting standards Hennes & Mauritz AB (also known as H&M) , the Swedish MNE that is a
trendsetter in the latest fashion trends, has a stated goal “to give customers unbeatable value by
offering fashion and quality at the best price.” It doesn’t own any factories, but rather outsources
production to independent suppliers, primarily in Asia and Europe. H&M also rents space from
international and local landlords rather than owning its own stores. H&M is a major firm in the
apparel retail market where fashion trends are critical and where goods move quickly. In this
industry, the key buyers are consumers, and the key suppliers are clothing manufacturers and
wholesalers, and designers are king and a fast, well-organized supply chain is essential.
Depending on the individual firm strategy, the apparel retail market doesn’t have to be capital
intensive, but the largest players in the industry are very international, both in retail footprint and
suppliers. The biggest companies in the industry are U.S.-based The Gap, H&M, and Spain-
based Industria de Diseno Textil, S.A. (Inditex), better known by its flagship brand, Zara. All
three companies have different store brands: Gap, Banana Republic, Old Navy, and Athleta for
The Gap; H&M, COS (collection of style), Monki, Weekday, and Cheap Monday for H&M; and
Zara, Bershka, Pull and bear, Massimo Dutti, Stradivarius, Oysho, Zara Home and Uterque for
Inditex. Both of H&M’s competitors are very international. H&M operates about 2,800 stores in
49 markets, whereas The Gap operates 3,100 company stores and over 300 franchise stores
worldwide, and Inditex operates in a network of over 5,000 stores in 77 countries. Zara has the
largest geographic spread within Inditex with stores in 74 countries. Hennes & Mauritz AB
started as a single women’s wear store in Sweden in 1947. Today, H&M’s business is much
broader and currently includes the sales of clothing, accessories, footwear, cosmetics, and home
textiles. Although H&M is known as one of Sweden’s premier MNEs, it generates 21.5% of its
sales in Germany, 8.9% in the United States, and 7.4% in the United Kingdom, compared to only
5.8% of total sales in Sweden. H&M and Zara have very different strategies. Zara delivers new
products to its stores twice a week. Because of its highly organized supply chain, Zara only takes
10–15 days to go from design to the stores. Although it sources its apparel from around the
world, it has adopted just-in-time manufacturing from the auto industry and established 14 highly
automated Spanish factories where robots cut and dye fabrics creating the unfinished “gray
goods” which are the foundation for their final products. It then takes the gray goods and
outsources them to a network of small shops in Portugal and Spain to do the finish work. Store
managers are constantly sending updated information on consumer demand so that they can
move to the n.
C++ ProgrammingYou are to develop a program to read Baseball playe.pdffazanmobiles
C++ Programming
You are to develop a program to read Baseball player statistics from an input file. Each player
should bestored in a Player object. Therefore, you need to reuse the Player class from program 1.
Each playerwill have a first name, last name, a position (strings) and a batting average (floating
point number).
This program adds on to the requirements for Program #1. This will read int he same type of
player data from an input file and write the results to an output file.
New Requirements
You are to reuse your Player class from Program1. You are to implement a PlayerList data
structure/data type that stores players in a Linked List structure (internal to the class). Store the
players in the list in alphabetical order (By lastname, use firstname to further distinguish in the
event there is more than 1 player with the same last name).
You will need to add the class PlayerList and the class Node to facilitate the linked list
operations.
You must implement the following operations on your PlayerList along with any other utility
functionsyou might need. You may also need to add operations to the class Player to facilitate
comparisons sincePlayer data is private.
Operations
Default Constructor
Destructor
Add a Player to the List
Iterate through the List so that you can get each player
Clear out the list to make it empty
Test if a list isEmpty
Get the size of the list
Find a Player in the List (get) - Put a couple of hard-coded calls in your main program to make
sure this feature works.
Summary of Operation
Prompt the user for the input and output file names. DO NOT hardcode file names into your
program.
Open input file
Read each player and add them to your PlayerList Keep track of the number of players in the list
Store the players in the list in alphabetical order (lastname then firstname in the event of
twopeople with the same last name). You should be adding them in between other nodes
asappropriate
Test your find operation a couple of times. This can be hardcoded into your program. You donot
have to prompt the user for players, unless you wish to. Just make sure you test for playersthat
exist and that do not
Open an output file Write each player from the list into the output file, along with any other
output required by theassignment
Split your program code files into the appropriate .cpp and .h files for each of your
classes.(Exception - your NODE class can be defined in the same file as the PlayerList).
Detailed comments describing what is happening
Here is the input file:
Chipper Jones 3B 0.303
Rafael Furcal SS 0.281
Hank Aaron RF 0.305
Here is my player.h file
// Class Definition: Player
// Version 1
// This class defines an object to hold information about
// baseball player for use in a player database.
//--------------------------------------------------------
#include
using namespace std;
class Player {
string m_firstName; // player\'s first name
string m_lastName; // player\'s last name
string m_position; // player\'s primar.
Discuss the differences between a lists regular iterator, which su.pdffazanmobiles
Discuss the differences between a list\'s regular iterator, which supports the use of a \"for\" loop,
and its other list iterator that supports position-based operations. Discuss the advantages and
disadvantages of each.
Solution
Both iterator or list iterator is same for purpose ..i.e is to iterate through the list we have.
but the major difference between list iterator and iterator is quite simple
list iterator can iterate in both direction forward and backward direction ..it can move previous
and even next.
but in regular iterator..it can iterate only in one direction.that is only unidirection.it can move
only forward .
and one thing we should keep in mind that ..list iterator itarates only for list..but not for set map
etc.
where as regular iterator works beyond than that.it uses form list ,map.set etc.
listiterator comes up with other benifit is..it can modify the data inside list during iteration like
adding removing etc.
but in regualar iterator we cannot add element at a time of itearation..we can remove element ..
and another advantage of listiterator is..listiterator can get curent index position when traversing
but ..normal iterator cannot give that ..as it get the index positon by using prev and next but
normal iterator doesn not
iterator is not a class it is an interface and even listiterator is also an interface.
both are comes in java 1.2 and part of collection framework.
Feasibility is an important issue in security system formulation. Wh.pdffazanmobiles
Feasibility is an important issue in security system formulation. What are the two different
dimensions of feasibility that might affect the development of a real-world solution?
Solution
Feasibility in security system formulation is always going to help the security industry to grow in
a better manner possible. Because feasibility means convenience and whenever convenience is
there any organization or industry can work better on there technology level, management level
as well as their monetization model which is most important of them all to sustain. One
dimension of feasibility is convenience and another one is the ability to uncover the strengths
and weaknesses of a problem..
CopyPaste the sentence into the text box. Then, insert punctuat.pdffazanmobiles
Copy/Paste the sentence into the text box.
Then, insert punctuation or correct spelling where needed. All sentences contain one or more
errors.
1.) The three girls teacher arrived to school late.
2.) My associates clients do not seem satisfied with the service he provides.
Solution
1.
Correct Sentence:
The three girl teachers arrived at school, late.
2.
Correct answer:
My associate’s clients do not seem to be satisfied with the services, he provides..
C programming Create a system managing a mini library system. Eve.pdffazanmobiles
// C programming Create a system managing a mini library system. Every book corresponds to a
record (line) in a text file named \"mylibrary.txt\". Each record consists of 6 fields (Book ID,
Title, Author, Possession, checked out Date, Due Date) separated by comma: No comma \" \"in
title or author name. This mini library keeps the record for each book in the library. Different
books can share the book \"Title\". But the \"Book ID\" for each book is unique. One author may
have multiple books. Eg. Both book2 and book3 are written by author Possession field is
\"Library\" means this book is kept in library, such as book #001. Otherwise, this book is
checked out by the corresponding user. E.g. book #3 is checked out by User. A user is allowed to
check out up to 3 books. The \"Checked out Date\" field specifies the time of the latest checked
out date. The loan period for each book is 30 days. \"The Due Data\" filed specifies the time the
book should be returned. This system should provide a menu with following functionalities that
the bookkeeper can choose from at the top-level menu: Ask for title (read). Ask for author.
Generate a book ID by adding one to the current largest book ID. Add the record of the new
book into library with generated book ID, title, author, possession=\"library\", checked out
date=\"null\" and due date=\"null\". After that, print message \"book*** added successfully!\"
and go to step 5). Provide options \"t\" for \"\" and \"b\" for \"Back to main menu\". (If \"\", go to
step 1))
Solution
#include
#include
#include //contains delay(),getch()etc.
#include
#include //contains strcmp(),strcpy(),strlen(),etc
#include //contains toupper(), tolower(),etc
#include //contains _dos_getdate
#include
#define RETURNTIME 15
FILE *fp,*ft,*fs;
struct l_Date
{
int mm,dd,yy;
};
struct record
{
int bookid;
char title[20];
char Author[20];
char possession[20];
struct l_Date checkedout_date;
struct l_Date due_date;
};
struct record r;
void main()
{
clrscr();
int i;
printf(\" a. Add Books \");
printf(\"b. Delete books\");
printf(\"c. Search Books\");
printf(\"d. Issue Books\");
printf(\"e. View Book list\");
printf(\"f. Edit Book\'s Record\");
printf(\"g. Close Application\");
printf(\"Enter your choice:\");
switch(getch())
{
case \'a\':
addbooks();
break;
case \'b\':
deletebooks();
break;
case \'c\':
searchbooks();
break;
case \'d\':
issuebooks();
break;
case \'e\':
viewbooks();
break;
case \'f\':
editbooks();
break;
case \'g\':
{
clrscr();
printf(\"application is closing..\ \");
exit(0);
}
default:
{
printf(\"\ Please re-entered correct option\");
}
}
}
void addbooks(void) //funtion to add books
{
int i;
fp=fopen(\"Bibek.dat\",\"ab+\");
fseek(fp,0,SEEK_END);
fwrite(&r,sizeof(r),1,fp);
fclose(fp);
printf(\"The record is sucessfully saved\");
printf(\"add any more?(t / b):\");//t to try again and b to back
if(getch()==\'b\')
else
addbooks();
}
}
void deletebooks() //function delete record from file fp
{
int d;
char another=\'y\';
while(another=.
estion 47 (1 point) Raul Prebisch, based at the Economic Commission f.pdffazanmobiles
estion 47 (1 point) Raul Prebisch, based at the Economic Commission for Latin America and
Hans Singer, based t the United Nations Industrial Development Organization, both provided the
intellectual ationale for O 1) import substituting industrialization O 2) the rapid development of
the service sector industry. O 3) free trade. 4) liberation theology
Solution
Raul Prebisch and Hans Singer gave Prebisch-Singer hypothesis which formed the basis of
dependency theory and supported theories like import substitution.
The correct answer to this question is \"1\" import-substituting industrialization..
Dr. Muehls mother was a nurse and her father was a dairy farmer. S.pdffazanmobiles
Dr. Muehl\'s mother was a nurse and her father was a dairy farmer. She has gone to college and
has earned her PhD, which allowed her to become a professor at SUNY Canton. This is an
example of:
resiliency
ascribed status
social mobility
social stratificationA.
resiliencyB.
ascribed statusC.
social mobilityD.
social stratification
Solution
When a person moves from one societal status to another which the case mentioned in the
scenario of the question, it can be termed as social mobility
Therefore (C) social mobility is the answer.
CHAPTER 19 Reproductive system Disorders 24. List the STD and the org.pdffazanmobiles
CHAPTER 19 Reproductive system Disorders 24. List the STD and the organism that a.
Chancre causes a b. Vesicle C. Gumma d. Purulent exudate e. Pharyngitis f. Wart
Solution
A. chancre
The exposure of Treponema pallidum, the gram-negative spirochaete bacterium yielding
syphilis. Chancres transmit the sexually transmissible disease of syphilis through direct physical
contact. These ulcers usually form on or around the anus, mouth, penis, and vagina..
can Fluorescence Resonance Emission Transfer (FRET) Microscopy be us.pdffazanmobiles
can Fluorescence Resonance Emission Transfer (FRET) Microscopy be used to image static
structures??
Solution
The technique of fluorescence resonance energy transfer , when applied to optical microscopy,
permits determination of the approach between two molecules within several nanometers.FRET
is a powerful technique for studying molecular interactions inside living cells with improved
spatial (angstrom) and temporal (nanosecond) resolution. FRET microscopy relies on the ability
to capture fluorescent signals from the interactions of labeled molecules in single living or fixed
cells. Hence FRET Microscopy is used to image static structures..
An analyst has decided to capitalize the operating leases of Company.pdffazanmobiles
An analyst has decided to capitalize the operating leases of Company A. Using information in
the notes to the company’s 2015 financial statements, she has determined that the present value
of future minimum lease payments, at a discount rate of 10 percent, on December 31, 2015
equals €500 million. All lease contracts last another 5 years on December 31, 2015. As expected
at the beginning of the year, the company reports an operating lease expense in its income
statement for 2016 of €80 million. The company’s tax rate equals 30 percent. The company does
not engage in any new operating leases in 2016. The following information is also available from
Company A’s financial statements (all ratios use beginning-of-the-year balance sheet values)
Debt to capital (at beginning of 2016) = 0.55
Return on beginning equity in 2016 = 0.10
Assets / Capital (at beginning of 2016) = €3,400 million
The effect of capitalizing Company A’s operating leases on its return on beginning equity equals
A. An increase from 0.10 to 0.15 (rounded).
B. An increase from 0.10 to 0.13 (rounded).
C. A decrease from 0.10 to 0.07 (rounded).
D. A decrease from 0.10 to 0.05 (rounded).
Solution
accounting topic of leases is a popular Paper F7 exam area that could feature to varying degrees
in Questions 2, 3, 4 or 5 of the exam. This topic area is currently covered by IAS 17, Leases. IAS
17, Leases takes the concept of substance over form and applies it to the specific accounting area
of leases.
When applying this concept, it is often deemed necessary to account for the substance of a
transaction – ie its commercial reality, rather than its strict legal form. In other words, the legal
basis of a transaction can be used to hide the true nature of a transaction. It is argued that by
applying substance, the financial statements become more reliable and ensure that the lease is
faithfully represented.
WHY DO WE NEED TO APPLY SUBSTANCE TO A LEASE?
A lease agreement is a contract between two parties, the lessor and the lessee. The lessor is the
legal owner of the asset, the lessee obtains the right to use the asset in return for rental payments.
Historically, assets that were used but not owned were not shown on the statement of financial
position and therefore any associated liability was also left out of the statement – this was known
as ‘off balance sheet’ finance and was a way that companies were able to keep their liabilities
low, thus distorting gearing and other key financial ratios. This form of accounting did not
faithfully represent the transaction. In reality a company often effectively ‘owned’ these assets
and ‘owed a liability’.
Under modern day accounting the IASB framework states that an asset is ‘a resource controlled
by an entity as a result of past events and from which future economic benefits are expected to
flow to the entity’ and a liability is ‘a present obligation of the entity arising from past events, the
settlement of which is expected to result in an outflow fr.
Why is a visual analysis important in communicating findings in a bu.pdffazanmobiles
Why is a visual analysis important in communicating findings in a business research paper or
proposal? Give an example of a visual analysis that would be appropriate for your paper and
presentation (my research paper is regarding the decrease in ethics in nurses as well as having
usage of personal cell phones on the work floor). Describe acceptable report page design
methods to make your paper or presentation visually appealing.
Solution
The increase of development in IT has leaded to tremendous increase in the use of visual forms
of communication. From the early begins of usage of social anthropology, where novel
technologies of register and reproduction of images were gradually incorporated within social
anthropology in terms of ethnographic film and later visual anthropology, research with visual
technologies and on visual data has evolved into other fields in the social science.
Apart from social science, visual materials are found in a wide range of cultural spheres. They
are extensively used at various fields.
Videography, Photography plays very important roles in terms of gaining the full focus on
peculiarity of the visual and its specific symbolic structure.
The following terms will describe best about the Visual analysis usage at a greater extent. 1.
Involving, 2. Sharing and 3. Analyzing.
The three terms described above are exactly useful for the best communication of Business
Research Paper or Proposal.
Because, involving mostly related to successful participation in Trans disciplinary projects. The
photos can be analyzed as participatory acts. Sharing mostly involves in the combination of the
verbal data and visual data which leads to the easy understanding of presentation. Analysis
completely describes the different methods of analyses and show societal context.
Most of the design methods follow a simple procedure which gives a good pave to go ahead. One
of the design methods which is relevant to most of the design methods is described as follows.
Any methodology contains 1. Sample Design, 2. Data Collection Methods, 3. Data Processing
Procedures, 4. Response Rates, 5. Weighing and Variance Estimation.
All terminologies mentioned above are related to the easy understanding of the design in a
feature of successful survey and presents many issues that had to be addressed at the design
stage..
what usually happens to autoimmune antibody-producing clones dur.pdffazanmobiles
what usually happens to autoimmune antibody-producing clones during development?
what usually happens to autoimmune antibody-producing clones during development?
what usually happens to autoimmune antibody-producing clones during development?
Solution
The process of immune response against the antibodies is the same when the immune response
acts against the normal body cells. They bind with high affinity to self antigens..
Why platinum and its compounds display a variety of colorSoluti.pdffazanmobiles
Why platinum and its compounds display a variety of color?
Solution
Platinum and its compounds exhibit varieties of color because plantinum in its compounds have
d electrons in their respective orbitals which absorb wavelengths from Ultra violet and visible
light region of electromagnetic radiation and give off complimentary color and in this way
platinum generally appreas greyish white in color..
What is Vertical versus horizontal integration in healthcare W.pdffazanmobiles
What is Vertical versus horizontal integration in healthcare?
What is Vertical versus horizontal integration in healthcare?
Solution
in healthcare a vertical integration is the arrangement, a healthcare organization provide and
offer various services to the patients and needed people either directly or indirectlty, which
includes some support services or a broad range of patient care services. In this the care
providers think before and after the work or role he has done to the patients. The service
providers interacted and integrated with similar parties, exchange, share, and at the end benefit
all. Most of the care centers which offers variety of services join together, and exchange
information or patients also.
in horizontal integraion, one kind of services are offered by the care centers, all these joined as a
group for sharing the work. Here the care provider may look for other provider who do the same,
and join with them. It helps them to utilize their resoruces in optimum way and minimize
wastage. Forexample: these both can maintain a group of professional doctors, they can utilize
them in both places based on demand from patients..
What is the role of the financial system Name and describe two mark.pdffazanmobiles
What is the role of the financial system? Name and describe two markets that are part of the
financial system in the U.S. economy. Name and describe two financial intermediaries. What is
the difference between savings and investment (according to economists) and what role does the
financial system serve in bridging the gap between savings and investment? Explain why a
person would want to invest in stocks and bonds rather than keep their money in a savings
account.? ( 200 words)
Solution
Ans.
The financial system is concerned about credit, money and finance. It is a set of complex and
inter-mixed financial institutions ,financial markets, financial instruments and services.It is a
system that enables lenders and borrowers to exchange funds.It serves as a link between savers
and investors.Financial system promotes the process of capital formation and is a mechanism of
transfer of resources.Such as it channelise savings into business sector by offering loans.
Most important financial market is bonds market.In this market bond is like a contract paper with
maturity date and rate at which it is paid back to buyers.The money that companies get from
bonds can be further used for making profitable projects.When bond matures it is paid back to
purchaser with interest. The other market is of stocks market where stocks are issued by selling
shares to the public and trading is done with stockholders in stock exchange.It has higher returns
than bonds.
The two financial intermediaries are banks and mutual funds.Where banks are the financial
institutions that receives deposits and make loans.They pay interest on their deposits and charge
borrowers higher interst rate on their loans.Mutual funds are investment that uses money from
many investors to invest in bonds and stocks.
Savings are part of disposable income that is left after consumption of goods and
accumulated.Whereas investment means addition to stock of capital goods that adds to the future
productive capacity of the economy. Financial system is an important vehicle for economic
transformation.It bridges the gap between savings and investment through efficient mobilization
and allocation of surplus funds.It facilitates flow of funds from areas of surplus to deficit.
The money in savings account cannot be sold or traded to other investors such that they are not
negotiable, Whereas bonds are sold by investors to other investors before bonds reach there
maturity date.Money in savings account offers less return than bonds but bonds offer higher
returns which are considered as safe investment when borrowed from goverenment .so its better
to invest in stocks and bonds rather than keeping money in savings account..
What is the difference between a paired artery and an unpaired arter.pdffazanmobiles
What is the difference between a paired artery and an unpaired artery?
Solution
Paired Artery:
The abdominal aorta is the largest artery in the abdominal cavity. As part of the aorta, it is a
direct continuation of the descending aorta (of the thorax).
Anatomy Any of the muscular elastic tubes that form a branching system and that carry blood
away from the heart to the cells, tissues, and organs of the body. 2. A major route of
transportation into which local routes flow: Traffic was heavy on the central artery.
Unpaired Artery:
an unpaired artery that is formed by the union of the two vertebral arteries, runs forward within
the skull just under the pons, divides into the two posterior cerebral arteries, and supplies the
pons, cerebellum, posterior part of the cerebrum, and the inner ear..
What has Microsoft improved in Windows Server 2012 when it comes to .pdffazanmobiles
What has Microsoft improved in Windows Server 2012 when it comes to provisioning and
administrating a virtualized environment?
Solution
Windows Server 2012:
Windows server 2012 is the 6th version of windows server family. Microsoft introduced
windows server 2012 and BUILD 2011 of developer preview. Unlike windows 8, windows
server 2012 developer made provisions to MSDN subscribers. Microsoft improves, Windows
Update, Window Server Update Services, system center configuration manager and release an
update that extends the finishing date from 8th April 2012 to 15th January 2013.
Based on provisions: made to MSDN subscribers
Based on virtual environment: It is generally made for customers..
What are the steps for developing Developing a Project Scope Stateme.pdffazanmobiles
What are the steps for developing Developing a Project Scope Statement?
Solution
A scope statement has to be created in order to convince and get agreement from the client and
other stakeholders. With a scope statement you are more likely to decrease the changes of
miscommunication
The scope statement should be created by including the following points:.
True or False Questions1) Good technology transfer between pr.pdffazanmobiles
True or False Questions:
1) Good technology transfer between projects is one of the major advantages of projectized
organization. ( T or F)
2) Program Management is less comprehensive and inclusive than project management.( T or F)
3) The partnership type of organization is very difficult to organize as it has relatively large
restrictions. (T or F).
4) Forecasting estimates the results and planning provides strategies. (T or F)
Multiple choice questions:
1) The distribution that you use for networks in project considering probability of three times is
known as:
A) Normal distribution
B) Exponential distribution.
C. Binomial distribution
D) Negative exponential distribution
E. None of the above
2) The biggest Advantage/advantages of the exponential smoothing method of forecasting is:
A) No waiting period is required and not a large data is required even then reasonably good
forecasting.
B) It includes the benefits of the time series analysis of forecasting as it belongs to this category.
C) The value of alpha (smoothing constant )can be made to change or adapt to changed
circumstances.
D. All of the above
E. Only A and B.
3) The important disadvantage/disadvantages of MBO as observed are:
A. Time and paper work involved
B. Supervisor just assigns and does not negotiate
C. It leads to Gamesmanship of subordinates
D. It does not avoid the tendency of subordinates to focus on relatively few goals.
E. All of the above
4) The title \'section chief or foreman, is used for which of the following position?
A) team leader
B. middle manager
C. first-line manager
D. top manager
E. Aged worker
5) About the middle managers which of the following is true?
A. Make plan of intermediate range to achieve long terr goals
B. Integrate and coordinate the short range decisions and activities
C. Establish department policies together
D. Options A and B are true if taken together
E. options A, B, and C, are true if taken
True or False Questions:
1) Good technology transfer between projects is one of the major advantages of projectized
organization. ( T or F)
2) Program Management is less comprehensive and inclusive than project management.( T or F)
3) The partnership type of organization is very difficult to organize as it has relatively large
restrictions. (T or F).
4) Forecasting estimates the results and planning provides strategies. (T or F)
Multiple choice questions:
1) The distribution that you use for networks in project considering probability of three times is
known as:
A) Normal distribution
B) Exponential distribution.
C. Binomial distribution
D) Negative exponential distribution
E. None of the above
2) The biggest Advantage/advantages of the exponential smoothing method of forecasting is:
A) No waiting period is required and not a large data is required even then reasonably good
forecasting.
B) It includes the benefits of the time series analysis of forecasting as it belongs to this category.
C) The value of alpha (smoothing constant )can be made to chan.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Many of us have large digital music collections that are not always .pdf
1. Many of us have large digital music collections that are not always very well organized. It would
be nice to have a program that would manipulate our music collection based on attributes such as
artist, album title, song title, genre, song length, number times played, and rating. For this
assignment you will write a basic digital music manager (DMM).
Your DMM program must have a text-based interface which allows the user to select from a
mainmenu of options including: (1) load, (2) store, (3) display, (4) insert, (5) delete, (6) edit, (7)
sort, (8) rate, (9) play, (10) shuffle, and (11) exit. For Part I of the assignment, you will only need
to complete the main menu, (1) load, (2) store, (3) display, (6) edit, (8) rate, (9) play, and (11)
exit features. The other features will be completed in the next part of the assignment.
What must the main menu contain?
The main menu must display the following commands:
(1) load
(2) store
(3) display
(4) insert
(5) delete
(6) edit
(7) sort
(8) rate
(9) play
(10) shuffle
(11) exit
After a command is selected and completed, your program must display the main menu again.
This procedure will continue until the “exit” command is selected.
What must “load” do?
The “load” command must read all records from a file called musicPlayList.csv (you may find a
sample file here) into a dynamic doubly linked list. The doubly linked list is considered the main
playlist. As each record is read from the file, it must be inserted at the front of the list. Each
record consists of the following attributes:
Each attribute, in a single record, will be separated by a comma in the .csv (comma separated
values) file. This means that you will need to design an algorithm to extract the required
attributes for each record. Each field in each record will have a value. You do not need to check
for null or empty values.
You must define a struct called Record to represent the above attributes. Also, do not forget that
the Song Length must be represented by another struct called Duration. Duration is defined as
2. follows:
Finally, each struct Node in the doubly linked list must be defined as follows:
What must “store” do?
The “store” command writes the current records, in the dynamic doubly linked list, to the
musicPlayList.csv file. The store will completely overwrite the previous contents in the file.
What must “display” do?
The “display” command prints records to the screen. This command must support two methods,
one of which is selected by the user:
Print all records.
Print all records that match an artist.
What must “edit” do?
The “edit” command must allow the user to find a record in the list by artist. If there are multiple
records with the same artist, then your program must prompt the user which one to edit. The user
may modify all of the attributes in the record.
What must “rate” do?
The “rate” command must allow the user to assign a value of 1 – 5 to a song; 1 is the lowest
rating and 5 is the highest rating. The rating will replace the previous rating.
What must “play” do?
The “play” command must allow the user to select a song, and must start “playing” each song in
order from the current song. “Playing” the song for this assignment means displaying the
contents of the record that represents the song for a short period of time, clearing the screen and
showing the next record in the list, etc. This continues until all songs have been played.
What must “exit” do?
The “exit” command saves the most recent list to the musicPlayList.csv file. This command will
completely overwrite the previous contents in the file.
IV. Logical Block Diagram
The logical block diagram for your doubly linked list should look like the following:
As you can see from the illustration a doubly linked list has a pointer to the next node and the
previous node in the list. The first node’s previous node pointer is always NULL and the last
node’s next pointer is always NULL. When you insert and delete nodes from a doubly linked list,
you must always carefully link the previous and next pointers.
Solution
#include
#include
4. printf(" 9 - exit");
while (1)
{
printf(" Enter choice : ");
scanf("%d", &ch);
switch (ch)
{
case 1:
load();
break;
case 2:
store();
break;
case 3:
display();
break;
case 4:
insert();
sort();
break;
case 5:
delete();
break;
case 6:
sort();
break;
case 7:
edit();
break;
case 8:
rate();
break;
case 9:
exit(0);
break;
default:
5. printf(" Wrong choice menu");
}
}
}
/* TO create an empty node */
void create()
{
int data;
temp = (struct node *)malloc(sizeof(struct node));
temp->prev = NULL;
temp->next = NULL;
printf("Artist Name: ");
scanf("%s", temp->artist);
printf("Album title: ");
scanf("%s", temp->albumtitle);
printf("Song title: ");
scanf("%s", temp->songtitle);
printf("Generic name: ");
scanf("%s", temp->genre);
printf("Length of the song: ");
scanf("%d", temp->songlen);
printf("Number of times played: ");
scanf("%d", temp->num_ts_played);
printf("Rating: ");
scanf("%d", temp->rating);
count++;
}
/* TO insert at beginning */
void insert1()
{
if (h == NULL)
{
create();
h = temp;
temp1 = h;
}
6. else
{
create();
temp->next = h;
h->prev = temp;
h = temp;
}
}
/* To delete an element */
void delete()
{
int i = 1;
char song[strlength];
printf(" Enter title of the song : ");
scanf("%s", song);
temp2 = h;
if (strcmp(temp2->songtitle, song) == 0)
{
printf(" Error : Position out of range to delete");
return;
}
if (h == NULL)
{
printf(" Error : Empty list no elements to delete");
return;
}
else
{
while (temp2->songtitle, song)
== 0)
{
temp2 = temp2->next;
i++;
}
if (i == 1)
{
7. if (temp2->next == NULL)
{
printf("Node deleted from list");
free(temp2);
temp2 = h = NULL;
return;
}
}
if (temp2->next == NULL)
{
temp2->prev->next = NULL;
free(temp2);
printf("Node deleted from list");
return;
}
temp2->next->prev = temp2->prev;
if (i != 1)
temp2->prev->next = temp2->next; /* Might not need this statement if i
== 1 check */
if (i == 1)
h = temp2->next;
printf(" Node deleted");
free(temp2);
}
count--;
}
/* Traverse from beginning */
void display() {
temp2 = h;
if (temp2 == NULL)
{
printf("List empty to display ");
return;
}
printf(" Linked list elements from begining : ");
while (temp2->next != NULL)
8. {
printf(" %s ", temp2->artist);
printf(" %s ", temp2->albumtitle);
printf(" %s ", temp2->songtitle);
printf(" %s ", temp2->genre);
printf(" %d ", temp2->songlen);
printf(" %d ", temp2->num_ts_played);
printf(" %d ", temp2->rating);
temp2 = temp2->next;
}
printf(" %s ", temp2->songtitle);
}
/* To search for an element in the list */
void search() {
int count = 0;
char artist[strlength];
temp2 = h;
if (temp2 == NULL)
{
printf(" Error : List empty to search for data");
return;
}
printf(" Enter value to search : ");
scanf("%s", artist);
while (temp2 != NULL)
{
if (strcmp(temp2->artist, artist) == 0)
{
printf(" Data found in %d position", count + 1);
return;
}
else
temp2 = temp2->next;
count++;
}
printf(" Error : %d not found in list", data);
9. }
/* To update a node value in the list */
void edit()
{
char album[strlength];
char album1[strlength];
printf(" Enter album title to be updated : ");
scanf("%d", &album);
printf(" Enter new data : ");
scanf("%d", &album1);
temp2 = h;
if (temp2 == NULL)
{
printf(" Error : List empty no node to update");
return;
}
while (temp2 != NULL)
{
if (strcmp(temp2->albumtitle, album) == 0)
{
temp2->albumtitle = album;
display();
return;
}
else
temp2 = temp2->next;
}
printf(" Error : %d not found in list to update", data);
}
/* To sort the linked list */
void sort()
{
int i, j, x;
temp2 = h;
temp4 = h;
temp3 = h;