I'm currently having a problem with having where it says DailyChild on my code to go up when the user adds a number. For example if they type 1 it should say 1.50. If they enter 2, it should say 3.00. But no matter what I do, it keeps printing coming up to 1.50. Can someone show me what I'm doing wrong please, really in a jam on trying to get this to work. Also may someone be able to tell me why when I compile my program it shows no errors but when I'm bout to exit the program it says theres an error. You'll notice it when you enter in the code. Also if you notice any other problems with my code, please let me know. Thanks for the help, I'm patiently hoping for a reply soon!

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>



void PrintAStarLine(void);
void GetInput(void);
void GetTicket(void);
void HowManyChildren(void);
void HowManyAdults(void);
void HowManySeniors(void);
void ChildrenCalculations(void);


float DailyChild;
float YearlyChild;
float DailyAdult;
float YearlyAdult;
float DailySenior;
float YearlySenior;

char customerName[30];
char tickettype[8];
int childrenNum;
int adultNum;
int seniorNum;


main()
{

	{
	PrintAStarLine();

	printf("			Home Aquarium Data Entry \n");
	printf("\n\n");

	PrintAStarLine();

	GetInput();
	}
	GetTicket();

	

	return 0;
}

void PrintAStarLine(void)

{

	  printf("**************************************************************************** \n");
      printf("\n\n");

	  return;
	
}

void GetInput(void)
{
	
	

	printf("Customer Name (First Middle Last):   ");						
	scanf(" %s %s %s", &customerName); 
	printf("\n\n\n");

	return;
}


void GetTicket(void)
{
	
	
	

	printf("Type of ticket (Daily(D) or Yearly(Y)):   ");						
	scanf(" %s", &tickettype); 
	if (strcmp (tickettype,"D") == 0)
	{
	HowManyChildren();
	HowManyAdults();
	HowManySeniors();
	printf("Children total cost: %10.2f\n", DailyChild);
	printf("Adult total cost: %10.2f\n", DailyAdult);
	printf("Senior total cost: %10.2f\n", DailySenior);
	}
	else if (strcmp (tickettype,"d") == 0)
	{
	HowManyChildren();
	HowManyAdults();
	HowManySeniors();
	printf("Children total cost: %10.2f\n", DailyChild);
	printf("Adult total cost: %10.2f\n", DailyAdult);
	printf("Senior total cost: %10.2f\n", DailySenior);
	}
	else if (strcmp (tickettype,"Daily") == 0)
	{
	HowManyChildren();
	HowManyAdults();
	HowManySeniors();
	printf("Children total cost: %10.2f\n", DailyChild);
	printf("Adult total cost: %10.2f\n", DailyAdult);
	printf("Senior total cost: %10.2f\n", DailySenior);
	}
	else if (strcmp (tickettype,"daily") == 0)
	{
	HowManyChildren();
	HowManyAdults();
	HowManySeniors();
	printf("Children total cost: %10.2f\n", DailyChild);
	printf("Adult total cost: %10.2f\n", DailyAdult);
	printf("Senior total cost: %10.2f\n", DailySenior);
	}
	else if (strcmp (tickettype,"Y") == 0)
	{
	HowManyChildren();
	HowManyAdults();
	HowManySeniors();
	printf("Children total cost: %10.2f\n", YearlyChild);
	printf("Adult total cost: %10.2f\n", YearlyAdult);
	printf("Senior total cost: %10.2f\n", YearlySenior);
	}
	else if (strcmp (tickettype, "y") == 0)
	{
	HowManyChildren();
	HowManyAdults();
	HowManySeniors();
	printf("Children total cost: %10.2f\n", YearlyChild);
	printf("Adult total cost: %10.2f\n", YearlyAdult);
	printf("Senior total cost: %10.2f\n", YearlySenior);
	}
	else if (strcmp (tickettype,"Yearly") == 0)
	{
	HowManyChildren();
	HowManyAdults();
	HowManySeniors();
	printf("Children total cost: %10.2f\n", YearlyChild);
	printf("Adult total cost: %10.2f\n", YearlyAdult);
	printf("Senior total cost: %10.2f\n", YearlySenior);
	}
	else if (strcmp (tickettype,"yearly") == 0)
	{
	HowManyChildren();
	HowManyAdults();
	HowManySeniors();
	printf("Children total cost: %10.2f\n", YearlyChild);
	printf("Adult total cost: %10.2f\n", YearlyAdult);
	printf("Senior total cost: %10.2f\n", YearlySenior);
	}
		else
		{
		printf("\nIncorrect Input, please try again.\n");
		printf("\n\n\n");
		GetTicket();
		}
	
	printf("\n\n");

	return;
}

void HowManyChildren(void)

{
	
	DailyChild=1.50;
	
	YearlyChild = 5.50;
	
	printf("\n");
	printf("#of Children:   ");
	scanf(" %d", &childrenNum);
	printf("\n");

	if (childrenNum <= 999) 
	{
	}
	else 
	{
	printf("Invalid Number Entered, please try again.");
	printf("\n\n\n");
	HowManyChildren();
	}


	return;
}

void HowManyAdults(void)
{

	DailyAdult = 2.00;
	YearlyAdult = 6.50;

	printf("\n");
	printf("#of Adults:   ");
	scanf(" %d", &adultNum);
	printf("\n");

	if (adultNum <= 999) 
	{
	}
	else 
	{
	printf("Invalid Number Entered, please try again.");
	printf("\n\n\n");
	HowManyAdults();
	}

	
	return;
}

void HowManySeniors(void)
{
	
	DailySenior = 1.25;
	YearlySenior= 3.75;

	printf("\n");
	printf("#of Seniors:   ");
	scanf(" %d", &seniorNum); 
	printf("\n");

	if (seniorNum <= 999) 
	{
	}
	else 
	{
	printf("Invalid Number Entered, please try again.");
	printf("\n\n\n");
	system("pause"); 
	HowManySeniors();
	}

	

	return ;

}

void ChildrenCalculations(void)
{
	
	
	
	
	



	return;

}

This isn't C++ code, its C. (The two languages are very different)

Probably the reason that you get an error when your code exits, is that your declaration of main() is ill-formed.
Change your main declaration so that it looks like this -

int main(void)

As for your issue of the wrong output, it looks as if your program doesn't do anything with the number of children after you prompt the user for it.


I think your program has a lot of design issues - you're using alot of global variables, this is one way to make your program very messy and hard to follow. Try rearranging your program so that variables are declared where they're needed, and passed or returned to/from functions instead. You should find that the logic of the program is much easier to trace by doing this.

As far as the arranging of my code, I'll work on that right away. I'm still new to it, and havent gotten any help concerning C programming until now. I'm in a C++ class atm, but it seems we are starting out with C coding first. I'm still trying to figure out how to get the calculations to work in my program. If someone can shed some light on that area for me, it would be greatly appreciated. Thanks again.

Look at this section of code, where you ask the user to enter the number of children

void HowManyChildren(void)
{
	DailyChild=1.50;
	YearlyChild = 5.50;
	
	printf("\n");
	printf("#of Children:   ");
	scanf(" %d", &[B]childrenNum[/B]);
	printf("\n");

	if (childrenNum <= 999) 
	{
	}
	else 
	{
	printf("Invalid Number Entered, please try again.");
	printf("\n\n\n");
	HowManyChildren();
	}

	return;
}

After asking the user to input the number of children, your program doesn't do anything else with childrenNum aside from checking that its less than 999.

Somewhere you want to calculate the ticket cost using this number and your cost-per-ticket. Maybe you intended to put that in your ChildrenCalculations() function.

- With regards to C vs C++ - These days, its unusual for a C++ course to use things like printf, scanf, strcmp (They're valid in C++, but only for the sake of compatibility with C). Most modern C++ courses don't teach the language as 'a better C' - although there's nothing wrong with learning both languages, you'll find alot of things done differently when you move onto C++.

I'm still trying to figure out how to get the calculations to work in my program. If someone can shed some light on that area for me, it would be greatly appreciated. Thanks again.

Without trying to discourage you, I have to say your code is full of errors.
My suggestion is that you should work little by little in the steps that
you need to take for you code to work. Compile each of those steps in separate stages and if they work implement them together. That way the bugs would have a harder time compounding.

Let's look at any of your functions. All seems to be suffering of the same problems.

void HowManySeniors(void)
{
    
    DailySenior = 1.25;
    YearlySenior= 3.75;

    printf("\n");
    printf("#of Seniors:   ");
    scanf(" %d", &seniorNum); 
    printf("\n");

    if (seniorNum <= 999) 
    {
    }
    else 
    {
    printf("Invalid Number Entered, please try again.");
    printf("\n\n\n");
    system("pause"); 
    HowManySeniors();
    }

    

    return ;

}

DailySenior = 1.25;
YearlySenior= 3.75;
Nothing is using those values inside the function, therefore no reason to be there.
scanf(" %d", &seniorNum);
scanf() is nothing but a lot of grief for any one that uses it. Specially, if you read strings with it. Avoid using that function.
Here's a couple of links that would help you to understand better.

http://www.daniweb.com/tutorials/tutorial45806.htm
http://www.daniweb.com/code/snippet266.htmli
http://www.gidnetwork.com/b-59.html

if (seniorNum <= 999)
{
}
What are you trying to do with that if? That construction is incorrect.
If you want the if() to do nothing it must be something like:

if (seniorNum <= 999)  /* if Seniors are less or iquals to 999 */
{
    ; /* do nothing */
}

system("pause");
Avoid that too. Read here about it.

Thanks for the info guys. I changed some stuff around in my code and got rid of some of the stuff I dont need. I would use a different code but my instructor wants us to use printf/scanf coding specifically. I'm stil having trouble with getting the calculation to work. I think I'm close though. Also I'm trying to figure out how I can make my program deny letters if its only asking for numbers. For example when it asks for the Customer's Name, I'm trying to make it reject the input if the user were to enter a number for their name, same thing with when it asks for number of children and so forth. I appreciate the help you guys have given me and will try my best to get better. This is the code again below.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>



void PrintAStarLine(void);
void GetInput(void);
void GetTicket(void);
void HowManyChildren(void);
void HowManyAdults(void);
void HowManySeniors(void);
void TotalCost(void);

float DailyChild;
float YearlyChild;
float DailyAdult;
float YearlyAdult;
float DailySenior;
float YearlySenior;


char customerName[30];
char tickettype[8];



int main(void)
{

	{
	PrintAStarLine();

	printf("			Home Aquarium Data Entry \n");
	printf("\n\n");

	PrintAStarLine();

	GetInput();
	}
	GetTicket();

	HowManyChildren();

	HowManyAdults();

	HowManySeniors();

	TotalCost();
	
	

	return 0;
}

void PrintAStarLine(void)

{

	  printf("**************************************************************************** \n");
      printf("\n\n");

	  return;
	
}

void GetInput(void)
{
	
	

	printf("Customer Name (First Middle Last):   ");						
	scanf(" %s %s %s", &customerName); 
	printf("\n\n\n");

	return;
}


void GetTicket(void)
{
	
		
	

	printf("Type of ticket (Daily(D) or Yearly(Y)):   ");						
	scanf(" %s", &tickettype); 
	if (strcmp (tickettype,"D") == 0)
	{

	}
	else if (strcmp (tickettype,"d") == 0)
	{
	
	}
	else if (strcmp (tickettype,"Daily") == 0)
	{
	
	}
	else if (strcmp (tickettype,"daily") == 0)
	{
	
	}
	else if (strcmp (tickettype,"Y") == 0)
	{
	
	}
	else if (strcmp (tickettype, "y") == 0)
	{
	
	}
	else if (strcmp (tickettype,"Yearly") == 0)
	{

	}
	else if (strcmp (tickettype,"yearly") == 0)
	{
	
	}
		else
		{
		printf("\nIncorrect Input, please try again.\n");
		printf("\n\n");
		GetTicket();
		}
	
	printf("\n\n");

	return;
}

void HowManyChildren(void)

{
	
	DailyChild = 1.50;
	YearlyChild = 5.50;

	
	printf("\n");
	printf("#of Children:   ");
	scanf(" %f", &DailyChild);
	printf("\n");

	if (DailyChild <= 999) 
	{
		;
	}
	else 
	{
	printf("Invalid Number Entered, please try again.");
	printf("\n\n\n");

	printf("\n");
	printf("#of Children:   ");
	scanf(" %f", &YearlyChild);
	printf("\n");
	HowManyChildren();
	}

	if (YearlyChild <= 999) 
	{
		;
	}
	else 
	{
	printf("Invalid Number Entered, please try again.");
	printf("\n\n\n");
	HowManyChildren();
	}

	return;
}

void HowManyAdults(void)
{

	DailyAdult = 2.00;
	YearlyAdult = 6.50;

	printf("\n");
	printf("#of Adults:   ");
	scanf(" %f", &DailyAdult);
	printf("\n");

	if (DailyAdult <= 999) 
	{
		;
	}
	else 
	{
	printf("Invalid Number Entered, please try again.");
	printf("\n\n\n");
	HowManyAdults();
	}

	
	return;
}

void HowManySeniors(void)
{
	
	DailySenior = 1.25;
	YearlySenior= 3.75;

	printf("\n");
	printf("#of Seniors:   ");
	scanf(" %f", &DailySenior); 
	printf("\n");

	if (DailySenior <= 999) 
	{
		;
	}
	else 
	{
	printf("Invalid Number Entered, please try again.");
	printf("\n\n\n");
	system("PAUSE");
	HowManySeniors();
	}

	

	return ;

}

void TotalCost(void)

{
	printf("Children total cost: %10.2f\n", DailyChild);
	printf("Adult total cost: %10.2f\n", DailyAdult);
	printf("Senior total cost: %10.2f\n", DailySenior);

	return ;

}

>I would use a different code but my instructor wants us to use printf/scanf coding specifically

Well, if you must use scanf() let's learn about it correctly, shall we?
Let's look at this function, as an example:

void GetInput(void)
{
    printf("Customer Name (First Middle Last): ");
    scanf(" %s %s %s", &customerName);
    printf("\n\n\n");
    return;
 }

scanf(" %s %s %s", &customerName);
There's not chance this is going to fly.
First: You are trying to read a string. The proper arguments for that are:
scanf( "%s", customerName ); you don't want the & operator there. & is only for integers and solo chars.
I suppose you could write something like:
scanf( "%s%s%s", first_array, second_array, third_array );
passing to it three different arrays but don't do it.
scanf() stops reading from the buffer as soon as encounters a space.
That implies that if the user enters name, middle name and last name. You code goes where many codes has gone before.
What can you do?. One way is to tell scanf how much you want to read. It is not pretty but doable.
scanf( "%[^\n]", customerName ); This statement tells scanf to read until it encounters a newline. But it leaves that newline behind in the stdin buffer.
To pick that newline we could write it like:

char newline;

scanf( "%[^\n]%c", customerName, &newline );

Don't mention to anyone I told you so. :)

Thanks alot. Not only did that help the name problem I had but it also took care of the error that I had aswell. Didn't know why I kept getting the error until you explained it. Now just to figure out this calculation problem and I'm pretty much on my way to success!

>I'm pretty much on my way to success!
I am glad of that optimism. Even when you become famous, remember that you could stop by at anytime. :)

>Now just to figure out this calculation problem
I think I know what your want to do, but I am not sure.
Perhaps this piece of code will demostrate an example of how to do it.

/*
 * HomeDepot.c
 * Shows how to match item with price.
 */
#include <stdio.h>
 
float price( const float item )
{
   int piece = 0;
   char newline;
   
   scanf( "%d%c", &piece, &newline ); /* amount of items */
   
   return item * piece;
}

int main( void )
{
   const float screw = .50;  /* this never should change */
   const float nail = .25; /* this never should change */
   float price_screws = 0.00;  /* final total price  items */
   float price_nails = 0.00;  /* final total price items */
   
   
   /* ask for nails */
   printf( " Enter amount of nails: " );
   fflush( stdout );             /* refresh the screen */

   /* get & compute the total price of nails */
   price_nails = price( nail );
   
   /* ask for screws */
   printf( "Enter amount of screws: " );
   fflush( stdout );             /* refresh the screen */

   /* get & compute the total price of screws */
   price_screws = price( screw );
   
   /* final display */
   puts( "\n\tYour total order" );
   puts( "\t================\n");
   printf( " Price for nails: %6.2f\n", price_nails );
   printf( "Price for screws: %6.2f\n", price_screws );
   printf( "     Grand total: %6.2f\n", price_nails + price_screws );

   getchar();
   return 0;
}
/* 
 my input / output.
  Enter amount of nails: 34
Enter amount of screws: 23

        Your total order
        ================

 Price for nails: $  8.50
Price for screws: $ 11.50
     Grand total: $ 20.00

*/

Thanks for the help. I was able to get the calculations in the program right. The old coding I had for it doesnt really work like it did before. Basically I'm trying to have it where the numbers I put in show an error if the number entered is greater than 999 and also show an error if it is a non number aswell. Also trying to see how I can make the information in yearly show only when I type in yearly or "Y" and the information for daily only show when I type in daily or "D". This is the current code I have atm.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>


void PrintAStarLine(void);
void GetInput(void);
void Tickets(void);


float price( const float item ){
int piece = 0;
char newline2;
scanf( "%d%c", &piece, &newline2 );
return item * piece;
}


char newline;
char customerName[30];
char tickettype[];
char TicketNumber[] = "D, d";


int main( void )
{


PrintAStarLine();


printf("            Home Aquarium Data Entry \n");
printf("\n\n");


PrintAStarLine();


GetInput();


Tickets();


const float DChild = 1.50;
float DailyChild = 0.00;


const float YChild = 5.50;
float YearlyChild = 0.00;


float TotalChild;


const float DAdult = 2.00;
float DailyAdult = 0.00;


const float YAdult = 6.50;
float YearlyAdult = 0.00;


float TotalAdult;


const float DSenior = 1.25;
float DailySenior = 0.00;


const float YSenior = 3.75;
float YearlySenior = 0.00;


float TotalSenior;



printf("#of Children for daily tickets: " );
fflush( stdout );
DailyChild = price( DChild );
printf("\n\n");


printf("#of Children for yearly tickets: " );
fflush( stdout );
YearlyChild = price( YChild );
printf("\n\n");


printf("#of Adults for daily tickets: " );
fflush( stdout );
DailyAdult = price( DAdult );
printf("\n\n");


printf("#of Adults for yearly tickets: " );
fflush( stdout );
YearlyAdult = price( YAdult );
printf("\n\n");


printf("#of Seniors for daily tickets: " );
fflush( stdout );
DailySenior = price( DSenior );
printf("\n\n");


printf("#of Seniors for yearly tickets: " );
fflush( stdout );
YearlySenior = price( YSenior );
system("pause");
printf("\n\n\n");


TotalChild = (DailyChild + YearlyChild);
TotalAdult = (DailyAdult + YearlyAdult);
TotalSenior = (DailySenior + YearlySenior);



printf( "Children Total Cost: $%6.2f\n", TotalChild );
printf("\n");
printf( "Adult Total Cost: $%6.2f\n", TotalAdult );
printf("\n");
printf( "Senior Total Cost: $%6.2f\n", TotalSenior );
printf("\n");



return 0;
}


void PrintAStarLine(void)


{


printf("**************************************************************************** \n");
printf("\n\n");


return;


}


void GetInput(void)
{


printf("Customer Name (First Middle Last):   ");
scanf( "%[^\n]%c", customerName, &newline );
printf("\n\n\n");


return;
}


void Tickets(void)
{


printf("\n\nType of ticket (Daily(D) or Yearly(Y): ");
scanf(" %s", &TicketNumber);



if(strcmp(TicketNumber,"D")==0)
{
printf("#of Children for daily tickets: " );    ;
}
else if(strcmp(TicketNumber,"d")==0)
{
;
}
else if(strcmp(TicketNumber,"Daily")==0)
{
;
}
else if(strcmp(TicketNumber,"daily")==0)
{
;
}
else if(strcmp(TicketNumber,"Y")==0)
{
;
}
else if(strcmp(TicketNumber,"y")==0)
{
;
}
else if(strcmp(TicketNumber,"Yearly")==0)
{
;
}
else if(strcmp(TicketNumber,"yearly")==0)
{
;
}
else
{
printf("\n  Incorrect Ticket Number Entered, please try again! \n");
printf("\n");
Tickets();
}
printf("\n");
return;
}

Edited 3 Years Ago by happygeek: fixed formatting

Remember these?
Last edited by Ancient Dragon : 1 Day Ago at 22:05. Reason: add code tags
Last edited by Ancient Dragon : 1 Day Ago at 05:02. Reason: add code tags -- please start using them

Or what about this
http://www.daniweb.com/forums/announcement118-3.html

Not to mention the watermark at the back of the edit window.

If all these escape your attention, then give up programming.

Next time you post your code you need to write those square brackets, or highlight all your code and click in the # symbol.

[
CODE=C] Your code inside here ...[/CODE]

Oh sorry about that guys. I will do it from now on. As far as my code goes I'm almost done with it. The last problem I have is my calculation. Its currenty messed up because I'm trying different methods by trial and error. What I'm trying to do is make it so that when a ticket is purchased for a child that is accomapanied by 2 or more adults or if accompanied by 3 or more seniors they get 10 percent off of the total purchase. If I can an example like Aia did for me earlier I think I'll be able to finish this off. Thanks again guys for the help. You've helped me more than you can imagine, because I'm learning this online so it's kind of difficult.

#include <string.h>
#include <iostream>

void PrintAStarLine(void);
void GetInput(void);
void Tickets(void);
void AskQuestion(void);



float price( const float item ){
int piece = 0;  
char newline2;
scanf( "%d%c", &piece, &newline2 ); 
return item * piece;
}


char newline;
char customerName[30];
char tickettype[];
char TicketNumber[] = "D, d";
char NumberName[10];
char Underlines[10];
char aQuestion;


int main( void )
{
	
	PrintAStarLine();

	printf("			Home Aquarium Data Entry \n");
	printf("\n\n");

	PrintAStarLine();


	GetInput();
	

	Tickets();
		

	const float DChild = 1.50;
	float DailyChild = 0.00;

	const float YChild = 5.50;
	float YearlyChild = 0.00;

	float TotalChild;

	const float DAdult = 2.00;
	float DailyAdult = 0.00;

	const float YAdult = 6.50;
	float YearlyAdult = 0.00;

	float TotalAdult;

	const float DSenior = 1.25;
	float DailySenior = 0.00;

	const float YSenior = 3.75;
	float YearlySenior = 0.00;

	float TotalSenior;


	float TotalCost;

	float LessDiscount;

	float TotalDiscount;




	

	printf("#of Children for daily tickets: " ); 
	fflush( stdout );     
	DailyChild = price( DChild );
	printf("\n\n");

	printf("#of Children for yearly tickets: " ); 
	fflush( stdout );    
	YearlyChild = price( YChild );
	printf("\n\n");

	printf("#of Adults for daily tickets: " );
	fflush( stdout );     
	DailyAdult = price( DAdult );
	printf("\n\n");

	printf("#of Adults for yearly tickets: " ); 
	fflush( stdout );    
	YearlyAdult = price( YAdult );
	printf("\n\n");

	printf("#of Seniors for daily tickets: " );
	fflush( stdout );     
	DailySenior = price( DSenior );
	printf("\n\n");

	printf("#of Seniors for yearly tickets: " ); 
	fflush( stdout );    
	YearlySenior = price( YSenior );
	system("pause"); 
	printf("\n\n\n");


	system("cls");

	PrintAStarLine();
	printf("			Home Aquarium Contract \n");
	printf("\n\n");
	PrintAStarLine();

	printf("CustomerName:  %s \n",  customerName);


	
	
	if(strcmp(TicketNumber,"D")==0)
	{
	printf("Type of ticket: Daily \n", TicketNumber);
	printf("\n\n");
	}
	else if(strcmp(TicketNumber,"d")==0)
	{
	printf("Type of ticket: Daily \n", TicketNumber);
	printf("\n\n");	
	}
	else if(strcmp(TicketNumber,"Daily")==0)
	{
	printf("Type of ticket: Daily \n", TicketNumber);
	printf("\n\n");
	}
	else if(strcmp(TicketNumber,"daily")==0)
	{
	printf("Type of ticket: Daily \n", TicketNumber);
	printf("\n\n");
	}
	else if (TicketNumber == "Y")
	{
	printf("Type of ticket: Yearly \n", TicketNumber);
	printf("\n\n");
	}
	else if(strcmp(TicketNumber,"y")==0)
	{
	printf("Type of ticket: Yearly \n", TicketNumber);
	printf("\n\n");
	}
	else if(strcmp(TicketNumber,"Yearly")==0)
	{
	printf("Type of ticket: Yearly \n", TicketNumber);
	printf("\n\n");
	}
	else if(strcmp(TicketNumber,"yearly")==0)
	{
	printf("Type of ticket: Yearly \n", TicketNumber);
	printf("\n\n");
	}




	
	if (DailyAdult >= 2)
		TotalChild = TotalCost * .10;
	else if (YearlyAdult >= 2)
		TotalChild = TotalCost * .10;
	else if (DailySenior >= 3)
		TotalChild = TotalCost * .10;
	else if (YearlySenior >=3)
		TotalChild = TotalCost * .10;
	else
		
	

	

	TotalChild = (DailyChild + YearlyChild);
	TotalAdult = (DailyAdult + YearlyAdult);
	TotalSenior = (DailySenior + YearlySenior);
	TotalCost =  (TotalAdult) + (TotalSenior) + (TotalChild);
	LessDiscount = (TotalCost);
	TotalDiscount = (TotalCost) - (LessDiscount);


	system("pause"); 
	printf("				Charge				Number	%s  \n", NumberName);
	printf("\n\n");
	printf( "Child:								$%6.2f\n", TotalChild );
	printf("\n");
	printf( "Adult:								$%6.2f\n", TotalAdult );
	printf("\n");
	printf( "Senior:								$%6.2f\n", TotalSenior );  
	printf("\n");
	printf("				=======				=======	%s  \n", Underlines);
	printf("\n\n");
	printf( "Total:								$%6.2f\n", TotalCost );
	printf("\n");
	printf( "Less Discount:							$%6.2f\n", LessDiscount );  
	printf("\n");
	printf( "Total After Discount:					   	$%6.2f\n", TotalDiscount ); 
	printf("\n");

	
	
	aQuestion = 'N';
	while ((aQuestion != 'Y') && (aQuestion != 'y'))
	AskQuestion();

	
	system("cls");

	return 0;
}

void PrintAStarLine(void)

{

	  printf("******************************************************************************** \n");
      printf("\n\n");

	  return;
	
}

void GetInput(void)
{
	


	printf("Customer Name (First Middle Last):   ");						
	scanf( "%[^\n]%c", customerName, &newline );
	printf("\n\n\n");

	return;
}

void Tickets(void)
{

	printf("\n\nType of ticket (Daily(D) or Yearly(Y): ");
	scanf(" %s", &TicketNumber); 


	if(strcmp(TicketNumber,"D")==0)
	{
	
	}
	else if(strcmp(TicketNumber,"d")==0)
	{
		;
	}
	else if(strcmp(TicketNumber,"Daily")==0)
	{
		;
	}
	else if(strcmp(TicketNumber,"daily")==0)
	{
		;
	}
	else if(strcmp(TicketNumber,"Y")==0)
	{
		;
	}
	else if(strcmp(TicketNumber,"y")==0)
	{
		;
	}
	else if(strcmp(TicketNumber,"Yearly")==0)
	{
		;
	}
	else if(strcmp(TicketNumber,"yearly")==0)
	{
		;
	}
	else
	{
	printf("\n	Incorrect Ticket Number Entered, please try again! \n");
	printf("\n");
	Tickets();
	}
	printf("\n");
	return;
}

void AskQuestion(void)
{
	printf("\n\nAre we done for the day? (Y/N)");	
	scanf(" %c", &aQuestion);											
	fflush(stdin);													

    
	return ;
}

What I'm trying to do is make it so that when a ticket is purchased for a child that is accomapanied by 2 or more adults or if accompanied by 3 or more seniors they get 10 percent off of the total purchase.

Do you realize that you only have to check if a child is accompanied by two adults to recieve the discount? I know that seniors might be another "species of their own", but they are, also, adults.

Your code is pretty hard to read, right now.
It is custumary to declare the functions after the closing bracket of main and declare the prototypes of those functions before main.
Right now you have a function at the top and the rest at the bottom.

#include <iostream>
is for C++. C should be <stdio.h>

A few lines of comments indicating what expressions do, would help you also. Specially functions.

Bonus example:

/*
 * line.c
 * Shows how to use an independent function to print a line of
 * stars and newlines.
 */
#include <stdio.h>

void PrintAStarLine( int star, int newline ); /* prototype */

int main( void )
{
   PrintAStarLine( 80, 4 );  /* give it any arguments you want */
   getchar();
   return 0;
}

/*
 * PrintAStarLine: Prints a line of star characters
 * parameters: a int for the amount of char stars, a int for amount   of newlines
 * return void.
 */
void PrintAStarLine( int star, int newline )
{
   while( star-- )
   {
      putchar( '*' );
   }
   while( newline-- )
   {
      putchar( '\n' );
   }
}

I was able to do the calculations and did the labeling of my code. I'm pretty much done with the program but still having a bit of difficulty with displaying data. The only error I have atm now is trying to get the program to display the number i entered for each ticket alongside the ticket cost. May someone be kind enough to give me a clue as to how I can do this.

/*+*+*+*+*+*+*+* Preprocessor Directives *+*+*+*+*+*+*+*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/*+*+*+*+*+*+*+* Function Prototypes *+*+*+*+*+*+*+*/

void PrintAStarLine(void);
void GetInput(void);
void Tickets(void);
void DailyTickets(void);
void YearlyTickets(void);
void NewPageDisplay(void);
void SecondPageDisplay(void);
void Calculations(void);
void AskQuestion(void);

/*+*+*+*+*+*+*+* Variables *+*+*+*+*+*+*+*/


float price( const float item ){
int piece = 0;  
char newline2;
scanf( "%d%c", &piece, &newline2 ); 
return item * piece;
}


char newline;
char customerName[30];
char tickettype[];
char TicketNumber[] = "D, d";
char NumberName[10];
char Underlines[10];
char aQuestion;
char TotalIncome[10];



const float DChild = 1.50;
float DailyChild = 0.00;
const float YChild = 5.50;
float YearlyChild = 0.00;
float TotalChild;

const float DAdult = 2.00;
float DailyAdult = 0.00;
const float YAdult = 6.50;
float YearlyAdult = 0.00;
float TotalAdult;

const float DSenior = 1.25;
float DailySenior = 0.00;
const float YSenior = 3.75;
float YearlySenior = 0.00;
float TotalSenior;


float TotalCost;

float LessDiscount;

float TotalDiscount;


/*+*+*+*+*+*+*+*^ The Main Module ^*+*+*+*+*+*+*+*/


int main( void )
{
	
	PrintAStarLine();

	printf("			Home Aquarium Data Entry \n");
	printf("\n\n");

	PrintAStarLine();


	GetInput();
	
	Tickets();
	
	Calculations();

	NewPageDisplay();

	


	aQuestion = 'N';									/* It will loop until user enter Y */
	while ((aQuestion != 'Y') && (aQuestion != 'y'))	/*sets value to go into loop the first time */

	AskQuestion();

	

	system("cls");

	SecondPageDisplay();

	return 0;
}

/*+*+*+*+*+*+*+* Avoids making the program look real plain *+*+*+*+*+*+*+*/

void PrintAStarLine(void)

{

	  printf("******************************************************************************** \n");
      printf("\n\n");

	  return;
	
}

/*+*+*+*+*+*+*+* Asks The User for their name *+*+*+*+*+*+*+*/

void GetInput(void)
{
	


	printf("Customer Name (First Middle Last):   ");						
	scanf( "%[^\n]%c", customerName, &newline );
	printf("\n\n\n");

	return;
}

/*+*+*+*+*+*+*+* Asks The User what ticket type they want *+*+*+*+*+*+*+*/

void Tickets(void)
{

	printf("\n\nType of ticket (Daily(D) or Yearly(Y): ");
	scanf(" %s", &TicketNumber); 


	if(strcmp(TicketNumber,"D")==0)
	{
	DailyTickets();
	}
	else if(strcmp(TicketNumber,"d")==0)
	{
	DailyTickets();
	}
	else if(strcmp(TicketNumber,"Daily")==0)
	{
	DailyTickets();
	}
	else if(strcmp(TicketNumber,"daily")==0)
	{
	DailyTickets();
	}
	else if(strcmp(TicketNumber,"Y")==0)
	{
	YearlyTickets();
	}
	else if(strcmp(TicketNumber,"y")==0)
	{
	YearlyTickets();
	}
	else if(strcmp(TicketNumber,"Yearly")==0)
	{
	YearlyTickets();
	}
	else if(strcmp(TicketNumber,"yearly")==0)
	{
	YearlyTickets();
	}
	else
	{
	printf("\n	Incorrect Ticket Number Entered, please try again! \n");
	printf("\n");
	Tickets();
	}
	printf("\n");
	return;
}

/*+*+*+*+*+*+*+* Allows the user to enter daily tickets *+*+*+*+*+*+*+*/

void DailyTickets(void)
{	
	printf("\n\n");
	printf("#of Children for daily tickets: " ); 
	fflush( stdout );     
	DailyChild = price( DChild );
	printf("\n\n");


	printf("#of Adults for daily tickets: " );
	fflush( stdout );     
	DailyAdult = price( DAdult );
	printf("\n\n");


	printf("#of Seniors for daily tickets: " );
	fflush( stdout );     
	DailySenior = price( DSenior );
	printf("\n\n");

	
	return;
}

/*+*+*+*+*+*+*+* Allows the user to enter yearly tickets *+*+*+*+*+*+*+*/

void YearlyTickets(void)
{
	printf("\n\n");
	printf("#of Children for yearly tickets: " ); 
	fflush( stdout );    
	YearlyChild = price( YChild );
	printf("\n\n");


	printf("#of Adults for yearly tickets: " ); 
	fflush( stdout );    
	YearlyAdult = price( YAdult );
	printf("\n\n");


	printf("#of Seniors for yearly tickets: " ); 
	fflush( stdout );    
	YearlySenior = price( YSenior );
	system("pause"); 
	printf("\n\n\n");
	
	return;
}

/*+*+*+*+*+*+*+* Displays information that the user entered *+*+*+*+*+*+*+*/

void NewPageDisplay(void)
{
	system("cls");

	PrintAStarLine();
	printf("			Home Aquarium Contract \n");
	printf("\n\n");
	PrintAStarLine();


	printf("CustomerName:  %s \n",  customerName);


	if(strcmp(TicketNumber,"D")==0)
	{
	printf("Type of ticket: Daily \n", TicketNumber);
	printf("\n\n");
	}
	else if(strcmp(TicketNumber,"d")==0)
	{
	printf("Type of ticket: Daily \n", TicketNumber);
	printf("\n\n");	
	}
	else if(strcmp(TicketNumber,"Daily")==0)
	{
	printf("Type of ticket: Daily \n", TicketNumber);
	printf("\n\n");
	}
	else if(strcmp(TicketNumber,"daily")==0)
	{
	printf("Type of ticket: Daily \n", TicketNumber);
	printf("\n\n");
	}
	else if (TicketNumber == "Y")
	{
	printf("Type of ticket: Yearly \n", TicketNumber);
	printf("\n\n");
	}
	else if(strcmp(TicketNumber,"y")==0)
	{
	printf("Type of ticket: Yearly \n", TicketNumber);
	printf("\n\n");
	}
	else if(strcmp(TicketNumber,"Yearly")==0)
	{
	printf("Type of ticket: Yearly \n", TicketNumber);
	printf("\n\n");
	}
	else if(strcmp(TicketNumber,"yearly")==0)
	{
	printf("Type of ticket: Yearly \n", TicketNumber);
	printf("\n\n");
	}


	system("pause"); 
	printf("				Charge				Number	%s  \n", NumberName);
	printf("\n\n");
	printf( "Child:								$%6.2f\n", TotalChild );
	printf("\n");
	printf( "Adult:								$%6.2f\n", TotalAdult );
	printf("\n");
	printf( "Senior:								$%6.2f\n", TotalSenior );  
	printf("\n");
	printf("				=======				=======	%s  \n", Underlines);
	printf("\n\n");
	printf( "Total:								$%6.2f\n", TotalCost );
	printf("\n");
	printf( "Less Discount:							$%6.2f\n", LessDiscount );  
	printf("\n");
	printf( "Total After Discount:					   	$%6.2f\n", TotalDiscount ); 
	printf("\n");

	return;
}

/*+*+*+*+*+*+*+* Performs Calculations *+*+*+*+*+*+*+*/

void Calculations(void)
{
		
	
	

	TotalChild = (DailyChild + YearlyChild);
	TotalAdult = (DailyAdult + YearlyAdult);
	TotalSenior = (DailySenior + YearlySenior);
	TotalCost =  (TotalAdult) + (TotalSenior) + (TotalChild);

	if (DailyAdult > 2)
		LessDiscount = TotalCost * .10;
	
	 else if (YearlyAdult > 2)
		LessDiscount = TotalCost * .10;
	
	else if (DailySenior > 3)
		LessDiscount = TotalCost * .10;

	else if (YearlySenior > 3)
		LessDiscount = TotalCost * .10;
	else
		LessDiscount = TotalCost - TotalCost;
	TotalDiscount = (TotalCost) - (LessDiscount);
	
	return;

}

/*+*+*+*+*+*+*+* Asks The User A Question *+*+*+*+*+*+*+*/

void AskQuestion(void)
{
	printf("\n\nAre we done for the day? (Y/N)");	
	scanf(" %c", &aQuestion);											
	fflush(stdin);													

    
	return;
}

/*+*+*+*+*+*+*+* Displays Final Cost to User *+*+*+*+*+*+*+*/

void SecondPageDisplay(void)
{

	system("cls");

	PrintAStarLine();
	printf("			Home Aquarium Daily Totals  \n");
	printf("\n\n");
	PrintAStarLine();

	printf("Total 								Total \nNumber								Income					%s \n", TotalIncome);

	printf("\n\n");
	printf("					Child:			$%6.2f\n",  TotalChild );
	printf("\n");
	printf( "					Adult:			$%6.2f\n", TotalAdult );
	printf("\n");
	printf( "					Senior:			$%6.2f\n", TotalSenior );  
	printf("\n");

	printf("________________________________________________________________________________%s  \n", Underlines);


	printf( "Grand Total:							$%6.2f\n", TotalCost );
	printf("\n");

	printf( "Grand Total After Discount:					$%6.2f\n", TotalDiscount ); 
	printf("\n");

	return;

}

char tickettype[];
This array needs a subscript limit inside the brackets.

To improve your code and skills I suggest you do some reading
about:
Scope. The life and range of variable declarations.
Global variables.
And the key word switch.
At some point you will have to star using pointers in the
functions to avoid all those Global variables.

Thanks for the help Aia. I got my project back and wanted to know how would I be able to display the amount of either nails or screws purchased in your program below. For it to be next to the cost of them. For example it should look something like this.

/*	
		Number		Price
Nails:		 2		$0.50
Screws:		 2 		$1.00

*/

This is the code you did earlier

/*
 * HomeDepot.c
 * Shows how to match item with price.
 */
#include <stdio.h>
 
float price( const float item )
{
   int piece = 0;
   char newline;
   
   scanf( "%d%c", &piece, &newline ); /* amount of items */
   
   return item * piece;
}

int main( void )
{
   const float screw = .50;  /* this never should change */
   const float nail = .25; /* this never should change */
   float price_screws = 0.00;  /* final total price  items */
   float price_nails = 0.00;  /* final total price items */
   
   
   /* ask for nails */
   printf( " Enter amount of nails: " );
   fflush( stdout );             /* refresh the screen */

   /* get & compute the total price of nails */
   price_nails = price( nail );
   
   /* ask for screws */
   printf( "Enter amount of screws: " );
   fflush( stdout );             /* refresh the screen */

   /* get & compute the total price of screws */
   price_screws = price( screw );
   
   /* final display */
   puts( "\n\tYour total order" );
   puts( "\t================\n");
   printf( " Price for nails: %6.2f\n", price_nails );
   printf( "Price for screws: %6.2f\n", price_screws );
   printf( "     Grand total: %6.2f\n", price_nails + price_screws );

   getchar();
   return 0;
}
/* 
 my input / output.
  Enter amount of nails: 34
Enter amount of screws: 23

        Your total order
        ================

 Price for nails: $  8.50
Price for screws: $ 11.50
     Grand total: $ 20.00

*/

>how would I be able to display the amount of either nails or screws purchased


Here's where you need some knowledge about variable scope and pointers.
First: piece is a local variable declared in the price function which it will be destroyed as soon as the function exits.
We need to keep those values obtained by the function price alive. How?. We can declare in main some variables to hold the values, and them pass those variables as pointers to the function.

Example:

/*
 * HomeDepot.c
 * Shows how to match item with price.
 */
#include <stdio.h>

/* function price has now two parameters
 * a float for the price
 * a pointer type int for the item
 * returns a float for total price times item
 */ 
float price( const float item, int *piece )
{
   char newline;
   
   scanf( "%d%c", piece, &newline ); /* amount of items */
   
   return item * (*piece); /* piece is a pointer to another variable, to access  what's in that variable you have to use the * operand to dereference it */
}

int main( void )
{
   const float screw = .50;  /* this never should change */
   const float nail = .25; /* this never should change */
   float price_screws = 0.00;  /* final total price  items */
   float price_nails = 0.00;  /* final total price items */
   /* new variables */
   int A_nails = 0;      /* amount of nails wanted */
   int A_screws = 0;     /* amount of screws requested */
   
   
   /* ask for nails */
   printf( " Enter amount of nails: " );
   fflush( stdout );             /* refresh the screen */

   /* get & compute the total price of nails */
   price_nails = price( nail, &A_nails ); /* the & is "address of" operand */
   
   /* ask for screws */
   printf( "Enter amount of screws: " );
   fflush( stdout );             /* refresh the screen */

   /* get & compute the total price of screws */
   price_screws = price( screw, &A_screws );/* Same here, the & is "address of" operand */
   
   /* final display */
   puts( "\n\tYour total order" );
   puts( "\t================\n");
   puts( "\tNumber\tPrice");
   printf("Nails:\t%5d\t%.2f\n", A_nails, price_nails );
   printf("Screws:\t%5d\t%.2f\n", A_screws, price_screws );
   printf("Grand total: %.2f\n", price_nails + price_screws );

   getchar();
   return 0;
}
/* My input/output:
Enter amount of nails: 2
Enter amount of screws: 3

        Your total order
        ================

        Number  Price
Nails:      2   0.50
Screws:     3   1.50
Grand total: 2.00
*/

Thanks Aia. I tried using the example you gave me, but came up with error messages saying "cannot convert parameter 1 from 'int *' to 'const float'". I'm still trying to make my program display the number entered by the price. Not sure what to do about it, but heres how my code is looking.

/*+*+*+*+*+*+*+* Preprocessor Directives *+*+*+*+*+*+*+*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/*+*+*+*+*+*+*+* Function Prototypes *+*+*+*+*+*+*+*/


void PrintAStarLine(void);
void GetInput(void);
void Tickets(void);
void DailyTickets(void);
void YearlyTickets(void);
void DailyPageDisplay(void);
void YearlyPageDisplay(void);
void TotalPageDisplay(void);
void DailyCalculations(void);
void YearlyCalculations(void);
void TotalCalculation(void);
void AskQuestion(void);

/*+*+*+*+*+*+*+* Variables *+*+*+*+*+*+*+*/




const float DChild = 1.50;
float DailyChild = 0.00;
int DailyChildNum = 0;

const float YChild = 5.50;
float YearlyChild = 0.00;
int YearlyChildNum = 0;


const float DAdult = 2.00;
float DailyAdult = 0.00;
int DailyAdultNum = 0;

const float YAdult = 6.50;
float YearlyAdult = 0.00;
int YearlyAdultNum = 0;

const float DSenior = 1.25;
float DailySenior = 0.00;
int DailySeniorNum = 0;

const float YSenior = 3.75;
float YearlySenior = 0.00;
int YearlySeniorNum = 0;

float DailyCost;
float YearlyCost;
float TotalCost;

float DailyDiscount;
float YearlyDiscount;
float TotalDiscount;

float TotalChild;
float TotalAdult;
float TotalSenior;

float DailyTotal;
float YearlyTotal;
float Total;

char customerName[30];
char tickettype[8];
char TicketNumber[8];
char NumberName[10];
char Underlines[10];
char aQuestion;
char TotalIncome[10];


float price( const float ticket, int *num )
{ 
char newline;

scanf( "%d%c", num, &newline ); 

return ticket * (*num);
}

/*+*+*+*+*+*+*+*^ The Main Module ^*+*+*+*+*+*+*+*/


int main( void )
{
	




	PrintAStarLine();

	printf("			Home Aquarium Data Entry \n");
	printf("\n\n");

	PrintAStarLine();

	aQuestion = 'N';									/* It will loop until user enter YES or YES */
	while ((aQuestion != 'Y') && (aQuestion != 'y'))	/*sets value to go into loop the first time */
	{
	GetInput();

	Tickets();

	AskQuestion();
	}

	system("cls");

	TotalCalculation();

	TotalPageDisplay();
	
	return 0;
}

/*+*+*+*+*+*+*+* Avoids making the program look real plain *+*+*+*+*+*+*+*/

void PrintAStarLine(void)

{

	  printf("******************************************************************************** \n");
      printf("\n\n");

	  return;
	
}


/*+*+*+*+*+*+*+* Asks The User for their name *+*+*+*+*+*+*+*/

void GetInput(void)
{
	


	printf("Customer Name:   ");						
	scanf( "%[^\n]", customerName);
	printf("\n\n\n");

	return;
}


/*+*+*+*+*+*+*+* Asks The User what ticket type they want *+*+*+*+*+*+*+*/

void Tickets(void)
{

	printf("\n\nType of ticket: ");
	scanf(" %s", &TicketNumber); 


	if(strcmp(TicketNumber,"D")==0)
	{
	DailyTickets();
	DailyCalculations();
	DailyPageDisplay();
	}
	else if(strcmp(TicketNumber,"d")==0)
	{
	DailyTickets();
	DailyCalculations();
	DailyPageDisplay();
	}
	else if(strcmp(TicketNumber,"daily")==0)
	{
	DailyTickets();
	DailyCalculations();
	DailyPageDisplay();
	}
	else if(strcmp(TicketNumber,"Daily")==0)
	{
	DailyTickets();
	DailyCalculations();
	DailyPageDisplay();
	}
	else if(strcmp(TicketNumber,"Y")==0)
	{
	YearlyTickets();
	YearlyCalculations();
	YearlyPageDisplay();
	}
	else if(strcmp(TicketNumber,"y")==0)
	{
	YearlyTickets();
	YearlyCalculations();
	YearlyPageDisplay();
	}
	else if(strcmp(TicketNumber,"Yearly")==0)
	{
	YearlyTickets();
	YearlyCalculations();
	YearlyPageDisplay();
	}
	else if(strcmp(TicketNumber,"yearly")==0)
	{
	YearlyTickets();
	YearlyCalculations();
	YearlyPageDisplay();
	}
	else
	{
	printf("\n	Incorrect Ticket Number Entered, please try again! \n");
	printf("\n");
	Tickets();
	}
	printf("\n");
	return;
}

/*+*+*+*+*+*+*+* Allows the user to enter daily tickets *+*+*+*+*+*+*+*/

void DailyTickets(void)
{	

	printf("\n\n");
	printf("#of Children: " ); 
	DailyChild = price( &DailyChildNum, DChild );
	printf("\n\n");


	printf("#of Adults: " );
	DailyAdult = price( &DailyAdultNum, DAdult );
	printf("\n\n");


	printf("#of Seniors: " );
	DailySenior = price( &DailySeniorNum, DSenior );
	printf("\n\n");

	
	return;
}

/*+*+*+*+*+*+*+* Allows the user to enter yearly tickets *+*+*+*+*+*+*+*/

void YearlyTickets(void)
{
	printf("\n\n");
	printf("#of Children: " ); 
	YearlyChild = price( &YearlyChildNum, YChild );
	printf("\n\n");


	printf("#of Adults: " ); 
	YearlyAdult = price( &YearlyAdultNum, YAdult );
	printf("\n\n");


	printf("#of Seniors: " ); 
	YearlySenior = price( &YearlySeniorNum, YSenior );
	system("pause"); 
	printf("\n\n\n");
	
	return;
}

/*+*+*+*+*+*+*+* Displays information that the user entered *+*+*+*+*+*+*+*/

void DailyPageDisplay(void)
{
	system("cls");

	PrintAStarLine();
	printf("			Home Aquarium Contract \n");
	printf("\n\n");
	PrintAStarLine();


	printf("Customer:  %s \n",  customerName);


	if(strcmp(TicketNumber,"D")==0)
	{
	printf("Type of ticket: Daily \n", TicketNumber);
	printf("\n\n");
	}
	else if(strcmp(TicketNumber,"d")==0)
	{
	printf("Type of ticket: Daily \n", TicketNumber);
	printf("\n\n");	
	}
	else if(strcmp(TicketNumber,"Daily")==0)
	{
	printf("Type of ticket: Daily \n", TicketNumber);
	printf("\n\n");
	}
	else if(strcmp(TicketNumber,"daily")==0)
	{
	printf("Type of ticket: Daily \n", TicketNumber);
	printf("\n\n");
	}
	


	system("pause"); 
	printf("				Number				Charge	%s  \n", NumberName);
	printf("\n\n");
	printf( "Child:		    %5d					$%6.2f\n", DailyChildNum, DailyChild );
	printf("\n");
	printf( "Adult:			%5d					$%6.2f\n", DailyAdultNum, DailyAdult );
	printf("\n");
	printf( "Senior:		%5d						$%6.2f\n", DailySeniorNum, DailySenior );  
	printf("\n");
	printf("				=======				=======	%s  \n", Underlines);
	printf("\n\n");
	printf( "Total:								$%6.2f\n", DailyCost );
	printf("\n");
	printf( "Less Discount:							$%6.2f\n", DailyDiscount );  
	printf("\n");
	printf( "Total After Discount:					   	$%6.2f\n", DailyTotal ); 
	printf("\n");

	return;
}

/*+*+*+*+*+*+*+* Displays information that the user entered *+*+*+*+*+*+*+*/

void YearlyPageDisplay(void)
{
	system("cls");

	PrintAStarLine();
	printf("			Home Aquarium Contract \n");
	printf("\n\n");
	PrintAStarLine();


	printf("Customer:  %s \n",  customerName);


	if (TicketNumber == "Y")
	{
	printf("Type of ticket: Yearly \n", TicketNumber);
	printf("\n\n");
	}
	else if(strcmp(TicketNumber,"y")==0)
	{
	printf("Type of ticket: Yearly \n", TicketNumber);
	printf("\n\n");
	}
	else if(strcmp(TicketNumber,"Yearly")==0)
	{
	printf("Type of ticket: Yearly \n", TicketNumber);
	printf("\n\n");
	}
	else if(strcmp(TicketNumber,"yearly")==0)
	{
	printf("Type of ticket: Yearly \n", TicketNumber);
	printf("\n\n");
	}


	system("pause"); 
	printf("				Number				Charge	%s  \n", NumberName);
	printf("\n\n");
	printf( "Child:			%5d					$%6.2f\n",  YearlyChildNum, YearlyChild );
	printf("\n");			
	printf( "Adult:			%5d					$%6.2f\n", YearlyAdultNum, YearlyAdult );
	printf("\n");
	printf( "Senior:		%5d						$%6.2f\n", YearlySeniorNum, YearlySenior );  
	printf("\n");
	printf("				=======				=======	%s  \n", Underlines);
	printf("\n\n");
	printf( "Total:								$%6.2f\n", YearlyCost );
	printf("\n");
	printf( "Less Discount:							$%6.2f\n", YearlyDiscount );  
	printf("\n");
	printf( "Total After Discount:					   	$%6.2f\n", YearlyTotal ); 
	printf("\n");

	return;
}

/*+*+*+*+*+*+*+* Performs Calculations *+*+*+*+*+*+*+*/

void DailyCalculations(void)
{
		
	
	/* Performs Daily Calculations */
  

	DailyCost =  (DailyChild) + (DailyAdult) + (DailySenior);

	if ((DailyAdult > 2) && (DailyChild > 1))
		DailyDiscount = float(DailyCost * .10);
	
	else if ((DailySenior > 3) && (DailyChild > 1))
		DailyDiscount = float(DailyCost * .10);

	else
		DailyDiscount = (DailyCost - DailyCost);
	DailyTotal = (DailyCost - DailyDiscount);

	return;
}


	

void YearlyCalculations(void)
{
	/* Performs Yearly Calculations */


	YearlyCost =  (YearlyChild) + (YearlyAdult) + (YearlySenior);
	
	if ((YearlyAdult > 2) && (YearlyChild > 1))
		YearlyDiscount = float(YearlyCost * .10);
	
	else if ((YearlySenior > 3) && (YearlyChild > 1))
		YearlyDiscount = float(YearlyCost * .10);
	else
		YearlyDiscount = (YearlyCost - YearlyCost);
	YearlyTotal = (YearlyCost - YearlyDiscount);
	
	return;

}

void TotalCalculation(void)
{
	/* Performs Yearly Calculations */

	TotalChild = (DailyChild + YearlyChild) ;
	TotalAdult = (DailyAdult + YearlyAdult);
	TotalSenior = (DailySenior + YearlySenior);
	TotalCost =  (DailyCost + YearlyCost);
	TotalDiscount = (DailyDiscount + YearlyDiscount);
	Total = (TotalCost - TotalDiscount);

}

/*+*+*+*+*+*+*+* Asks The User A Question *+*+*+*+*+*+*+*/

void AskQuestion(void)
{
	printf("\n\nAre we done for the day? (Yes/No)");	
	scanf(" %c", &aQuestion);
	fflush(stdin);	
												

    
	return;
}

/*+*+*+*+*+*+*+* Displays Final Cost to User *+*+*+*+*+*+*+*/

void TotalPageDisplay(void)
{

	system("cls");

	PrintAStarLine();
	printf("			Home Aquarium Daily Totals  \n");
	printf("\n\n");
	PrintAStarLine();

	printf("Total 								Total \nNumber								Income					%s \n", TotalIncome);

	printf("\n\n");
	printf("					Child:			$%6.2f\n",  TotalChild );
	printf("\n");
	printf( "					Adult:			$%6.2f\n", TotalAdult );
	printf("\n");
	printf( "					Senior:			$%6.2f\n", TotalSenior );  
	printf("\n");

	printf("________________________________________________________________________________%s  \n", Underlines);


	printf( "Grand Total:							$%6.2f\n", TotalCost );
	printf("\n");

	printf( "Grand Total After Discount:					$%6.2f\n", Total ); 
	printf("\n");

	return;

}

Line 68, change the scanf to use one variable per format specifier. Otherwise you program may be hosing the stack and giving you u unpredictable results

You are calling this function the wrong way. You are passing the wrong arguments.
This is how the function is declared.
float price( const float ticket, int *num );

accept first an unchangeable float that's what const means, and a pointer to an int variable. OK? Now let's take a piece of your code where you call this function.


DailyChild = price( &DailyChildNum, DChild );

use are passing &DailyChildNum as the first argument. What is it?. The address of an int.
price only accepts a const float. Can you understand? Wrong type of variable and it cannot be the address.
Let's look at the second argument: DChild.
What is it? const float DChild = 1.50; A const float. What should be there? A pointer to an int. Something like &DChild if that were an int, which is not.
It seems that you have them switched.

By the way there's not reason for that function to not be declared after main like the others and prototyped at the beginning like the others.

I lastly wanted to ask, although its not really needed, but for future purposes, how would I be able to save the input I entered. For example when the program runs and the buyer purchases a yearly ticket and then purchase a daily ticket both totals are displayed. But lets say the customer purchases 2 or more daily tickets it only shows the total for the last number entered. This is my current code.

/*+*+*+*+*+*+*+* Preprocessor Directives *+*+*+*+*+*+*+*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/*+*+*+*+*+*+*+* Function Prototypes *+*+*+*+*+*+*+*/


void PrintAStarLine(void);
void GetInput(void);
void Tickets(void);
void DailyTickets(void);
void YearlyTickets(void);
void DailyPageDisplay(void);
void YearlyPageDisplay(void);
void TotalPageDisplay(void);
void DailyCalculations(void);
void YearlyCalculations(void);
void TotalCalculation(void);
void AskQuestion(void);

/*+*+*+*+*+*+*+* Variables *+*+*+*+*+*+*+*/




const float DChild = 1.50;
float DailyChild = 0.00;
int DailyChildNum = 0;

const float YChild = 5.50;
float YearlyChild = 0.00;
int YearlyChildNum = 0;


const float DAdult = 2.00;
float DailyAdult = 0.00;
int DailyAdultNum = 0;

const float YAdult = 6.50;
float YearlyAdult = 0.00;
int YearlyAdultNum = 0;

const float DSenior = 1.25;
float DailySenior = 0.00;
int DailySeniorNum = 0;

const float YSenior = 3.75;
float YearlySenior = 0.00;
int YearlySeniorNum = 0;

float DailyCost;
float YearlyCost;
float TotalCost;

float DailyDiscount;
float YearlyDiscount;
float TotalDiscount;

float TotalChild;
float TotalAdult;
float TotalSenior;

float DailyTotal;
float YearlyTotal;
float Total;

int TotalChildNum;
int TotalAdultNum;
int TotalSeniorNum;

char customerName[30];
char tickettype[8];
char TicketNumber[8];
char NumberName[10];
char Underlines[10];
char aQuestion;
char TotalIncome[10];



float price( const float ticket, int *num )
{ 
char newline;

scanf( "%d%c", num, &newline ); 

return ticket * (*num);
}

/*+*+*+*+*+*+*+*^ The Main Module ^*+*+*+*+*+*+*+*/


int main( void )
{





    PrintAStarLine();

    printf("            Home Aquarium Data Entry \n");
    printf("\n\n");

    PrintAStarLine();

    aQuestion = 'N';                                    /* It will loop until user enter YES or YES */
    while ((aQuestion != 'Y') && (aQuestion != 'y'))    /*sets value to go into loop the first time */
    {
    GetInput();

    Tickets();

    AskQuestion();
    }

    system("cls");

    TotalCalculation();

    TotalPageDisplay();

    return 0;
}

/*+*+*+*+*+*+*+* Avoids making the program look real plain *+*+*+*+*+*+*+*/

void PrintAStarLine(void)

{

      printf("******************************************************************************** \n");
      printf("\n\n");

      return;

}


/*+*+*+*+*+*+*+* Asks The User for their name *+*+*+*+*+*+*+*/

void GetInput(void)
{



    printf("Customer Name:   ");                        
    scanf( "%[^\n]", customerName);
    printf("\n\n\n");

    return;
}


/*+*+*+*+*+*+*+* Asks The User what ticket type they want *+*+*+*+*+*+*+*/

void Tickets(void)
{

    printf("\n\nType of ticket: ");
    scanf(" %s", &TicketNumber); 


    if(strcmp(TicketNumber,"D")==0)
    {
    DailyTickets();
    DailyCalculations();
    DailyPageDisplay();
    }
    else if(strcmp(TicketNumber,"d")==0)
    {
    DailyTickets();
    DailyCalculations();
    DailyPageDisplay();
    }
    else if(strcmp(TicketNumber,"daily")==0)
    {
    DailyTickets();
    DailyCalculations();
    DailyPageDisplay();
    }
    else if(strcmp(TicketNumber,"Daily")==0)
    {
    DailyTickets();
    DailyCalculations();
    DailyPageDisplay();
    }
    else if(strcmp(TicketNumber,"Y")==0)
    {
    YearlyTickets();
    YearlyCalculations();
    YearlyPageDisplay();
    }
    else if(strcmp(TicketNumber,"y")==0)
    {
    YearlyTickets();
    YearlyCalculations();
    YearlyPageDisplay();
    }
    else if(strcmp(TicketNumber,"Yearly")==0)
    {
    YearlyTickets();
    YearlyCalculations();
    YearlyPageDisplay();
    }
    else if(strcmp(TicketNumber,"yearly")==0)
    {
    YearlyTickets();
    YearlyCalculations();
    YearlyPageDisplay();
    }
    else
    {
    printf("\n  Incorrect Ticket Number Entered, please try again! \n");
    printf("\n");
    Tickets();
    }
    printf("\n");
    return;
}

/*+*+*+*+*+*+*+* Allows the user to enter daily tickets *+*+*+*+*+*+*+*/

void DailyTickets(void)
{   

    printf("\n\n");
    printf("#of Children: " ); 
    DailyChild = price( DChild, &DailyChildNum );
    printf("\n\n");


    printf("#of Adults: " );
    DailyAdult = price( DAdult, &DailyAdultNum );
    printf("\n\n");


    printf("#of Seniors: " );
    DailySenior = price( DSenior, &DailySeniorNum );
    printf("\n\n");


    return;
}

/*+*+*+*+*+*+*+* Allows the user to enter yearly tickets *+*+*+*+*+*+*+*/

void YearlyTickets(void)
{
    printf("\n\n");
    printf("#of Children: " ); 
    YearlyChild = price( YChild, &YearlyChildNum);
    printf("\n\n");


    printf("#of Adults: " ); 
    YearlyAdult = price( YAdult, &YearlyAdultNum);
    printf("\n\n");


    printf("#of Seniors: " ); 
    YearlySenior = price( YSenior, &YearlySeniorNum);
    system("pause"); 
    printf("\n\n\n");

    return;
}

/*+*+*+*+*+*+*+* Displays information that the user entered *+*+*+*+*+*+*+*/

void DailyPageDisplay(void)
{
    system("cls");

    PrintAStarLine();
    printf("            Home Aquarium Contract \n");
    printf("\n\n");
    PrintAStarLine();


    printf("Customer:  %s \n",  customerName);


    if(strcmp(TicketNumber,"D")==0)
    {
    printf("Type of ticket: Daily \n", TicketNumber);
    printf("\n\n");
    }
    else if(strcmp(TicketNumber,"d")==0)
    {
    printf("Type of ticket: Daily \n", TicketNumber);
    printf("\n\n"); 
    }
    else if(strcmp(TicketNumber,"Daily")==0)
    {
    printf("Type of ticket: Daily \n", TicketNumber);
    printf("\n\n");
    }
    else if(strcmp(TicketNumber,"daily")==0)
    {
    printf("Type of ticket: Daily \n", TicketNumber);
    printf("\n\n");
    }



    system("pause"); 
    printf("\t\t\t\t Number\t\t\t\t Charge%s  \n", NumberName);
    printf("\n\n");
    printf( "Child:\t\t\t\t%5d\t\t\t\t$%6.2f\n", DailyChildNum, DailyChild );
    printf("\n");
    printf( "Adult:\t\t\t\t%5d\t\t\t\t$%6.2f\n", DailyAdultNum, DailyAdult );
    printf("\n");
    printf( "Senior:\t\t\t\t%5d\t\t\t\t$%6.2f\n", DailySeniorNum, DailySenior );  
    printf("\n");
    printf("                =======             ======= %s  \n", Underlines);
    printf("\n\n");
    printf( "Total:\t\t\t\t\t\t\t\t$%6.2f\n", DailyCost );
    printf("\n");
    printf( "Less Discount:\t\t\t\t\t\t\t$%6.2f\n", DailyDiscount );  
    printf("\n");
    printf( "Total After Discount:\t\t\t\t\t\t$%6.2f\n", DailyTotal ); 
    printf("\n");

    return;
}

/*+*+*+*+*+*+*+* Displays information that the user entered *+*+*+*+*+*+*+*/

void YearlyPageDisplay(void)
{
    system("cls");

    PrintAStarLine();
    printf("            Home Aquarium Contract \n");
    printf("\n\n");
    PrintAStarLine();


    printf("Customer:  %s \n",  customerName);


    if (TicketNumber == "Y")
    {
    printf("Type of ticket: Yearly \n", TicketNumber);
    printf("\n\n");
    }
    else if(strcmp(TicketNumber,"y")==0)
    {
    printf("Type of ticket: Yearly \n", TicketNumber);
    printf("\n\n");
    }
    else if(strcmp(TicketNumber,"Yearly")==0)
    {
    printf("Type of ticket: Yearly \n", TicketNumber);
    printf("\n\n");
    }
    else if(strcmp(TicketNumber,"yearly")==0)
    {
    printf("Type of ticket: Yearly \n", TicketNumber);
    printf("\n\n");
    }


    system("pause"); 
    printf("\t\t\t\t Number\t\t\t\t Charge%s  \n", NumberName);
    printf("\n\n");
    printf( "Child:\t\t\t\t%5d\t\t\t\t$%6.2f\n",  YearlyChildNum, YearlyChild );
    printf("\n");           
    printf( "Adult:\t\t\t\t%5d\t\t\t\t$%6.2f\n", YearlyAdultNum, YearlyAdult );
    printf("\n");
    printf( "Senior:\t\t\t\t%5d\t\t\t\t$%6.2f\n", YearlySeniorNum, YearlySenior );  
    printf("\n");
    printf("                =======             ======= %s  \n", Underlines);
    printf("\n\n");
    printf( "Total:\t\t\t\t\t\t\t\t$%6.2f\n", YearlyCost );
    printf("\n");
    printf( "Less Discount:\t\t\t\t\t\t\t$%6.2f\n", YearlyDiscount );  
    printf("\n");
    printf( "Total After Discount:\t\t\t\t\t\t$%6.2f\n", YearlyTotal ); 
    printf("\n");

    return;
}

/*+*+*+*+*+*+*+* Performs Calculations *+*+*+*+*+*+*+*/

void DailyCalculations(void)
{


    /* Performs Daily Calculations */


    DailyCost =  (DailyChild) + (DailyAdult) + (DailySenior);


    if ((DailyAdult > 2) && (DailyChild > 1))
        DailyDiscount = float(DailyCost * .10);

    else if ((DailySenior > 3) && (DailyChild > 1))
        DailyDiscount = float(DailyCost * .10);

    else
        DailyDiscount = (DailyCost - DailyCost);
    DailyTotal = (DailyCost - DailyDiscount);

    return;

}




void YearlyCalculations(void)
{
    /* Performs Yearly Calculations */


    YearlyCost =  (YearlyChild) + (YearlyAdult) + (YearlySenior);

    if ((YearlyAdult > 2) && (YearlyChild > 1))
        YearlyDiscount = float(YearlyCost * .10);

    else if ((YearlySenior > 3) && (YearlyChild > 1))
        YearlyDiscount = float(YearlyCost * .10);
    else
        YearlyDiscount = (YearlyCost - YearlyCost);
    YearlyTotal = (YearlyCost - YearlyDiscount);

    return;

}

void TotalCalculation(void)
{
    /* Performs Yearly Calculations */



    TotalChild = (DailyChild + YearlyChild);
    TotalAdult = (DailyAdult + YearlyAdult);
    TotalSenior = (DailySenior + YearlySenior);
    TotalCost =  (DailyCost + YearlyCost);
    TotalDiscount = (DailyDiscount + YearlyDiscount);
    Total = (TotalCost - TotalDiscount);

    TotalChildNum = DailyChildNum + YearlyChildNum;
    TotalAdultNum = DailyAdultNum + YearlyAdultNum;
    TotalSeniorNum = DailySeniorNum + YearlySeniorNum;

    return;
}


/*+*+*+*+*+*+*+* Asks The User A Question *+*+*+*+*+*+*+*/

void AskQuestion(void)
{
    printf("\n\nAre we done for the day? (Yes/No)");    
    scanf(" %c", &aQuestion);
    fflush(stdin);  



    return;
}

/*+*+*+*+*+*+*+* Displays Final Cost to User *+*+*+*+*+*+*+*/

void TotalPageDisplay(void)
{

    system("cls");

    PrintAStarLine();
    printf("            Home Aquarium Daily Totals  \n");
    printf("\n\n");
    PrintAStarLine();

    printf("Total                               Total \nNumber                              Income                  %s \n", TotalIncome);

    printf("\n\n");
    printf("%d                  Child:          $%6.2f\n",  TotalChildNum, TotalChild );
    printf("\n");
    printf( "%d                 Adult:          $%6.2f\n", TotalAdultNum, TotalAdult );
    printf("\n");
    printf( "%d                 Senior:         $%6.2f\n", TotalSeniorNum, TotalSenior );  
    printf("\n");

    printf("________________________________________________________________________________%s  \n", Underlines);


    printf( "Grand Total:                           $%6.2f\n", TotalCost );
    printf("\n");

    printf( "Grand Total After Discount:                    $%6.2f\n", Total ); 
    printf("\n");

    return;

}

Edited 3 Years Ago by diafol: fixed formatting

This question has already been answered. Start a new discussion instead.