SlideShare a Scribd company logo
1 of 16
Download to read offline
I am having the below compile errors.
*****************************************************************************
******
1>------ Build started: Project: playlist, Configuration: Debug Win32 ------
1> Playlist.cpp
1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.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 rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.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 rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.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 rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(76): error
C2065: 'it': undeclared identifier
1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(78): error
C2065: 'it': undeclared identifier
1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(78): error
C2227: left of '->GetID' must point to class/struct/union/generic type
1> c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(78): note:
type is 'unknown-type'
1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(80): error
C2065: 'it': undeclared identifier
1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(80): error
C2227: left of '->GetSongName' must point to class/struct/union/generic type
1> c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(80): note:
type is 'unknown-type'
1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(81): error
C2065: 'it': undeclared identifier
1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.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 rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.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 rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.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 uqid = "";
string songnam = "";
string artname;
int len;
PlaylistNode PlaylistNode;
do
{
cout << "MENU" << endl;
cout << "a - Add song: " << endl;
cout << "d - Remove song: " << endl;
cout << "c - Change position of song " << endl;
cout << "s - Output songs by specific artist: " << endl;
cout << "t - Output total time of playlist (in seconds): " << endl;
cout << "o - Output full playlist " << endl;
cout << "q - QUIT PROGRAM " << endl;
cout << "Please enter your selection." << endl;
cin >> choice;
switch (choice)
{
case 'a':
{
cout << "ADD SONG" << endl;
cout << "Enter song's unique ID:" << endl;
cin >> uqid;
cout << "Enter song's name:" << endl;
cin >> songnam;
cout << "Enter artist's name:" << endl;
cin >> artname;
cout << "Enter Song len" << endl;
cin >> len;
Playlist playlistobj(uqid, songnam, artname, len);
PlaylistNode.Addsong(playlistobj);
break; //Add record
}
case 'd':
{
cout << "REMOVE SONG" << endl;
cout << "Enter song's unique ID:" << endl;
cin >> uqid;
PlaylistNode.Removesong(uqid);
}
break; //Display record
case 'c':
{
int Creentpos = 0;
int newpos = 0;
cout << "Enter song's current position:" << endl;
cin >> Creentpos;
cout << "Enter new position for song:" << endl;
cin >> newpos;
PlaylistNode.Changeposition(Creentpos, newpos);
}
case 's':
cout << "Enter artist's name:" << endl;
cin >> artname;
PlaylistNode.PrintSongByartist(artname);
break; //EDit record
case 't':
PlaylistNode.PrintSongtotalLen();
break; //EDit record
case 'o':
PlaylistNode.PrintFullPlayList();
break; //EDit record
case 'q':
cout << "QUIT PROGTRAM--" << endl;
break;
default: cout << "Invalid Selection" << endl;
}
} while
(choice == 'q');
system("PAUSE");
return 0;
}
Playlist.cpp
#include "Playlist.h"
Playlist::Playlist(string auniqueId, string asongName, string aArtistName, int aSongLength)
{
uniqueID = auniqueId;
songName = asongName;
artistName = aArtistName;
songLength = aSongLength;
}
string Playlist::GetArtistName()
{
return artistName;
}
string Playlist::GetID()
{
return uniqueID;
}
string Playlist::GetSongName()
{
return songName;
}
int Playlist::GetSongLength()
{
return songLength;
}
void Playlist::SetNext()
{
}
string Playlist::GetNext()
{
return "";
}
void Playlist::InsertAfter() {
}
void Playlist::PrintPlaylistNode()
{
cout << "Unique ID:" << uniqueID << endl;
cout << "Song Name:" << songName << endl;
cout << "Artist Name:" << artistName << endl;
cout << "Song Length (in seconds):" << songLength << endl;
}
////
void PlaylistNode::Addsong(Playlist aPlaylist)
{
library.push_back(aPlaylist);
}
void PlaylistNode::Removesong(string aUnwiid)
{
if (library.size > 0)
{
for (it = library.begin(); it != library.end(); ++it)
{
if (it->GetID() == aUnwiid)
{
cout << it->GetSongName() << endl;
library.remove(*it);
break;
}
}
}
}
Playlist PlaylistNode::get(list _list, int _i) {
list::iterator it = _list.begin();
for (int i = 0; i<_i; i++) {
++it;
}
return *it;
}
std::list::iterator it;
void PlaylistNode::PrintFullPlayList()
{
for (it = library.begin(); it != library.end(); ++it)
{
PrintPlaylist(*it);
}
}
void PlaylistNode::PrintSongByartist(string aartiename)
{
for (it = library.begin(); it != library.end(); ++it)
{
if (it->GetArtistName() == aartiename)
PrintPlaylist(*it);
}
}
void PlaylistNode::PrintSongtotalLen()
{
int TotalSonglengst = 0;
for (it = library.begin(); it != library.end(); ++it)
{
TotalSonglengst += it->GetSongLength();
}
cout << "Total songs Length (in seconds):" << TotalSonglengst << endl;
}
void PlaylistNode::PrintPlaylist(Playlist aPlayList)
{
cout << "Unique ID:" << aPlayList.GetID() << endl;
cout << "Song Name:" << aPlayList.GetSongName() << endl;
cout << "Artist Name:" << aPlayList.GetArtistName() << endl;
cout << "Song Length (in seconds):" << aPlayList.GetSongLength() << endl;
}
void PlaylistNode::Changeposition(int oldPostion, int newPostinon)
{
if (!library.empty())
{
if (newPostinon <= library.size)
{
Playlist oldPlalist = get(library, oldPostion);
Playlist New_Playlist = get(library, newPostinon);
Playlist pldpay(oldPlalist.GetID(), oldPlalist.GetSongName(), oldPlalist.GetArtistName(),
oldPlalist.GetSongLength());
/*library.insert(pldpay,newPostinon);
library.insert(New_Playlist, oldPostion);*/
}
else
{
cout << "The Postion is Not in the Range of LIB" << endl;
}
}
}
Playlist.h
#pragma once
#include
#include
#include
#include
#include
using namespace std;
class Playlist
{
private:
string uniqueID;
string songName;
string artistName;
int songLength;
public:
Playlist() { uniqueID = "", songName = "", artistName = "", songLength = 0; };
Playlist(string auniqueId, string asongName, string aArtistName, int aSongLength);
void InsertAfter();
void SetNext();
string GetID();
string GetSongName();
string GetArtistName();
int GetSongLength();
string GetNext();
void PrintPlaylistNode();
};
//#pragma once
//#include "Playlist.h"
//#include
class PlaylistNode
{
private:
std::list library;
Playlist get(list _list, int _i);
void PrintPlaylist(Playlist aPlayList);
public:
void Addsong(Playlist aPlayslist);
void Removesong(string aUnwiid);
void Changeposition(int oldPostion, int anewPostion);
void PrintSongByartist(string aAstist);
void PrintSongtotalLen();
void PrintFullPlayList();
};
Solution
Here is the modified code for you:
Main.cpp
#include
#include "Playlist.cpp"
using namespace std;
int main()
{
int choice;
string uqid = "";
string songnam = "";
string artname;
int len;
PlaylistNode PlaylistNode;
do
{
cout << "MENU" << endl;
cout << "a - Add song: " << endl;
cout << "d - Remove song: " << endl;
cout << "c - Change position of song " << endl;
cout << "s - Output songs by specific artist: " << endl;
cout << "t - Output total time of playlist (in seconds): " << endl;
cout << "o - Output full playlist " << endl;
cout << "q - QUIT PROGRAM " << endl;
cout << "Please enter your selection." << endl;
cin >> choice;
switch (choice)
{
case 'a':
{
cout << "ADD SONG" << endl;
cout << "Enter song's unique ID:" << endl;
cin >> uqid;
cout << "Enter song's name:" << endl;
cin >> songnam;
cout << "Enter artist's name:" << endl;
cin >> artname;
cout << "Enter Song len" << endl;
cin >> len;
Playlist playlistobj(uqid, songnam, artname, len);
PlaylistNode.Addsong(playlistobj);
break; //Add record
}
case 'd':
{
cout << "REMOVE SONG" << endl;
cout << "Enter song's unique ID:" << endl;
cin >> uqid;
PlaylistNode.Removesong(uqid);
}
break; //Display record
case 'c':
{
int Creentpos = 0;
int newpos = 0;
cout << "Enter song's current position:" << endl;
cin >> Creentpos;
cout << "Enter new position for song:" << endl;
cin >> newpos;
PlaylistNode.Changeposition(Creentpos, newpos);
}
case 's':
cout << "Enter artist's name:" << endl;
cin >> artname;
PlaylistNode.PrintSongByartist(artname);
break; //EDit record
case 't':
PlaylistNode.PrintSongtotalLen();
break; //EDit record
case 'o':
PlaylistNode.PrintFullPlayList();
break; //EDit record
case 'q':
cout << "QUIT PROGTRAM--" << endl;
break;
default: cout << "Invalid Selection" << endl;
}
} while
(choice == 'q');
system("PAUSE");
return 0;
}
Playlist.cpp:
#include "Playlist.h"
Playlist::Playlist(string auniqueId, string asongName, string aArtistName, int aSongLength)
{
uniqueID = auniqueId;
songName = asongName;
artistName = aArtistName;
songLength = aSongLength;
}
string Playlist::GetArtistName()
{
return artistName;
}
string Playlist::GetID()
{
return uniqueID;
}
string Playlist::GetSongName()
{
return songName;
}
int Playlist::GetSongLength()
{
return songLength;
}
void Playlist::SetNext()
{
}
string Playlist::GetNext()
{
return "";
}
void Playlist::InsertAfter() {
}
void Playlist::PrintPlaylistNode()
{
cout << "Unique ID:" << uniqueID << endl;
cout << "Song Name:" << songName << endl;
cout << "Artist Name:" << artistName << endl;
cout << "Song Length (in seconds):" << songLength << endl;
}
////
void PlaylistNode::Addsong(Playlist aPlaylist)
{
library.push_back(aPlaylist);
}
void PlaylistNode::Removesong(string aUnwiid)
{
if (library.size() > 0)
{
for (list::iterator it = library.begin(); it != library.end(); ++it)
{
if (it->GetID() == aUnwiid)
{
cout << it->GetSongName() << endl;
library.remove(*it);
break;
}
}
}
}
Playlist PlaylistNode::get(list _list, int _i) {
list::iterator it = _list.begin();
for (int i = 0; i<_i; i++) {
++it;
}
return *it;
}
std::list::iterator it;
void PlaylistNode::PrintFullPlayList()
{
for (it = library.begin(); it != library.end(); ++it)
{
PrintPlaylist(*it);
}
}
void PlaylistNode::PrintSongByartist(string aartiename)
{
for (it = library.begin(); it != library.end(); ++it)
{
if (it->GetArtistName() == aartiename)
PrintPlaylist(*it);
}
}
void PlaylistNode::PrintSongtotalLen()
{
int TotalSonglengst = 0;
for (it = library.begin(); it != library.end(); ++it)
{
TotalSonglengst += it->GetSongLength();
}
cout << "Total songs Length (in seconds):" << TotalSonglengst << endl;
}
void PlaylistNode::PrintPlaylist(Playlist aPlayList)
{
cout << "Unique ID:" << aPlayList.GetID() << endl;
cout << "Song Name:" << aPlayList.GetSongName() << endl;
cout << "Artist Name:" << aPlayList.GetArtistName() << endl;
cout << "Song Length (in seconds):" << aPlayList.GetSongLength() << endl;
}
void PlaylistNode::Changeposition(int oldPostion, int newPostinon)
{
if (!library.empty())
{
if (newPostinon <= library.size())
{
Playlist oldPlalist = get(library, oldPostion);
Playlist New_Playlist = get(library, newPostinon);
Playlist pldpay(oldPlalist.GetID(), oldPlalist.GetSongName(), oldPlalist.GetArtistName(),
oldPlalist.GetSongLength());
/*library.insert(pldpay,newPostinon);
library.insert(New_Playlist, oldPostion);*/
}
else
{
cout << "The Postion is Not in the Range of LIB" << endl;
}
}
}
Playlist.h:
#pragma once
#include
#include
#include
#include
#include
using namespace std;
class Playlist
{
private:
string uniqueID;
string songName;
string artistName;
int songLength;
public:
Playlist() { uniqueID = "", songName = "", artistName = "", songLength = 0; };
Playlist(string auniqueId, string asongName, string aArtistName, int aSongLength);
void InsertAfter();
void SetNext();
string GetID();
string GetSongName();
string GetArtistName();
int GetSongLength();
string GetNext();
void PrintPlaylistNode();
};
//#pragma once
//#include "Playlist.h"
//#include
class PlaylistNode
{
private:
std::list library;
Playlist get(list _list, int _i);
void PrintPlaylist(Playlist aPlayList);
public:
void Addsong(Playlist aPlayslist);
void Removesong(string aUnwiid);
void Changeposition(int oldPostion, int anewPostion);
void PrintSongByartist(string aAstist);
void PrintSongtotalLen();
void PrintFullPlayList();
};

More Related Content

Similar to I am having the below compile errors. .pdf

PLEASE I need help with my assignment I have to compelet .pdf
PLEASE I need help with my assignment I have to compelet  .pdfPLEASE I need help with my assignment I have to compelet  .pdf
PLEASE I need help with my assignment I have to compelet .pdf
ankit11134
 
Hi,Please fidn the Answer.Sorting,h is Header .pdf
Hi,Please fidn the Answer.Sorting,h is Header .pdfHi,Please fidn the Answer.Sorting,h is Header .pdf
Hi,Please fidn the Answer.Sorting,h is Header .pdf
anandf0099
 
C ++The current program with the following code is handling the co.pdf
C ++The current program with the following code is handling the co.pdfC ++The current program with the following code is handling the co.pdf
C ++The current program with the following code is handling the co.pdf
info189835
 
Help I keep getting the same error when running a code. Below is the.pdf
Help I keep getting the same error when running a code. Below is the.pdfHelp I keep getting the same error when running a code. Below is the.pdf
Help I keep getting the same error when running a code. Below is the.pdf
mail931892
 
In this project, we combine the concepts of Recursion and Sorting. S.pdf
In this project, we combine the concepts of Recursion and Sorting. S.pdfIn this project, we combine the concepts of Recursion and Sorting. S.pdf
In this project, we combine the concepts of Recursion and Sorting. S.pdf
mallik3000
 

Similar to I am having the below compile errors. .pdf (17)

Complete the C++ program and implement the routines that are n.docx
    Complete the C++ program and implement the routines that are n.docx    Complete the C++ program and implement the routines that are n.docx
Complete the C++ program and implement the routines that are n.docx
 
Complete the C++ program and implement the routines that are n.docx
    Complete the C++ program and implement the routines that are n.docx    Complete the C++ program and implement the routines that are n.docx
Complete the C++ program and implement the routines that are n.docx
 
Complete the C++ program and implement the routines that are n.docx
    Complete the C++ program and implement the routines that are n.docx    Complete the C++ program and implement the routines that are n.docx
Complete the C++ program and implement the routines that are n.docx
 
Complete the C++ program and implement the routines that are n.docx
    Complete the C++ program and implement the routines that are n.docx    Complete the C++ program and implement the routines that are n.docx
Complete the C++ program and implement the routines that are n.docx
 
Complete the C++ program and implement the routines that are n.docx
    Complete the C++ program and implement the routines that are n.docx    Complete the C++ program and implement the routines that are n.docx
Complete the C++ program and implement the routines that are n.docx
 
Complete the C++ program and implement the routines that are n.docx
    Complete the C++ program and implement the routines that are n.docx    Complete the C++ program and implement the routines that are n.docx
Complete the C++ program and implement the routines that are n.docx
 
PLEASE I need help with my assignment I have to compelet .pdf
PLEASE I need help with my assignment I have to compelet  .pdfPLEASE I need help with my assignment I have to compelet  .pdf
PLEASE I need help with my assignment I have to compelet .pdf
 
bank management system
bank management systembank management system
bank management system
 
Kernel Recipes 2016 - Why you need a test strategy for your kernel development
Kernel Recipes 2016 - Why you need a test strategy for your kernel developmentKernel Recipes 2016 - Why you need a test strategy for your kernel development
Kernel Recipes 2016 - Why you need a test strategy for your kernel development
 
Hi,Please fidn the Answer.Sorting,h is Header .pdf
Hi,Please fidn the Answer.Sorting,h is Header .pdfHi,Please fidn the Answer.Sorting,h is Header .pdf
Hi,Please fidn the Answer.Sorting,h is Header .pdf
 
C ++The current program with the following code is handling the co.pdf
C ++The current program with the following code is handling the co.pdfC ++The current program with the following code is handling the co.pdf
C ++The current program with the following code is handling the co.pdf
 
Linea de comandos bioface zem800
Linea de comandos bioface zem800Linea de comandos bioface zem800
Linea de comandos bioface zem800
 
Utilizing kotlin flows in an android application
Utilizing kotlin flows in an android applicationUtilizing kotlin flows in an android application
Utilizing kotlin flows in an android application
 
Help I keep getting the same error when running a code. Below is the.pdf
Help I keep getting the same error when running a code. Below is the.pdfHelp I keep getting the same error when running a code. Below is the.pdf
Help I keep getting the same error when running a code. Below is the.pdf
 
ES6 - Level up your JavaScript Skills
ES6 - Level up your JavaScript SkillsES6 - Level up your JavaScript Skills
ES6 - Level up your JavaScript Skills
 
Python 1
Python 1Python 1
Python 1
 
In this project, we combine the concepts of Recursion and Sorting. S.pdf
In this project, we combine the concepts of Recursion and Sorting. S.pdfIn this project, we combine the concepts of Recursion and Sorting. S.pdf
In this project, we combine the concepts of Recursion and Sorting. S.pdf
 

More from dbrienmhompsonkath75

Help me with these questions please.1. Name four characteristics t.pdf
Help me with these questions please.1. Name four characteristics t.pdfHelp me with these questions please.1. Name four characteristics t.pdf
Help me with these questions please.1. Name four characteristics t.pdf
dbrienmhompsonkath75
 
Describe current and emerging roles of the patient record in HIT toda.pdf
Describe current and emerging roles of the patient record in HIT toda.pdfDescribe current and emerging roles of the patient record in HIT toda.pdf
Describe current and emerging roles of the patient record in HIT toda.pdf
dbrienmhompsonkath75
 
Dont change the templates, and just fill out the TODO parts on .pdf
Dont change the templates, and just fill out the  TODO parts on .pdfDont change the templates, and just fill out the  TODO parts on .pdf
Dont change the templates, and just fill out the TODO parts on .pdf
dbrienmhompsonkath75
 

More from dbrienmhompsonkath75 (20)

Give examples of system which can achieve some security requirement.pdf
Give examples of system which can achieve some security requirement.pdfGive examples of system which can achieve some security requirement.pdf
Give examples of system which can achieve some security requirement.pdf
 
Help me with these questions please.1. Name four characteristics t.pdf
Help me with these questions please.1. Name four characteristics t.pdfHelp me with these questions please.1. Name four characteristics t.pdf
Help me with these questions please.1. Name four characteristics t.pdf
 
Describe current and emerging roles of the patient record in HIT toda.pdf
Describe current and emerging roles of the patient record in HIT toda.pdfDescribe current and emerging roles of the patient record in HIT toda.pdf
Describe current and emerging roles of the patient record in HIT toda.pdf
 
Dont change the templates, and just fill out the TODO parts on .pdf
Dont change the templates, and just fill out the  TODO parts on .pdfDont change the templates, and just fill out the  TODO parts on .pdf
Dont change the templates, and just fill out the TODO parts on .pdf
 
Directions Problem 1. A female with Muppetrus bristle mates with a .pdf
Directions Problem 1. A female with Muppetrus bristle mates with a .pdfDirections Problem 1. A female with Muppetrus bristle mates with a .pdf
Directions Problem 1. A female with Muppetrus bristle mates with a .pdf
 
Describe the roll of each of the following in membrane transport a.pdf
Describe the roll of each of the following in membrane transport a.pdfDescribe the roll of each of the following in membrane transport a.pdf
Describe the roll of each of the following in membrane transport a.pdf
 
Compare and contrast transactional and transformational leadership.pdf
Compare and contrast transactional and transformational leadership.pdfCompare and contrast transactional and transformational leadership.pdf
Compare and contrast transactional and transformational leadership.pdf
 
Calculator Which of the following is not an asset Oa, owners equi.pdf
Calculator Which of the following is not an asset Oa, owners equi.pdfCalculator Which of the following is not an asset Oa, owners equi.pdf
Calculator Which of the following is not an asset Oa, owners equi.pdf
 
You are installing a KVM switch for a small business customer so tha.pdf
You are installing a KVM switch for a small business customer so tha.pdfYou are installing a KVM switch for a small business customer so tha.pdf
You are installing a KVM switch for a small business customer so tha.pdf
 
Why is metabolism important for physiological processesSolution.pdf
Why is metabolism important for physiological processesSolution.pdfWhy is metabolism important for physiological processesSolution.pdf
Why is metabolism important for physiological processesSolution.pdf
 
Which macromolecule is primarily responsible for producing the pheno.pdf
Which macromolecule is primarily responsible for producing the pheno.pdfWhich macromolecule is primarily responsible for producing the pheno.pdf
Which macromolecule is primarily responsible for producing the pheno.pdf
 
which invertebrate phylum is considered the most evolutionarily succe.pdf
which invertebrate phylum is considered the most evolutionarily succe.pdfwhich invertebrate phylum is considered the most evolutionarily succe.pdf
which invertebrate phylum is considered the most evolutionarily succe.pdf
 
What suggestions would you offer to parents and teachers who want to.pdf
What suggestions would you offer to parents and teachers who want to.pdfWhat suggestions would you offer to parents and teachers who want to.pdf
What suggestions would you offer to parents and teachers who want to.pdf
 
What is the F2 generation when the F1 generation of +++y cv f is cr.pdf
What is the F2 generation when the F1 generation of +++y cv f is cr.pdfWhat is the F2 generation when the F1 generation of +++y cv f is cr.pdf
What is the F2 generation when the F1 generation of +++y cv f is cr.pdf
 
What features on the plasmid allows it to replicate independent o.pdf
What features on the plasmid allows it to replicate independent o.pdfWhat features on the plasmid allows it to replicate independent o.pdf
What features on the plasmid allows it to replicate independent o.pdf
 
What are the use of Fibonacci numbers or the Golden Ratio in nature,.pdf
What are the use of Fibonacci numbers or the Golden Ratio in nature,.pdfWhat are the use of Fibonacci numbers or the Golden Ratio in nature,.pdf
What are the use of Fibonacci numbers or the Golden Ratio in nature,.pdf
 
Based on the following schematic with 3 D flip-flops, Write complete .pdf
Based on the following schematic with 3 D flip-flops, Write complete .pdfBased on the following schematic with 3 D flip-flops, Write complete .pdf
Based on the following schematic with 3 D flip-flops, Write complete .pdf
 
Although O_2 does not participate directly in the reactions of the TC.pdf
Although O_2 does not participate directly in the reactions of the TC.pdfAlthough O_2 does not participate directly in the reactions of the TC.pdf
Although O_2 does not participate directly in the reactions of the TC.pdf
 
8. Which of the following is NOT a transcriptionally repressed genom.pdf
8. Which of the following is NOT a transcriptionally repressed genom.pdf8. Which of the following is NOT a transcriptionally repressed genom.pdf
8. Which of the following is NOT a transcriptionally repressed genom.pdf
 
49. Autonomic nervous system function is influenced by A) cerebral co.pdf
49. Autonomic nervous system function is influenced by A) cerebral co.pdf49. Autonomic nervous system function is influenced by A) cerebral co.pdf
49. Autonomic nervous system function is influenced by A) cerebral co.pdf
 

Recently uploaded

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Recently uploaded (20)

Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 

I am having the below compile errors. .pdf

  • 1. I am having the below compile errors. ***************************************************************************** ****** 1>------ Build started: Project: playlist, Configuration: Debug Win32 ------ 1> Playlist.cpp 1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.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 rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.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 rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.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 rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(76): error C2065: 'it': undeclared identifier 1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(78): error C2065: 'it': undeclared identifier 1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(78): error C2227: left of '->GetID' must point to class/struct/union/generic type 1> c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(78): note: type is 'unknown-type' 1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(80): error C2065: 'it': undeclared identifier
  • 2. 1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(80): error C2227: left of '->GetSongName' must point to class/struct/union/generic type 1> c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(80): note: type is 'unknown-type' 1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(81): error C2065: 'it': undeclared identifier 1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.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 rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.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 rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.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 uqid = ""; string songnam = ""; string artname; int len; PlaylistNode PlaylistNode;
  • 3. do { cout << "MENU" << endl; cout << "a - Add song: " << endl; cout << "d - Remove song: " << endl; cout << "c - Change position of song " << endl; cout << "s - Output songs by specific artist: " << endl; cout << "t - Output total time of playlist (in seconds): " << endl; cout << "o - Output full playlist " << endl; cout << "q - QUIT PROGRAM " << endl; cout << "Please enter your selection." << endl; cin >> choice; switch (choice) { case 'a': { cout << "ADD SONG" << endl; cout << "Enter song's unique ID:" << endl; cin >> uqid; cout << "Enter song's name:" << endl; cin >> songnam; cout << "Enter artist's name:" << endl; cin >> artname; cout << "Enter Song len" << endl; cin >> len; Playlist playlistobj(uqid, songnam, artname, len); PlaylistNode.Addsong(playlistobj); break; //Add record } case 'd': { cout << "REMOVE SONG" << endl; cout << "Enter song's unique ID:" << endl; cin >> uqid; PlaylistNode.Removesong(uqid);
  • 4. } break; //Display record case 'c': { int Creentpos = 0; int newpos = 0; cout << "Enter song's current position:" << endl; cin >> Creentpos; cout << "Enter new position for song:" << endl; cin >> newpos; PlaylistNode.Changeposition(Creentpos, newpos); } case 's': cout << "Enter artist's name:" << endl; cin >> artname; PlaylistNode.PrintSongByartist(artname); break; //EDit record case 't': PlaylistNode.PrintSongtotalLen(); break; //EDit record case 'o': PlaylistNode.PrintFullPlayList(); break; //EDit record case 'q': cout << "QUIT PROGTRAM--" << endl; break; default: cout << "Invalid Selection" << endl; } } while (choice == 'q'); system("PAUSE"); return 0; } Playlist.cpp #include "Playlist.h"
  • 5. Playlist::Playlist(string auniqueId, string asongName, string aArtistName, int aSongLength) { uniqueID = auniqueId; songName = asongName; artistName = aArtistName; songLength = aSongLength; } string Playlist::GetArtistName() { return artistName; } string Playlist::GetID() { return uniqueID; } string Playlist::GetSongName() { return songName; } int Playlist::GetSongLength() { return songLength; } void Playlist::SetNext() { } string Playlist::GetNext() { return ""; } void Playlist::InsertAfter() { }
  • 6. void Playlist::PrintPlaylistNode() { cout << "Unique ID:" << uniqueID << endl; cout << "Song Name:" << songName << endl; cout << "Artist Name:" << artistName << endl; cout << "Song Length (in seconds):" << songLength << endl; } //// void PlaylistNode::Addsong(Playlist aPlaylist) { library.push_back(aPlaylist); } void PlaylistNode::Removesong(string aUnwiid) { if (library.size > 0) { for (it = library.begin(); it != library.end(); ++it) { if (it->GetID() == aUnwiid) { cout << it->GetSongName() << endl; library.remove(*it); break; } } } } Playlist PlaylistNode::get(list _list, int _i) { list::iterator it = _list.begin(); for (int i = 0; i<_i; i++) { ++it; } return *it; } std::list::iterator it; void PlaylistNode::PrintFullPlayList()
  • 7. { for (it = library.begin(); it != library.end(); ++it) { PrintPlaylist(*it); } } void PlaylistNode::PrintSongByartist(string aartiename) { for (it = library.begin(); it != library.end(); ++it) { if (it->GetArtistName() == aartiename) PrintPlaylist(*it); } } void PlaylistNode::PrintSongtotalLen() { int TotalSonglengst = 0; for (it = library.begin(); it != library.end(); ++it) { TotalSonglengst += it->GetSongLength(); } cout << "Total songs Length (in seconds):" << TotalSonglengst << endl; } void PlaylistNode::PrintPlaylist(Playlist aPlayList) { cout << "Unique ID:" << aPlayList.GetID() << endl; cout << "Song Name:" << aPlayList.GetSongName() << endl; cout << "Artist Name:" << aPlayList.GetArtistName() << endl; cout << "Song Length (in seconds):" << aPlayList.GetSongLength() << endl; } void PlaylistNode::Changeposition(int oldPostion, int newPostinon) { if (!library.empty()) { if (newPostinon <= library.size)
  • 8. { Playlist oldPlalist = get(library, oldPostion); Playlist New_Playlist = get(library, newPostinon); Playlist pldpay(oldPlalist.GetID(), oldPlalist.GetSongName(), oldPlalist.GetArtistName(), oldPlalist.GetSongLength()); /*library.insert(pldpay,newPostinon); library.insert(New_Playlist, oldPostion);*/ } else { cout << "The Postion is Not in the Range of LIB" << endl; } } } Playlist.h #pragma once #include #include #include #include #include using namespace std; class Playlist { private: string uniqueID; string songName; string artistName; int songLength; public: Playlist() { uniqueID = "", songName = "", artistName = "", songLength = 0; }; Playlist(string auniqueId, string asongName, string aArtistName, int aSongLength); void InsertAfter(); void SetNext();
  • 9. string GetID(); string GetSongName(); string GetArtistName(); int GetSongLength(); string GetNext(); void PrintPlaylistNode(); }; //#pragma once //#include "Playlist.h" //#include class PlaylistNode { private: std::list library; Playlist get(list _list, int _i); void PrintPlaylist(Playlist aPlayList); public: void Addsong(Playlist aPlayslist); void Removesong(string aUnwiid); void Changeposition(int oldPostion, int anewPostion); void PrintSongByartist(string aAstist); void PrintSongtotalLen(); void PrintFullPlayList(); }; Solution Here is the modified code for you: Main.cpp #include #include "Playlist.cpp" using namespace std; int main() { int choice; string uqid = "";
  • 10. string songnam = ""; string artname; int len; PlaylistNode PlaylistNode; do { cout << "MENU" << endl; cout << "a - Add song: " << endl; cout << "d - Remove song: " << endl; cout << "c - Change position of song " << endl; cout << "s - Output songs by specific artist: " << endl; cout << "t - Output total time of playlist (in seconds): " << endl; cout << "o - Output full playlist " << endl; cout << "q - QUIT PROGRAM " << endl; cout << "Please enter your selection." << endl; cin >> choice; switch (choice) { case 'a': { cout << "ADD SONG" << endl; cout << "Enter song's unique ID:" << endl; cin >> uqid; cout << "Enter song's name:" << endl; cin >> songnam; cout << "Enter artist's name:" << endl; cin >> artname; cout << "Enter Song len" << endl; cin >> len; Playlist playlistobj(uqid, songnam, artname, len); PlaylistNode.Addsong(playlistobj); break; //Add record } case 'd': { cout << "REMOVE SONG" << endl;
  • 11. cout << "Enter song's unique ID:" << endl; cin >> uqid; PlaylistNode.Removesong(uqid); } break; //Display record case 'c': { int Creentpos = 0; int newpos = 0; cout << "Enter song's current position:" << endl; cin >> Creentpos; cout << "Enter new position for song:" << endl; cin >> newpos; PlaylistNode.Changeposition(Creentpos, newpos); } case 's': cout << "Enter artist's name:" << endl; cin >> artname; PlaylistNode.PrintSongByartist(artname); break; //EDit record case 't': PlaylistNode.PrintSongtotalLen(); break; //EDit record case 'o': PlaylistNode.PrintFullPlayList(); break; //EDit record case 'q': cout << "QUIT PROGTRAM--" << endl; break; default: cout << "Invalid Selection" << endl; } } while (choice == 'q'); system("PAUSE"); return 0; }
  • 12. Playlist.cpp: #include "Playlist.h" Playlist::Playlist(string auniqueId, string asongName, string aArtistName, int aSongLength) { uniqueID = auniqueId; songName = asongName; artistName = aArtistName; songLength = aSongLength; } string Playlist::GetArtistName() { return artistName; } string Playlist::GetID() { return uniqueID; } string Playlist::GetSongName() { return songName; } int Playlist::GetSongLength() { return songLength; } void Playlist::SetNext() { } string Playlist::GetNext() { return ""; } void Playlist::InsertAfter() { } void Playlist::PrintPlaylistNode() {
  • 13. cout << "Unique ID:" << uniqueID << endl; cout << "Song Name:" << songName << endl; cout << "Artist Name:" << artistName << endl; cout << "Song Length (in seconds):" << songLength << endl; } //// void PlaylistNode::Addsong(Playlist aPlaylist) { library.push_back(aPlaylist); } void PlaylistNode::Removesong(string aUnwiid) { if (library.size() > 0) { for (list::iterator it = library.begin(); it != library.end(); ++it) { if (it->GetID() == aUnwiid) { cout << it->GetSongName() << endl; library.remove(*it); break; } } } } Playlist PlaylistNode::get(list _list, int _i) { list::iterator it = _list.begin(); for (int i = 0; i<_i; i++) { ++it; } return *it; } std::list::iterator it; void PlaylistNode::PrintFullPlayList() { for (it = library.begin(); it != library.end(); ++it)
  • 14. { PrintPlaylist(*it); } } void PlaylistNode::PrintSongByartist(string aartiename) { for (it = library.begin(); it != library.end(); ++it) { if (it->GetArtistName() == aartiename) PrintPlaylist(*it); } } void PlaylistNode::PrintSongtotalLen() { int TotalSonglengst = 0; for (it = library.begin(); it != library.end(); ++it) { TotalSonglengst += it->GetSongLength(); } cout << "Total songs Length (in seconds):" << TotalSonglengst << endl; } void PlaylistNode::PrintPlaylist(Playlist aPlayList) { cout << "Unique ID:" << aPlayList.GetID() << endl; cout << "Song Name:" << aPlayList.GetSongName() << endl; cout << "Artist Name:" << aPlayList.GetArtistName() << endl; cout << "Song Length (in seconds):" << aPlayList.GetSongLength() << endl; } void PlaylistNode::Changeposition(int oldPostion, int newPostinon) { if (!library.empty()) { if (newPostinon <= library.size()) { Playlist oldPlalist = get(library, oldPostion); Playlist New_Playlist = get(library, newPostinon);
  • 15. Playlist pldpay(oldPlalist.GetID(), oldPlalist.GetSongName(), oldPlalist.GetArtistName(), oldPlalist.GetSongLength()); /*library.insert(pldpay,newPostinon); library.insert(New_Playlist, oldPostion);*/ } else { cout << "The Postion is Not in the Range of LIB" << endl; } } } Playlist.h: #pragma once #include #include #include #include #include using namespace std; class Playlist { private: string uniqueID; string songName; string artistName; int songLength; public: Playlist() { uniqueID = "", songName = "", artistName = "", songLength = 0; }; Playlist(string auniqueId, string asongName, string aArtistName, int aSongLength); void InsertAfter(); void SetNext(); string GetID(); string GetSongName(); string GetArtistName(); int GetSongLength(); string GetNext();
  • 16. void PrintPlaylistNode(); }; //#pragma once //#include "Playlist.h" //#include class PlaylistNode { private: std::list library; Playlist get(list _list, int _i); void PrintPlaylist(Playlist aPlayList); public: void Addsong(Playlist aPlayslist); void Removesong(string aUnwiid); void Changeposition(int oldPostion, int anewPostion); void PrintSongByartist(string aAstist); void PrintSongtotalLen(); void PrintFullPlayList(); };