Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ record_player flashdrive Following the class diagram shown below, create the class RecordPlayer. An RecordPlayer represents a stereocomponent that can play vinyl records.. Please review

C++ record_player flashdrive

Following the class diagram shown below, create the class RecordPlayer. An RecordPlayer represents a stereocomponent that can play vinyl records.. Please review the class and the sample driver code. As explained in class, there is a specific order to the way the class methods should be called. In other words, you can't plop the Needle unless there actually is a record on the player and the recordplayer is turned on. You also can't return the Needle unless there is actually a record on the player and the recordplayer is turned on. Your class should enforce these rules and write errors to cout as they occur. A sample driver for this class is shown below. You should probably make a more thorough driver to test your class better.

Your submission should follow this organization:

main.cpp this is your driver file

record_player.h

record_player.cpp

RecordPlayer

RecordPlayer( );

void turnOn( ); void turnOff( ); bool isPoweredOn( ); void affixPlatter( string record ); void plopNeedle( ); void returnNeedle( );

bool my_isOn; string my_Record; bool my_NeedleIsOnTheRecord;

Sample Driver Code

cout << "--Test 1--" << endl;

RecordPlayer r; r.turnOn(); r.affixPlatter( "Barry Manilow I" ); r.plopNeedle( ); r.returnNeedle( ); r.turnOff( ); cout << "--Test 2--" << endl;

RecordPlayer badr; badr.plopNeedle( ); cout << "--Test 3--" << endl;

RecordPlayer badr1; badr1.turnOn( ); badr1.plopNeedle( );

cout << "--Test 4--" << endl;

RecordPlayer badr2; badr2.returnNeedle( ); cout << "--Test 5--" << endl;

RecordPlayer badr3; badr3.turnOn( ); badr3.returnNeedle( );

Sample Driver Output

--Test 1-- recordplayer is on... recordplayer has album Barry Manilow I recordplayer is playing album Barry Manilow I recordplayer has stopped playing album recordplayer is off... --Test 2-- you can't plop the needle without being powered on! --Test 3-- you can't plop the needle without an album! --Test 4-- you can't return the needle without being powered on! --Test 5-- you can't return the needle without an album!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Linked Data A Geographic Perspective

Authors: Glen Hart, Catherine Dolbear

1st Edition

1000218910, 9781000218916

More Books

Students also viewed these Databases questions