I am simply trying to get the input from the user for the name of the ski resort to display fully with white spaces. I have tried multiple things including setting a constant for size, using cin.get and cin.getline. Have had no luck thusfar. Also directly below it, I am trying to set the parameters on the rand function using information entered by user previously in minimumSnowfall and maximumSnowfall.
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <string>
using namespace std;
int main(void)
{
int minimumSnowfall;
int maximumSnowfall;
char skiResortName[81];
cout << "I will forecast how much snowfall there will be on each \nday this weekend. You get to pick the range. " << endl;
cout << "Please enter the minimum amount of snow that \nwill fall in one day in inches: ";
cin >> minimumSnowfall;
cout << "Please enter the maximum amount of snow that \nwill fall in one day in inches: ";
cin >> maximumSnowfall;
// need to fix to display names with white spaces
cout << "Enter the name of the ski resort: ";
cin.getline(skiResortName,81);
cout << "The local forecast for snowfall at " << skiResortName << " this weekend: " << endl;
// need to fix to display random number using parameters entered by weatherman in minimumSnowfall and maximumSnowfall
cout << "Friday: " rand (minimumSnowfall, maximumSnowfall);
return 0;