title: Can I get any suggestions on how to fix this C++ program on calculating data plans?
body: <p>I am a coding newbie who is perplexed and confused about how to make this program work.</p>
  
  <p>Display a menu to show the different data plans. Plan 1 is $39.99 per month with 450 included minutes. Additional minutes are $0.45 per minute. Plan 2 is $59.99 per month with 900 provided minutes. Additional minutes are $0.40 per minute. Plan 3 is $69.99 per month with unlimited minutes.</p>
  
  <p>• The customer’s account number 
    • The customer’s plan number • The
      total minutes used by the customer 
    • The total amount due (formatted)</p>
  
  <p>Input validation: be sure the user only selects package 1, 2 or 3.</p>
  
  <p>I searched stackoverflow with three different search query variations: 'data plans', 'cell phone data plans', 'how to calculate data plans' and I did find this post <a href="https://stackoverflow.com/questions/32908631/comparing-cell-phone-plans-in-c">Comparing Cell Phone Plans in C++</a> and it was a somewhat similar program but not similar enough. I googled it also and found some similar programs but they were more helpful, but too complex and didn't help me enough. </p>
  
  <p>I am at a standstill and don't know how to calculate the total bill using the number of minutes used on Plan One and Plan Two that are over the allotted minutes with both of those plans.</p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>int main()
  {
      // Declare and initialize double constant variables
      const double planOne = 39.99,
                   planTwo = 59.99,
                   planThree = 69.99,
                   planOneExtMins = 0.45,
                   planTwoExtMins = 0.40;
  
      // Declare integer variables
      int planThreeUnlMins,
          custPlanNum,
          numMinsUsed;
  
      // Declare double variables
      double billOne,
             billTwo,
             billThree;
  
      // Declare unsigned variable
      unsigned int planChoice;
  
      // Initialize string variable
      string custAcctNum;
  
      // Ask for customer account number
      cout &lt;&lt; "\n\nPlease enter your customer account number in all capital 
      letters and numbers and then press enter when done: ";
      cin &gt;&gt; custAcctNum;
  
      // Welcome statement
      cout &lt;&lt; "Welcome to the Python Services Mobile Provider program that 
      will help you determine your monthly bill\n\n";
  
      // Display menu with the different data plans offered
      cout &lt;&lt; "Data Plans Menu";
      cout &lt;&lt; "\n\n\t1. Plan One is $39.99 per month with 450 included 
      minutes. Additional minutes are 0.45 per minute.";
      cout &lt;&lt; "\n\t2. Plan Two is $59.99 per month with 900 provided minutes. 
      Additional minutes are $0.40 per minute.";
      cout &lt;&lt; "\n\t3. Plan Three is $69.99 per month with unlimited minutes." 
      &lt;&lt; endl;
      cout &lt;&lt; "Please enter your choice of a data plan: ";
  
      // Validate if the choice of the user is a number between one and four
      int planChoice = 0;
      cin &gt;&gt; planChoice;
  
      if(!( planChoice == 3 )) {
              // Display restart program statement and end program
              cout &lt;&lt; "Please restart the program and enter a number between 
              one and four" &lt;&lt; endl;
              cout &lt;&lt; "Program ending";
              return 0;
              }
  
      // Ask user for the number of minutes used
      cout &lt;&lt; "\n\nPlease enter the number of minutes used: ";
      cin &gt;&gt; numMinsUsed;
  
      if( planChoice == 1 ) {
      // What code can I use to use the number of minutes used to  
      calculate the total cost of a particular data plan?
      }
  
      // Set the numeric output formatting
      cout &lt;&lt; fixed &lt;&lt; showpoint &lt;&lt; setprecision(2);
  
      switch (planChoice) {
  
      case 1: cout &lt;&lt; "Please enter the amount of minutes used: " &lt;&lt; endl;
      cin &gt;&gt; numMinsUsed;
      break;
  
      case 2: cout &lt;&lt; "Please enter the amount of minutes used: " &lt;&lt; endl;
      cin &gt;&gt; numMinsUsed;
      break;
  
      case 3: cout &lt;&lt; "Please enter the amount of minutes used: " &lt;&lt; endl;
      break;
  
      default: cout &lt;&lt; "Please enter a valid plan number from above" &lt;&lt; endl;
      cin &gt;&gt; numMinsUsed;
  
      }
  
      if( planChoice == 1 ) {
          billOne = planOne + ( .45 * numMinsUsed );
      }
      else if( planChoice == 2 ) {
          billTwo = planTwo + ( .40 * numMinsUsed );
      }
  
      else if (planChoice == 3 )  {
          billThree = planThree;
      }
  
      return 0;
  }
  </code></pre>