Hi there! I'm new in Turbo C... uhmm our teacher gave us a project to make a program in Turbo C. Im from the Philippines, and our project is due on tuesday, februrary 13, 2007... can anyone check my program? I used Turbo C ver. 2.01
And the following errors occured:
1) 51: Declaration Syntax Error
2) 149: Return statement missing ; in function Z
3) 150: Declaration Syntax Error
Here's my program below: -
#include<stdio.h>
-
#include<conio.h>
-
#include<dos.h>
-
main()
-
{
-
int C, I, G, X, M, SD, GDP, YEAR;
-
clrscr();
-
printf("#######################################################\n");
-
printf("| |\n");
-
printf("|You are now running the program GNP Calculator-Indicator or the|\n");
-
printf("|GNPCI. This program is created to calculate the GNP of our |\n");
-
printf("|country through the use of its given data. Afterwards, the |\n");
-
printf("|GNP can then be interpreted. Moreover, the GNP acquired can be |\n");
-
printf("|converted to other currency values. Lastly, this program also |\n");
-
printf("|compares previous GNP accumulation from the previous year(s). |\n");
-
printf("| Enjoy Using This Program! |\n");
-
printf("| |\n");
-
printf("| ^_^ |\n");
-
printf("#######################################################\n");
-
printf("= =\n");
-
printf("Enter Personal Consumption data:\n");
-
scanf("%d", &C);
-
printf("Enter Capital Formation/Investment data:\n");
-
scanf("%d", &I);
-
printf("Enter Government Expenditure data:\n");
-
scanf("%d", &G);
-
printf("Enter Exports data:\n");
-
scanf("%d", &X);
-
printf("Enter Imports data:\n");
-
scanf("%d", &M);
-
printf("Enter the Statistical Discrepancy data:\n");
-
scanf("%d", &SD);
-
printf("Kindly enter the year of the data above entered:\n");
-
scanf("%d", &YEAR);
-
GDP=C+I+G+(X-M)+SD;
-
printf("The GDP of the year %d is %d", YEAR, GDP);
-
}
-
void A()
-
{
-
int GNP, GDP, NFIA, YEAR;
-
printf("You selected to continue the process.\n");
-
printf("Enter the Gross Domestic Product data:\n");
-
scanf("%d", &GDP);
-
printf("Enter the Net Factor Income from Abroad data:\n");
-
scanf("%d", &NFIA);
-
printf("Enter Year:\n");
-
scanf("%d", &YEAR);
-
GNP=GDP+NFIA;
-
printf("The GNP of our country for %d is %d", YEAR, GNP);
-
}
-
{
-
int ANSWER;
-
do{
-
printf("Do you still want to continue?\n");
-
printf("Press 1-Yes..2-No\n");
-
printf("Your answer:\n");
-
scanf("%d", &ANSWER);
-
}while(ANSWER!=2);
-
if(ANSWER==1)
-
A();
-
else
-
printf("Thanks for using this program! ^_^\n");
-
}
-
void INTERPRET()
-
{
-
int GNP;
-
printf("You decided to interpret the GNP.\n");
-
printf("Kindly enter the GNP:\n");
-
scanf("%d", GNP);
-
if(GNP<=100 000 000 000)
-
printf("Low GNP rating.");
-
else if((GNP>100 000 000 000>&&(GNP==950 000 000>>
-
printf("Average GNP rating.");
-
else
-
printf("Superior GNP rating.");
-
}
-
void PD()
-
{
-
int GNP, RATE, DOLLAR;
-
printf("You chose to convert the GNP to dollars\n");
-
printf("Enter GNP:\n");
-
scanf("%d", &GNP);
-
printf("Enter Exchange Rate:\n");
-
scanf("%d", &RATE);
-
DOLLAR= GNP*RATE;
-
printf("In dollar value, the GNP is $ %d.\n", DOLLAR);
-
}
-
void PY()
-
{
-
int GNP, RATE, YEN;
-
printf("You chose to convert the GNP to yen.\n");
-
printf("Enter GNP:\n");
-
scanf("%d", &GNP);
-
printf("Enter Exchange Rate:\n");
-
scanf("%d", &RATE);
-
YEN= GNP*RATE;
-
printf("In yen value, the GNP is Y %d.\n", YEN);
-
}
-
void PE()
-
{
-
int GNP, RATE, EURO;
-
printf("You chose to convert the GNP to euro.\n");
-
printf("Enter GNP:\n");
-
scanf("%d", &GNP);
-
printf("Enter Exchange Rate:\n");
-
scanf("%d", &RATE);
-
EURO= GNP*RATE;
-
printf("In euro value, the GNP is E %d.\n");
-
}
-
void PL()
-
{
-
int GNP, RATE, LIRA;
-
printf("You chose to convert the GNP to lira.\n");
-
printf("Enter GNP:\n");
-
scanf("%d", &GNP);
-
printf("Enter Exchange Rate:\n");
-
scanf("%d", &RATE);
-
LIRA= GNP*RATE;
-
printf("In lira value, the GNP is L %d.\n");
-
}
-
{
-
int CHOICE;
-
do {
-
printf("*******MENU..Again*******\n");
-
printf("1. GNP Interpretation\n");
-
printf("2. GNP Peso to Dollar Conversion\n");
-
printf("3. GNP Peso to Yen Conversion\n");
-
printf("4. GNP Peso to Euro Conversion\n");
-
printf("5. GNP Peso to Lira Conversion\n");
-
printf("6. I am tired. I want to exit.\n");
-
} while(CHOICE!=6)
-
if (CHOICE==1)
-
INTERPRET();
-
else if (CHOICE==2)
-
PD();
-
else if (CHOICE==3)
-
PY();
-
else if (CHOICE==4)
-
PE();
-
else if (CHOICE==5)
-
PL();
-
else
-
printf("R.I.P., Rest In Prosperity!\n");
-
}
-
printf("Can you rate my program? Just enter a number from 1-10.\n");
-
int Z(int Y)
-
{
-
return Y*10
-
}
-
{
-
int W, Y, Z;
-
printf("Your rating: (1 being the highest while 10 being the lowest)\n");
-
scanf("%d", Y);
-
W= Z(Y)
-
printf("Your rating for this program is %d.\n", W);
-
}
-
{
-
int COMMENT;
-
printf("Any comment?\n");
-
printf("Comments:\n");
-
printf("1-nice job!..2-good..3-needs improvement\n");
-
switch(COMMENT)
-
{
-
case 1: printf("Nice job! Keep it up!\n"); break;
-
case 2: printf("Good! You passed!\n"); break;
-
case 3: printf("Needs Improvement. Need more innovations.\n"); break;
-
default: printf("No comment.\n"); break;
-
} getch(); while(COMMENT!=3);
-
getch();
-
return 0;
-
}
-
Thank you in advance! i hope you could help me...
2 11239
please help....
i don't really know what the errors on my program means
Ganon11 3,652
Recognized Expert Specialist
The following errors occurred:
1) 51: Declaration Syntax Error
2) 149: Return statement missing ; in function Z
3) 150: Declaration Syntax Error - void A()
-
{
-
int GNP, GDP, NFIA, YEAR;
-
printf("You selected to continue the process.\n");
-
printf("Enter the Gross Domestic Product data:\n");
-
scanf("%d", &GDP);
-
printf("Enter the Net Factor Income from Abroad data:\n");
-
scanf("%d", &NFIA);
-
printf("Enter Year:\n");
-
scanf("%d", &YEAR);
-
GNP=GDP+NFIA;
-
printf("The GNP of our country for %d is %d", YEAR, GNP);
-
}
-
{
-
int ANSWER;
-
// ...................................................
-
-
int Z(int Y)
-
{
-
return Y*10; // Missing semicolon here
-
}
-
//.............................................
-
{
-
int W, Y, Z;
-
printf("Your rating: (1 being the highest while 10 being the lowest)\n");
-
// ...
In the first section, you simply start a set of brackets {} without a function header or inside main - they simply are there. I don't think this is allowed - consider including this section (and the last section) in int main() instead of in their own little sections.
In the middle section, you had forgotten a semicolon after return Y * 10 - thus, the compiler never recognized the return statement.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Eitan |
last post by:
Hello,
Can I debug an asp file with Microsoft Dotnet Development environment
(dotnet architecture) (or check whether the syntax is correct) ?
If so, than how can I do that - need sample, please.
Thanks :)
|
by: Gustaf Liljegren |
last post by:
I have a console program that takes one file and outputs another. The file
name is submitted as an argument as usual. I can't figure out how to have
the nice step-by-step debugging while also submitting arguments on the
command-line. That is, first run the program as the end user, submit the
argument, then get to the step-by-step debugging mode. Is there a way to do
this?
Gustaf
|
by: fiona |
last post by:
Hi all,
I have set the break point on a statement in Page_Load event but it is not
being hit. I have set the configuration of project to Debug mode and enable
ASP.Net debugging, ASP debugging and SQL Server debugging.
Could anyone help?
Thanks alot!
|
by: Meatball.Li |
last post by:
A program can be debug by administrator, but when I run the program as a user,
the vs.net 2003 tell me that I don't have the privilege to debug this web server
process.
I have modified machine.config and Temporary ASP.net Files directory as msdn
said.
Is there anything else I have to do to debug my program under user privilege?
|
by: Eitan |
last post by:
Hello,
Can I debug an asp file with Microsoft Dotnet Development environment
(dotnet architecture) (or check whether the syntax is correct) ?
If so, than how can I do that - need sample, please.
Thanks :)
| |
by: Daz01 |
last post by:
Hi all. Ive written a program and there are 2 errors that appear when I
try to compile the program. I dont know how to correct them. Any help
appreciated. Below are the errors
ERROR 1: `cout' undeclared (first use this function)
void marina::OutputList (void) {
// lists the entire list in the marina on the screen
boat * temp;
if (BoatName) {
|
by: kkk1979 |
last post by:
Hi
I have been working on an existing access 2000 project which is using the .ade.
I got a problem in results. So I tried to debug .ade, but I am not able to do that.
So every time I am making an ade from adp and then testing for results.
Is there any way to make the project use .adp instead of .ade, so that I can debug ?
Can anyone help please .....
|
by: =?Utf-8?B?YzY3NjIyOA==?= |
last post by:
I have a testing client program, the purpose is send a xml file to a server
program, and the server return another xml message. So I wrote a testing
server program the simple one and make sure the communication is fine. After
that I started to program more complicated server program, since there are
many compliation error. The client program keep displaying:
The remote server returned an invalid statuscode: #8221;500 Internal Server
Error...
|
by: RB |
last post by:
I'm using MSIexplorer v6.x browser and I keep getting script
debugging errors on line ...... at certain websites. I have set
my security to Default, and disabled Script debugging, but I
still keep getting them. Any ideas on how to fix this?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |