In: Computer Science
Write a C++ program that design a class
definition to be put in
a header file called fizzjazz.h A store sells online FizzJazz
which are sound tones made by famous bands. For each
FizzJazz,
the store wants to keep track of the following attributes:
* title - the name of the sound tone
* band - Famous band name that created the tone
* duration - this is in seconds and may be fractional:
examples: 20.0, 34.5
Each attribute will have a corresponding getter(accessor)
function or setter(mutator) function. PLEASE PUT ONLY
FUNCTION PROTOTYPES IN YOUR CLASS; DO NOT ADD ANY FUNCTION
IMPLEMENTATION CODE. These would normally be put into
a.cpp
file which you do not need to provide.
Also remember to add a default constructor as well as a
constructor
that takes the attributes.
Please up vote ,comment if any query . Thanks for Question .Be safe .
Note : check attached image for fizzjazz.h file code .code wrtitten in visual basic c++98.
Program : fizz.jazz.h
#include<iostream>//basic header file
using namespace std;
#pragma once //no need to mention if def
class FizzJazz //class declaration
{
private: //private variable access inside this file
string title;
string band;
double duration;
public:
FizzJazz(); //default constructor
FizzJazz(string title, string band, double duration);
//parameter constructor
string getTitle();//get title name as string
string getBand(); //get band name as string
double getDuration(); //get duration in double
format
void setTitle(string title); //set title to passed
string title
void setBand(string band); //set band name
void setDuration(double duration); //set duration of
tone
};
Program :
Please up vote ,comment if any query . i will update .