Click here to Skip to main content
16,020,378 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
/*Program Listing*/
#include<stdio.h>
#include<stdlib.h>
#include <string.h>

//Declaration of variables
int Tents,Chairs,S_tables,L_Tables;
struct items{		
	int Tents; 
	int Chairs;
	int S_Tables;
	int L_Tables;
	int No_items; 	
};

//Declaration of Functions
void order();
void Exitfunction();	

void menu ();
{
	printf("Tents $ %d" , items.Tents);
	printf("Chairs $ %d" , items .Chairs);
	printf("Smalltables $ %d" , items .S_Tables);
	printf("Largetables $ %d" items .L_Tables);
	printf ("1- make order\n");
	printf ("2- view orders\n");
	printf ("3- Exit\n");
};
	switch(items)
{
			case 1;
					No_items(); 
				break;
			case 2;	
					printf("%d items rented");
				break;
			case 3;
					printf("Exiting\n");
					Exitfunction(0);
				break;			
};

void menu ()
{
	printf("Tents $ %d" , items.Tents)
	printf("Chairs $ %d" , items .Chairs)
	printf("Smalltables $ %d" , items .S_Tables)
	printf("Largetables $ %d" items .L_Tables)                        
	printf ("1- make order\n");
	printf ("2- view orders\n");
	printf ("3- Exit\n");

	Exitfunction();
                                                                                                     
};
	
void logo();
{
	printf ("Wendell`s T.T.C\n");
	printf ("***********************\n");
}

int main()                                                                                                                     
{ 
	//calling 2 function from main       
	logo();
	menu1();    
	
	return (0);
}


What I have tried:

[Error] expected unqualified-id before '{' token
[Error] expected unqualified-id before 'switch'
In function 'void menu()':
[Error] expected primary-expression before '.' token
At global scope:
[Error] expected unqualified-id before '{' token
In function 'int main()':
[Error] 'menu1' was not declared in this scope

these are the errors
Posted
Updated 19-Apr-21 5:48am

C++
void menu (); // ***** <-- the semi-colon should not be present on this line
{
	printf("Tents $ %d" , items.Tents);
	printf("Chairs $ %d" , items .Chairs);
	printf("Smalltables $ %d" , items .S_Tables);
	printf("Largetables $ %d" items .L_Tables);
	printf ("1- make order\n");
	printf ("2- view orders\n");
	printf ("3- Exit\n");
}; // ***** <-- this line needs to be deleted
	switch(items)
{
			case 1;
					No_items();  // ***** <-- where is this function declared?
				break;
			case 2;	
					printf("%d items rented");
				break;
			case 3;
					printf("Exiting\n");
					Exitfunction(0); // ***** <-- where is this function declared?
				break;			
// ***** <-- there is a closing brace '}' missing here
}; // ***** <-- the semi-colon should not be present on this line

// ***** you already have a method called 'menu'
void menu ()
{
	printf("Tents $ %d" , items.Tents)
	printf("Chairs $ %d" , items .Chairs)
	printf("Smalltables $ %d" , items .S_Tables)
	printf("Largetables $ %d" items .L_Tables)                        
	printf ("1- make order\n");
	printf ("2- view orders\n");
	printf ("3- Exit\n");

	Exitfunction();
                                                                                                     
}; // ***** <-- the semi-colon should not be present on this line
	
void logo(); // ***** <-- the semi-colon should not be present on this line
{
	printf ("Wendell`s T.T.C\n");
	printf ("***********************\n");
}
 
Share this answer
 
Comments
CPallini 19-Apr-21 12:55pm    
5.
Please give complete error messages with line numbers.
C++
void menu (); // semicolon here is an error
{
	printf("Tents $ %d" , items.Tents);
	printf("Chairs $ %d" , items .Chairs);
	printf("Smalltables $ %d" , items .S_Tables);
	printf("Largetables $ %d" items .L_Tables);
	printf ("1- make order\n");
	printf ("2- view orders\n");
	printf ("3- Exit\n");
};  // semicolon here is not needed
...
void logo(); // semicolon here is an error
{
	printf ("Wendell`s T.T.C\n");
	printf ("***********************\n");
}
 
Share this answer
 
v2
Comments
CPallini 19-Apr-21 12:55pm    
5.
Patrice T 19-Apr-21 13:07pm    
Thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900