473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

the list of the errors as u requested

33
error c: ......line 3: unable to open include file 'stdio.h
error c: ....... line 4: unable to open include file 'stdlib.h'
error c: ........line 5: unable to open include file 'time.h'
error c: ........line 12: unidentified symbol 'null' in function intmain
error c:.........line 24: unidentified symbol 'price' in function intmain
error c:.........line 24: invalid indirection in function intmain
error c: .......line 25: statement missing ; in function intmain
error c: .......line 27: misplace else in function intmain
error c:........line 28: invalid indirection in function intmain
warning c: ...line 32: code has no effect in function intmain
error c: ..... line 32: for statement missing ; in function intmain
warning c:...line 45:possible use of 'minprice' before definition in function intmain
warning c:..line 45:possible use of 'maxdemand' before definition in function intmain
warning c:..line 50: possible use of 'minprice' before definition in function intmain
warning c:...line 51:possible use of 'maxdemand' before definition in function intmain
warning c:...line 52:possible use of 'totmh' before definition in function intmain
error c: .......line 53:undefined symbol 'mnh' in function intmain
error c: ........line 56: undefined symbol 'return' in function intmain
warning c:....line 56: code has no effect in function intmain
error c:.......line 56: statement missing ; in function intmain
error c: ......line 59: compound statement missing } in function intmain
error c: ...... line 60: compound statement missing } in function intmain

the above are the list of the errors. the code is as shown below again. please, i need the reply urgently.
thank u very much for the effort so far. hope u will look into my problem critically


Expand|Select|Wrap|Line Numbers
  1. /* programe to solve mr jones problem. by odo emeka*/
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <time.h>
  6.  
  7. intmain()
  8. {
  9.  
  10.     int i, j, nows, fixc, maxdemand, minprice, totmh;
  11.     float ppst, mnh;
  12.     srand (time(null) );
  13.  
  14.     printf("Enter Number of workers:");
  15.     scanf("%d", &nows);
  16.     printf("Enter fixed cost:");
  17.     scanf("%d", &fixc);
  18.         if(nows>24)
  19.             printf("Enter Number less than or equal to 24");
  20.         else
  21.             printf("\n");
  22.  
  23.     for(i=1;i<=10;i++){
  24.         price[i] = 1000+(rand()%2500)
  25.             if(price[i]<=price[i++]
  26.                 minprice=price[i];
  27.             else
  28.                 minprice = price[i++];
  29.  
  30.     {
  31.  
  32.     for(j=1,j<=10,j++){
  33.         demand[j] = 3000+(rand()%5000
  34.             if(demand[j] >= demand[j++])
  35.                 maxdemand = demand[j];
  36.             else
  37.                 maxdemand = demand[j++];
  38.                     if(maxdemand>=4000)
  39.                         totmh = 48;
  40.                     else
  41.                         totmh = 24;
  42.     }
  43.  
  44.     mnh = totmh/nows;
  45.     ppst = (fixc+minprice)/maxdemand;
  46.  
  47.     printf("\n\n");
  48.     printf("Total number of workers in the company\n",nows);
  49.     printf("The fixed cost of production = \n", fixc);
  50.     printf("The variable cost = \n", minprice);
  51.     printf("The max. demand attracted by the above costs = \n", maxdemand);
  52.     printf("The total men hour involved in the production = \n", totmh);
  53.     printf("Total hourly input for each workers = \n",Mnh,"hours");
  54.     printf("The price that will attract above max. demand = \n", ppst);
  55.  
  56.     Return 0;
  57. }

Feb 15 '07 #1
2 4946
Ganon11
3,652 Expert 2GB
error c: ......line 3: unable to open include file 'stdio.h
error c: ....... line 4: unable to open include file 'stdlib.h'
error c: ........line 5: unable to open include file 'time.h'
error c: ........line 12: unidentified symbol 'null' in function intmain
error c:.........line 24: unidentified symbol 'price' in function intmain
error c:.........line 24: invalid indirection in function intmain
error c: .......line 25: statement missing ; in function intmain
error c: .......line 27: misplace else in function intmain
error c:........line 28: invalid indirection in function intmain
warning c: ...line 32: code has no effect in function intmain
error c: ..... line 32: for statement missing ; in function intmain
warning c:...line 45:possible use of 'minprice' before definition in function intmain
warning c:..line 45:possible use of 'maxdemand' before definition in function intmain
warning c:..line 50: possible use of 'minprice' before definition in function intmain
warning c:...line 51:possible use of 'maxdemand' before definition in function intmain
warning c:...line 52:possible use of 'totmh' before definition in function intmain
error c: .......line 53:undefined symbol 'mnh' in function intmain
error c: ........line 56: undefined symbol 'return' in function intmain
warning c:....line 56: code has no effect in function intmain
error c:.......line 56: statement missing ; in function intmain
error c: ......line 59: compound statement missing } in function intmain
error c: ...... line 60: compound statement missing } in function intmain

the above are the list of the errors. the code is as shown below again. please, i need the reply urgently.
thank u very much for the effort so far. hope u will look into my problem critically


Expand|Select|Wrap|Line Numbers
  1. /* programe to solve mr jones problem. by odo emeka*/
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <time.h>
  6.  
  7. intmain()
  8. {
  9.  
  10.     int i, j, nows, fixc, maxdemand, minprice, totmh;
  11.     float ppst, mnh;
  12.     srand (time(null) );
  13.  
  14.     printf("Enter Number of workers:");
  15.     scanf("%d", &nows);
  16.     printf("Enter fixed cost:");
  17.     scanf("%d", &fixc);
  18.         if(nows>24)
  19.             printf("Enter Number less than or equal to 24");
  20.         else
  21.             printf("\n");
  22.  
  23.     for(i=1;i<=10;i++){
  24.         price[i] = 1000+(rand()%2500)
  25.             if(price[i]<=price[i++]
  26.                 minprice=price[i];
  27.             else
  28.                 minprice = price[i++];
  29.  
  30.     {
  31.  
  32.     for(j=1,j<=10,j++){
  33.         demand[j] = 3000+(rand()%5000
  34.             if(demand[j] >= demand[j++])
  35.                 maxdemand = demand[j];
  36.             else
  37.                 maxdemand = demand[j++];
  38.                     if(maxdemand>=4000)
  39.                         totmh = 48;
  40.                     else
  41.                         totmh = 24;
  42.     }
  43.  
  44.     mnh = totmh/nows;
  45.     ppst = (fixc+minprice)/maxdemand;
  46.  
  47.     printf("\n\n");
  48.     printf("Total number of workers in the company\n",nows);
  49.     printf("The fixed cost of production = \n", fixc);
  50.     printf("The variable cost = \n", minprice);
  51.     printf("The max. demand attracted by the above costs = \n", maxdemand);
  52.     printf("The total men hour involved in the production = \n", totmh);
  53.     printf("Total hourly input for each workers = \n",Mnh,"hours");
  54.     printf("The price that will attract above max. demand = \n", ppst);
  55.  
  56.     Return 0;
  57. }

I'll try to settle these errors line by line:

1) Try <cstdio.h>, or <stdio>
2) Try <cstdlib.h>, or <stdlib>
3) Try <ctime.h>, or <time>
The above errors could also be caused by trying to compile a C program in a C++ compiler - check to see that the file has a .c after it rather than a .cpp
4) null should be NULL - C is case sensitive and decided to make the NULL constant capitalized.
5) You never defined a variable named price - was this a mistyping?
6) There is a missing semicolon after the statement on line 24 - this may fix the error.
7) The if...statement is missing an end parentheses ')' after its condition.
8) The else error will be fixed by (7).
9) This open bracket '{' should be an end bracket '}' to end the for...loop.
10) This for...loop header has commas rather than semicolons separating its statements.
11) Same error as (10).
12) Because price is never defined, minprice is set to some garbage value - thus, using it in calculations will produce unexpected results.
13) This error will be fixed when the above corrections have been made.
14) and 15) repeat (12) and (13).

You have capitalized the 'return 0' statement, but 'return' is supposed to be all lowercase. Finally, the function is named intmain, but it should be int main with a space.

Try fixing all of these errors and see if you still get any errors at compilation - if so, come back with a full list, and we can work from there.
Feb 16 '07 #2
If you are using the TurboC compiler please check that the path of the directories are correct....
Feb 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: dmiller23462 | last post by:
My brain is nuked....Can anybody tell me right off the bat what is wrong with this code? Along with any glaring errors, please let me know the syntax to display a message (Response.Write would be...
12
by: Brett L. Moore | last post by:
Hi, I have had trouble determining whether the STL list.size() operation is O(1) or O(n). I know the list is a doubly-linked list, so if the size() operation begins at the head, then counts to...
3
by: Bruno G. | last post by:
Hello! Is it possible for IIS to send some sort of notification when an ASP error occurs on a page? I can see them in the web logs, but I was wondering if there was a way to receive an email...
2
by: Kelly | last post by:
I have a subform that display requisition information. One of the fields in the subform is a combo box that shows who requested the requisition. The users can change who requested the requisition...
6
by: Shaun Wilde | last post by:
I am trying to handle a 404 errors and redirect them to the correct page based on criteria I was hoping to catch the error in the global error handler and forward via Server.Transfer to the...
35
by: Thierry Loiseau | last post by:
Hello all, and Happy end year 2005 ! Well, I would like to obtain a list of all JavaScript var statement, With "for...in" perharps ? That is bellow my recent test here, but the problem is...
3
by: Kevin | last post by:
Allen, I tried creating one of the report list boxes you have on your page (http://allenbrowne.com/ser-19.html). I created the chk box, cmd button, and module (saved as EnumReports). I...
5
by: DrKen | last post by:
I asked last week about passing a popup selection back to the main window. Now comes another challenge. The drop down list (or other organization?) has over 36000 entries (it's a list of colleges...
4
by: dineshv | last post by:
I want to see if there is an alternative method for fast list traversal. The code is very simple: dict_long_lists = defaultdict(list) for long_list in dict_long_lists.itervalues() for element...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
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,...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.