473,399 Members | 3,038 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,399 software developers and data experts.

made the corrections, still not compiling

33
i have made the corrections as u directed but still is not compiling. not reading the header files. i still think the compiler is not complete. what do u think.
i need ur help.what about sending a compiler to {removed (against site rules)}
below is the corrected code


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. int main()
  8. {
  9.  
  10.     int i, j, nows, fixc, maxdemand, minprice, totmh, price,demand;
  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.     {
  25.         price = 1000+rand()%2500;
  26.         if(price<=price++)
  27.             minprice=price;
  28.         else
  29.             minprice = price++;
  30.  
  31.  
  32.  
  33.         for(j=1;j<=10;j++)
  34.         {
  35.             demand = 3000+rand()%5000;
  36.             if(demand >= demand++)
  37.                 maxdemand = demand;
  38.             else
  39.                 maxdemand = demand++;
  40.             if(maxdemand>=4000)
  41.                 totmh = 48;
  42.             else
  43.                 totmh = 24;
  44.         }
  45.         mnh= totmh/nows;
  46.         ppst= (fixc+minprice)/maxdemand;
  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);
  54.         printf("The price that will attract above max. demand = \n", ppst);
  55.     }
  56.     return 0;
  57.  
  58. }
Feb 17 '07 #1
2 1305
r035198x
13,262 8TB
i have made the corrections as u directed but still is not compiling. not reading the header files. i still think the compiler is not complete. what do u think.
i need ur help.what about sending a compiler to {removed (against site rules)}
below is the corrected code


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. int main()
  8. {
  9.  
  10.     int i, j, nows, fixc, maxdemand, minprice, totmh, price,demand;
  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.     {
  25.         price = 1000+rand()%2500;
  26.         if(price<=price++)
  27.             minprice=price;
  28.         else
  29.             minprice = price++;
  30.  
  31.  
  32.  
  33.         for(j=1;j<=10;j++)
  34.         {
  35.             demand = 3000+rand()%5000;
  36.             if(demand >= demand++)
  37.                 maxdemand = demand;
  38.             else
  39.                 maxdemand = demand++;
  40.             if(maxdemand>=4000)
  41.                 totmh = 48;
  42.             else
  43.                 totmh = 24;
  44.         }
  45.         mnh= totmh/nows;
  46.         ppst= (fixc+minprice)/maxdemand;
  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);
  54.         printf("The price that will attract above max. demand = \n", ppst);
  55.     }
  56.     return 0;
  57.  
  58. }
What error is it giving?
Feb 17 '07 #2
horace1
1,510 Expert 1GB
I compiled your code with Tubro C V3.0, Boralnd C Builder Visual C and gcc without problems - sounds as though your compiler is broken. Try downloading DEV-C++ from
http://www.bloodshed.net/devcpp.html
it is easy to use and you don't have to create a project when implementing single file programs!
Feb 17 '07 #3

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

Similar topics

0
by: Martin Bless | last post by:
I need to access a MSSQL database (MS-Sql, not MySQL!)and would very much like to use mssql-0.09.tar.gz which is available from http://www.object-craft.com.au/projects/mssql/download.html ...
1
by: Paul | last post by:
HI! I have a script here below that I want to use in order to bet around a small bug in Firefox. function Firefoxautofix(x,y,){ parent.window.resizeBy(-1,-1) parent.window.resizeBy(+1,+1) } ...
4
by: Aaron Queenan | last post by:
When I build a C++ library to .NET using the managed C++ compiler, I get the following error message: Linking... LINK : error LNK2020: unresolved token (0A000005) _CrtDbgReport LINK : error...
26
by: Michael A. Covington | last post by:
Suppose class X has some public properties, and class Y inherits from X. Is there a way that some of the public properties of X can be private (hidden) in Y (but still usable by the methods...
2
by: Rudy Ray Moore | last post by:
Hi guys, I just upgraded to "Visual Studio .net 2003 7.1 c++" from VS6. Some things I like (proper for loop variable scoping, for example), but some other things are troubling me. One...
0
by: tommaso.gastaldi | last post by:
Hi friends I was in the need to find a "definitive" :) solution to transform a relative path such as "~/MyDir/MyFile in a full web address. In particular I needed it within web services. I...
2
by: Suman | last post by:
Happy Friday everyone!!! I am working on a windows service and a C# application and needed some help with certain functionality. Please read through my issue below. Thanks! I have a windows...
11
by: =?ISO-8859-1?Q?G=E9rard_Talbot?= | last post by:
Hello Randy and Jim, I read/glanced through comp.lang.javascript FAQ - 9.5 - 2007-01-23 and have some corrections and additions to submit. In section 4.26 --------------- ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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.