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

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 .


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...
......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...
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.
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....
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.
C++ Write a program that prompts for a file name and then reads the file to...
C++ Write a program that prompts for a file name and then reads the file to check for balanced curly braces, {; parentheses, (); and square brackets, []. Use a stack to store the most recent unmatched left symbol. The program should ignore any character that is not a parenthesis, curly brace, or square bracket. Note that proper nesting is required. For instance, [a(b]c) is invalid. Display the line number the error occurred on. These are a few of the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT