#include <iostream>
#include <cstring>
using namespace std;
int get_digits(const string& prompt)
{
int result;
cout << prompt;
cin >> result;
return result;
}
long perform_calculations(int firstThree, int lastFour)
{
long result = (firstThree * 80 + 1) * 250 + lastFour * 2 - 250;
return result / 2;
}
int main()
{
int firstThree = get_digits("Enter the first 3 digits of your phone: ");
int lastFour = get_digits("Enter the last 4 digits of your phone number: ");
cout << "The result is: " << perform_calculations(firstThree, lastFour);
return 0;
}
Comments