with main already established: int main(){ displaySplash(); BluRay a; BluRay c(5
ID: 3910791 • Letter: W
Question
with main already established:
int main(){
displaySplash();
BluRay a;
BluRay c(58964, "Achy Breaky Heart", "Billy Ray Cyrus", 4.99, "Country");
a.setID(12893);
a.setTitle("Happy");
a.setArtist("Pharrel Williams");
a.setPrice(1.48);
a.setGenre("Pop");
BluRay b = a;
cout << " Here is the detailed report...";
cout << " ID Number: " << b.getID();
cout << " Title: " << b.getTitle();
cout << " Artist: " << b.getArtist();
cout << " Wholesale: $" << b.getPrice();
cout << " Genre: " << b.getGenre();
cout << " Compare: " << (b == a ? "true" : "false");
cout << " " << c << endl;
cout << " Compare: " << (c == b ? "true" : "false");
cout << " " << ++a << endl;
cout << " End of Program...";
return 0;
}
void displaySplash(string a){
cout << " ===================================================";
cout << " Project.........Final Exam Practicum";
cout << " Course..........Programming II";
cout << " Date.......... .07/2018";
cout << " ===================================================";
}
You have been assigned the job of managing the inventory of music video BluRay disk mail order company, BR Sales. The information that needs to be maintained for each disk are: . a five digit ID number as integer . title as string recording artist as string wholesale price as double . genre of music as string The methods that need to be supported for each disk are: 1 create a new BluRay object with default values for each attribute(0 for all numeric 2. create a new BluRay object with programmer-specified attributes. Use the order as 3. create a new BluRay object with member values of another BluRay object. (copy 4 get0) for each of the data members members, "Value is needed" for all strings listed above. constructor) 5. set() for each of the data members. Validate all numerics to change all negative 6 compare two BluRay objects for equality by overloading operator-0. If two 7 overload operatorExplanation / Answer
#include <bits/stdc++.h>
#include <iostream>
#include<string>
using namespace std;
class BluRay{
public:
int ID=0;
string title="value is needed";
string artist="value is needed";
double price=0.0;
string genre="value is needed";
//constructor
void BlueRay(int id,string titl,string art,double pri,string gen){
ID=id;
title=titl;
artist=art;
price=pri;
genre=gen;
}
//copy constructor
void BlueRay( const BlueRay &b) {
ID = b.ID; title = b.title;artist=b.artist;price=b.price; genre=b.genre;
}
void setID(int id){
ID=id;
}
void setTitle(string titl){
title=titl;
}
void setArtist(string art){
artist=art;
}
void setPrice(double pri){
price=pri;
}
void setGenre(string gen){
genre=gen;
}
//get methords
int getID(){
return ID;
}
string getTitle(){
return title;
}
string getArtist(){
return artist;
}
double getprice(){
return price;
}
string getGenre(){
return genre;
}
//Compare
bool operator==(const BlueRay& n1, const BlueRay& n2){
bool result;
result = (n1==n2);
return result;
}
//price increase
};//end of blue rayclass
int main(){
displaySplash();
BluRay a;
BluRay c(58964, "Achy Breaky Heart", "Billy Ray Cyrus", 4.99, "Country");
a.setID(12893);
a.setTitle("Happy");
a.setArtist("Pharrel Williams");
a.setPrice(1.48);
a.setGenre("Pop");
BluRay b = a;
cout << " Here is the detailed report...";
cout << " ID Number: " << b.getID();
cout << " Title: " << b.getTitle();
cout << " Artist: " << b.getArtist();
cout << " Wholesale: $" << b.getPrice();
cout << " Genre: " << b.getGenre();
cout << " Compare: " << (b == a ? "true" : "false");
cout << " " << c << endl;
cout << " Compare: " << (c == b ? "true" : "false");
cout << " " << ++a << endl;
cout << " End of Program...";
return 0;
}
/*void displaySplash(string a){
cout << " ===================================================";
cout << " Project.........Final Exam Practicum";
cout << " Course..........Programming II";
cout << " Date.......... .07/2018";
cout << " ===================================================";
}*/
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.