Question

In: Computer Science

Write a C++ program that design a class definition to be put in a header file...

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.

Solutions

Expert Solution

Program Code [C++]

fizzjazz.h

// Header Guards

#ifndef FIZZ_JAZZ_H
#define FIZZ_JAZZ_H

#include <iostream>
using namespace std;

// FizzJazz class

class FizzJazz {
  
   private:
      
       // All Required attributes
      
       string title;
       string band;
       double duration;
      
   public:
      
       // All Required functions prototypes
      
       // Default Constructor
      
       FizzJazz();
      
       // Parameterized constructor
      
       FizzJazz(string, string, double);
      
       // Setters & Getters for all attributes
      
       void setTitle(string);
       void setBand(string);
       void setDuration(double);
      
       string getTitle();
       string getBand();
       double getDuration();
};

#endif

----------------------------------------------------------------------
COMMENT DOWN FOR ANY QUERIES!!!
HIT A THUMBS UP IF YOU DO LIKE IT!!!


Related Solutions

Write a C++ program that design a class definition to be put in a header file...
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...
Write a C++ program that design a class definition to be put in a header file...
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...
A header file contains a class template, and in that class there is a C++ string...
A header file contains a class template, and in that class there is a C++ string object. Group of answer choices(Pick one) 1)There should be a #include for the string library AND a using namespace std; in the header file. 2)There should be a #include for the string library. 3)There should be a #include for the string library AND a using namespace std; in the main program's CPP file, written before the H file's include.
Use the functions.h header file with your program (please write in C code): #ifndef FUNCTIONS_H #define...
Use the functions.h header file with your program (please write in C code): #ifndef FUNCTIONS_H #define FUNCTIONS_H typedef struct MyStruct { int value; char name[ 100 ]; } MyStruct; void sortArray( MyStruct*, int ); void printArray( MyStruct*, int ); #endif Create a source file named functions.c with the following: A sorting function named sortArray. It takes an array of MyStruct's and the length of that array. It returns nothing. You can use any of the sorting algorithms, you would like...
What are the “guard statements” that we put in the .h file of a class definition?...
What are the “guard statements” that we put in the .h file of a class definition? Also tell what each of them do. ______________________________________________________________________________________________ What keywords are used to create, and release dynamic memory? ________________________________________________________________________________________ What is being made constant in the following member function of a Monkey class? Explain what each const is doing. const Zip& frappa( const Foo& thing ) const; _________________________________________________________________________________________ Thank you for the explain these problems.
......C++ PROGRAM.... Teacher would like us to split this program into a header file(filename.h), and a...
......C++ PROGRAM.... Teacher would like us to split this program into a header file(filename.h), and a .cpp file(filename.cpp). He gave us all the code, we just need to split it up. I do not quite understand how to do it. Please send output screenshot to show validation. #include <iostream> using namespace std; //public class class Account{ public: //instance variables double amount;    //creates account and sets amount with users account set-up value Account(double a){ amount = a; }    //adds...
**C++ program** Please provide a header file(bubble_sort.h) and a program file(bubble_sort.cpp). Also include notes to explain...
**C++ program** Please provide a header file(bubble_sort.h) and a program file(bubble_sort.cpp). Also include notes to explain code and output screenshots. Please use Bubble Sort code provided. Write a program for sorting a list of integers in ascending order using the bubble sort algorithm. Requirements Implement the following functions: Implement a function called readData int readData( int *arr) arr is a pointer for storing the integers. The function returns the number of integers. The function readData reads the list of integers...
Write a C++ program (The Account Class) Design a class named Account that contains (keep the...
Write a C++ program (The Account Class) Design a class named Account that contains (keep the data fields private): a) An int data field named id for the account. b) A double data field named balance for the account. c) A double data field named annualInterestRate that stores the current interest rate. d) A no-arg constructor that creates a default account with id 0, balance 0, and annualInterestRate 0. e) The accessor and mutator functions for id, balance, and annualInterestRate....
Complete the task below C++ This header file declares the Comp315Array Class **************************/ //Include the libraries...
Complete the task below C++ This header file declares the Comp315Array Class **************************/ //Include the libraries #include <iostream> //Allow the use of cin and cout //Declare namespace std for using cin and cout using namespace std; //Class declaration class Comp315Array{ //Public members public: /**************** Default Constructor Task: assign 0 to the array size *********/ Comp315Array(); /**************** Constructor Task: Define an int array of size n *********/ Comp315Array(int n); /***************** getSize method Task: return the array size ******************/ int getSize(); /*****************...
answer in c++ , Write the definition of the function NthOccurrence() whose header is int NthOccurrence(Array&...
answer in c++ , Write the definition of the function NthOccurrence() whose header is int NthOccurrence(Array& data,const T& value,int n) template It returns the index of the nth occurrence of value in data. If n is not positive, value appears less than n times in data or data is empty, it returns -1.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT