/*
      
      while readAccuracy returns a 1 {
         call readLimits
         call printInputs
         call printArea
      }
    */
while (readAccuracy == 1) {

    calcArea (readLimits, printInputs, printArea); 
}

Recommended Answers

All 4 Replies

"readAccuracy returns" implies that readAccuracy is a function.
"call readLimits" also implies readLimits is a function.
Plus your pseudo code makes no mention of something named calcArea

So, no, I don't think you're quite there.

sorry. this should simplify things. I called readLimits but how to I call printInputs and printArea?

#include <stdio.h>
#include <math.h>

// Constants
const int GOOD = 1;
const int BAD = 0;

// Function prototypes.
void   clearInput ();
int    readAccuracy (int *accuracy);
void   readLimits (double *x1, double *x2);
void   printInputs (int accuracy, double x1, double x2);
double calcArea (int count, double x1, double x2);
void   printArea (int accuracy, double x1, double x2);


int main (void) {

int  accuracy;
int* ptr;
ptr = &accuracy;
double x1, x2;
readAccuracy(ptr);
readLimits(&x1, &x2);

   /*
      while readAccuracy returns a 1 {
         call readLimits
         call printInputs
         call printArea
      }
    */
printf("           ******* Area Under The Curce Calculator *******\n\n");

while (readAccuracy(ptr) == 1){

	readLimits(&x1, &x2);
	
}


   return (0);
}

For calling print input and print area you need one int and two double .

Syntax will be like this

printarea(i,j,k); //Where i is taken as int j and k are taken as double

so they both become?

printInputs(accuracy, x1, x2);

printArea(accuracy, x1 ,x2);

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.