Question: C++ Programming- Scenario: You work for a concert promoter. Since some of the patrons of past events have been complaining about the moshers in the
C++ Programming-
Scenario:
You work for a concert promoter. Since some of the patrons of past events have been complaining about the moshers in the mosh pit the promoter has given you the job to determine the maximum number of moshers in the mosh pit so that a reserved area can be created for the moshers. The number of moshers that can fit into a mosh pit depends on the pit size, the average size of a mosher, the separation between the moshers, and the north, south, east, and west thickness of the mosh pit barricade to contain the moshers. Your program will need to get the following input from the user:
The length and width, in feet, of the mosh pit. Assume these are the maximum (outside) dimensions of the barricade.
The thickness of the north, south, east, and west sides of the barricade
The separation between moshers (and a barricade side if applicable)1
The average size of the mosher2
1 To get the space between moshers prompt the user for a separation value:
A separation of A or a means 2.5 foot distance between moshers
A separation of B or b means 1.5 foot distance between moshers
A separation of C or c means 0.5 foot distance between moshers
A separation of anything else means exit the program.
NOTE: Use a char variable type for the prompt response. See http://www.cplusplus.com/reference/cctype/tolower/ (Links to an external site.)Links to an external site.
2 To get the average size of a mosher (assume all moshers in the mosh pit will be the same size):
A mosher size of L or l means each mosher takes up a 1.5 foot by 1.5 foot space
A mosher size of XL or xl means each mosher takes up a 2.5 foot by 2.5 foot space
A mosher size of XXL or xxl means each mosher takes up a 3.5 foot by 3.5 foot space
A mosher size of anything else means exit program.
NOTE: Use a string data type for the prompt response. See http://stackoverflow.com/questions/313970/stl-string-to-lower-case (Links to an external site.)Links to an external site.
The MoshPit Program:
The MoshPit program must be implemented as follows. A MoshPit class and a main function defined as follows:
MoshPit::MoshPit() - A constructor that initializes all of its data members.
void MoshPit::GetMoshPitDimensions() - Member function that prompts the user for the dimensions of the mosh pit and store the results in the class' data members. Notice the function signature takes no arguments and returns no values.
void MoshPit::GetMosherSeperation() - Member function that prompts the user for the "mosher seperation" and store the results in the class' data member(s). Notice the function signature takes no arguments and returns no values.
void MoshPit::GetMosherSize() - Member function that prompts the user for the "size of the mosher" and store the results in the class' data member(s). Notice the function signature takes no arguments and returns no values.
void MoshPit::CalculateMoshPit() - Member function that uses the classes private data members to perform the mosh pit calculations. Notice the function signature takes no arguments and returns no values.
void MoshPit::DisplayResults() - Member function that uses the classes private data members to display the results to the user. Notice the function signature takes no arguments and returns no values.
int MoshPit::QuitProgram() - Member function that is called when ever the program needs to terminate. Notice the function signature takes no arguments and returns an integer value.
int Main() - Non-member function used to instantiate the MoshPit class and call it's member functions.
Code to work with:
/////////////////////////////////////////////////////////////////////////////// // MoshPit.cpp : This is one shell of a program. ///////////////////////////////////////////////////////////////////////////////
#include "stdafx.h" #include
MoshPit(); //Constructor
void GetMoshPitDimensions(); void GetMosherSeperation(); void GetMosherSize(); void CalculateMoshPit(); void DisplayResults();
int QuitProgram();
private:
// The class' data members go here....
}; /////////////////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////////////////// MoshPit::MoshPit() { // Initialize the class' data members here.... } /////////////////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////////////////// void MoshPit::GetMosherSeperation() { // Member function that prompts the user for the "mosher seperation" and // store the results in the class' data member(s). } /////////////////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////////////////// void MoshPit::GetMosherSize() { // Member function that prompts the user for the "size of the mosher" and // store the results in the class' data member(s). } /////////////////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////////////////// void MoshPit::CalculateMoshPit() { // Member function that uses the classes private data members to perform // the mosh pit calculations. } /////////////////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////////////////// int MoshPit::QuitProgram() { cout
cout
//// Prompt user for length of mosh pit cout
cout
//// Prompt the user for the thickness of the barricade. cout
cout
cout
cout
// Notice that there is no exiting the loop here. Exiting the program // happens in "QuitProgram()" while (true) { thePit.GetMoshPitDimensions(); thePit.GetMosherSeperation(); thePit.GetMosherSize(); thePit.CalculateMoshPit(); thePit.DisplayResults(); };
return 0; }

CAUsersUohn\Documents Visual Studio 2017AProjects ITCS2530 MoshPit DebuglMoshPit.exe Welcome to theMoshPit Calculator! lease enter the Length (in feet) of the mosh pit: 100 Please enter the Width (in feet) of the mosh pit: 100 Please enter the thickness (in feet) of the top of the North side of the barricade: 2 Please enter the thickness (in feet) of the top of the South side of the barricade: 2 Please enter the thickness (in feet) of the top of the East side of the barricade: 2 Please enter the thickness (in feet) of the top of the West side of the barricade: 2 Please enter the saftey rating (A, B, C or anything else to quit): a lease enter the size of the mosher (L, XL, XXL or anything else to quit): 1 The number of moshers that can fit East to West is: 24 The number of moshers that can fit North to South is 24 The total number of moshers that will fit in a barricade 100 feet wide by 100 feet long is 576! Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
