title: Converting stdio.h program to iostream
body: <p>This is my main module. I have a few external modules.  </p>
  
  <pre><code>int main(void)
  {
      char ln[15+1];
      char fn[10+1];
      float fed,state,ssi;
      float g,h,p,d,n;
  
      InputEmployeeData(&amp;ln[0],&amp;fn[0],&amp;h,&amp;p,&amp;d); // call 3.3
      CalculateGross(h,p, &amp;g); // call 3.4
      computeTaxes(g,d,ADDR(fed),ADDR(state),ADDR(ssi)); // call 3.5
      n = g-fed-state-ssi-d;
      printf("  Fed   =   %8.2f\n",fed);
      printf("  State =   %8.2f\n",state);
      printf("  SSI   =   %8.2f\n",ssi);
      printf("  Net   =   %8.2f\n",n);
      while(getchar() != '\n'); // flush(stdin)
      return 0;
  </code></pre>
  
  <p>main.cpp using iostream</p>
  
  <pre><code>cout &lt;&lt; "  Fed   =   %8.2f\n" &lt;&lt; fed;
  cout &lt;&lt; "  State =   %8.2f\n" &lt;&lt; state;
  cout &lt;&lt; "  SSI   =   %8.2f\n" &lt;&lt; ssi;
  cout &lt;&lt; "  Net   =   %8.2f\n" &lt;&lt; n;
   cin.sync();
  //while(getchar() != '\n'); 
  // flush(stdin)
  return 0;
  </code></pre>
  
  <p>inputemployeedata.cpp using stdio.h</p>
  
  <pre><code>//3.3
  #include &lt;stdio.h&gt;
  #define ADDR(var) &amp;var
  
  void InputEmployeeData(char *lastname,char *firstname, // 3.3
                         float *hours,float *payrate, float *defr);
  
  void InputEmployeeData(char *lastname,char *firstname, // 3.3
                         float *hours,float *payrate, float *defr)
  {
      printf(" Enter the name ==&gt; ");
      scanf("%s%s",firstname,lastname);
      printf(" Enter the hours and payrate ==&gt; ");
      scanf("%f%f",hours,payrate);
      printf("  Enter the deferred earning amount ==&gt; ");
      scanf("%f",defr);
  }
  </code></pre>
  
  <p>inputemployeedata.cpp using iostream</p>
  
  <pre><code>{
      cout &lt;&lt; " Enter the name ==&gt; ";
      cin &gt;&gt; *firstname &gt;&gt; *lastname;
      cout &lt;&lt;" Enter the hours and payrate ==&gt; ";
      cin &gt;&gt; *hours &gt;&gt; *payrate;
      cout &lt;&lt; "  Enter the deferred earning amount ==&gt; ";
      cin &gt;&gt; *defr;
  </code></pre>
  
  <p>I Don't know the equivalent of <code>%8.2f</code> for <code>cout</code>. I'm just stuck
  <img src="https://i.stack.imgur.com/IcodG.png" alt="enter image description here"></p>