1 Replies - 218 Views - Last Post: 07 November 2017 - 10:29 PM Rate Topic: -----

#1 mistylove98  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 06-May 15

property tax pointers

Posted 07 November 2017 - 09:02 PM

i made a property tax program but now i have to use it with pointers. i have to use 3 functions inputtotalsales,calculatetaxes,and displaytaxes.It was easy for me to do this the regular way but im having an issue with pointers I am getting a 1d returned 1 exit status can someone take a look? this is what I tried.

 #include <stdio.h>
float inputtotalsales();
float calctaxes(float*,float* );

void displaytaxes(float,float);

 int main()

{
  float totalsale;
  float statetax;
  float countytax;

  totalsale =inputtotalsales();
  calctaxes(&statetax,&countytax);


  displaytaxes(statetax,countytax);
  return 0;
}

    float inputtotalsales()
 {

  float totalsale;

 printf("Enter total sales for month");
  scanf("%f",& totalsale);

 return totalsale;
} 

 float calcstaxes(float *statetaxptr,float*countytaxptr)
{ float totalsale;
  float statetax= totalsale*.04;
  float countytax=totalsale *.02;

 *statetaxptr=statetax; 
 *countytaxptr=countytax;



 } 

void      displaytaxes(float statetax,float countytax)
 {


  printf("\n State tax is %.2f",statetax);
  printf("\n County tax is %.2f",countytax);
  printf("\n Total tax is %.2f",statetax+countytax);
 }


Is This A Good Question/Topic? 0
  • +

Replies To: property tax pointers

#2 jimblumberg  Icon User is offline

  • member icon

Reputation: 5334
  • View blog
  • Posts: 16,602
  • Joined: 25-December 09

Re: property tax pointers

Posted 07 November 2017 - 10:29 PM

Please post your complete error messages, all of them, exactly as they appear in your development environment (you should have a couple).

Jim
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1