I am suppose to be writing a program that takes ten numbers with the area code 405 520 620 550 650 and generate a call connection time using rand() to generate an unsigned integer between 0 and RAND_MAX and than in return display call statistics total revenue. I am trying to approach this by breaking it down and so far this is what I have
CODE
#include <iostream>
#include <cstdlib>
using namespace std;
int main ()
{
int callone = 0;
cout <<"Please enter the nimber you would like to call! ex. 4056783456";
cin >> callone;
if (cin.fail() )
{
cout <<"Error: Bad input/n";
return 1;
}
}
[/quote]
1.input from users a phone number
405 (2 cents per second basic_rate)
520 (1.25 * basic_rate)
550 (1.25 * basic_rate)
620(1.75 * basic_rate)
650(1.75 * basic_rate)
double basic_rate = .2 * second
double 520 = 1.25 * basic_rate
double 550 = 125 * basic_rate
double 620= 1.75 * basic_rate
double 650=1.75 * basic_rate
int callone = 0;
cout<<”Please enter the number you would like to call starting with area code ex.4056233456”;
cin >> callone;
minimize input validatoin 4056677345
if (cin.fail())
{
cout<< “Error: Bad input/n”;
return 1;
}
check length= 10
while lop:
while (callone = )
{
callone =
#include <cstdlib>
RAND_MAX
rad(0- RAND_MAX )
restrict the times to set values 1s-120s (use arithmetic operators)