473,396 Members | 1,748 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,396 software developers and data experts.

have a look again

33
I HV DONE ALL THE CORRECTIONS. IS ONLY THE HEADER FILE ERRORS THAT ARE STILL REMAINING.I GUESS IS FROM COMPILER, I HV DONE ALL U SAID I SHOULD DO WITH HEATHER FILE BUT STILL IS NOT WORKING.MAY BE MY COMPILE IS NOT COMPELET. PLS IF U HAVE ONE CAN U SENT TO MY MAIL BOX odohemeka@yahoo.com. BELOW IS THE CODE AGAIN

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.         price = 1000+rand()%2500;
  25.             if(price<=price++)
  26.                 minprice=price;
  27.             else
  28.                 minprice = price++;
  29.  
  30.     {
  31.  
  32.     for(j=1;j<=10;j++){
  33.         demand = 3000+rand()%5000;
  34.             if(demand >= demand++)
  35.                 maxdemand = demand;
  36.             else
  37.                 maxdemand = demand++;
  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);
  54.     printf("The price that will attract above max. demand = \n", ppst);
  55.  
  56.     return 0;
  57.  
  58. }
  59.  
Feb 16 '07 #1
1 1589
Expand|Select|Wrap|Line Numbers
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. int main()
  6. {
  7.  
  8.     int i, j, nows, fixc, maxdemand, minprice, totmh, price,demand;
  9.     float ppst, mnh;  //Include Semicolon to terminate the statment......
  10.     srand(time(NULL) );
  11.  
  12.     printf("Enter Number of workers:");
  13.     scanf("%d", &nows);
  14.     printf("Enter fixed cost:");
  15.     scanf("%d", &fixc);
  16.     if(nows>24)
  17.         printf("Enter Number less than or equal to 24");
  18.     else
  19.     printf("\n");
  20.  
  21.     for(i=1;i<=10;i++)
  22.     {
  23.         price = 1000+rand()%2500;
  24.         if(price<=price++)
  25.             minprice=price;
  26.         else
  27.             minprice = price++;
  28. //            {            Why do you have this { open braces.....
  29.  
  30.         for(j=1;j<=10;j++)
  31.         {
  32.             demand = 3000+rand()%5000;
  33.             if(demand >= demand++)
  34.                 maxdemand = demand;
  35.             else
  36.                 maxdemand = demand++;
  37.             if(maxdemand>=4000)
  38.                 totmh = 48;
  39.             else
  40.                 totmh = 24;
  41.         }
  42.         mnh= totmh/nows;
  43.         ppst= (fixc+minprice)/maxdemand;
  44.         printf("\n\n");
  45.         printf("Total number of workers in the company\n",nows);
  46.         printf("The fixed cost of production = \n", fixc);
  47.         printf("The variable cost = \n", minprice);
  48.         printf("The max. demand attracted by the above costs = \n", maxdemand);
  49.         printf("The total men hour involved in the production = \n", totmh);
  50.         printf("Total hourly input for each workers = \n",mnh);
  51.         printf("The price that will attract above max. demand = \n", ppst);
  52.     }   //Included to close the  for(i=1;i<=10;i++) for loop
  53.     return 0;
  54. }
  55.  
There are some syntax problems Where i had corrected and and added comments where ever corrected...
Please look the code it will compile now........
Feb 16 '07 #2

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

Similar topics

1
by: Roy Riddex | last post by:
I'm trying to apply the XP look to a small VB6 program by using info from: http://www.vbaccelerator.com/home/VB/Code/Libraries/XP_Visual_Styles/Using_XP_Visual_Styles_in_VB/article.asp I've...
0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
1
by: mike | last post by:
Hello all, any advice or links to pages about how to have multiple language asp pages? For example, you have a database driven website that you want customers around the world to use. How do...
55
by: amanda992004 | last post by:
Excluding the factors of the brain capability, i.e I am not asking about this factor, if you are a single, aside from enjoying coding or debugging, how do you make time to eat properly, i.e...
2
by: sparks | last post by:
I was going to loop thru the tables and change some properties. 10 <<<<<< prp.value --prp.name = Type False <<<<prp.value --prp.name = allow zero length 10 <<<<<< prp.value --prp.name = Type...
19
by: zzw8206262001 | last post by:
Hi,I find a way to make javescript more like c++ or pyhon There is the sample code: function Father(self) //every contructor may have "self" argument { self=self?self:this; ...
7
by: intrader | last post by:
The regular expression is /(?!((00000)|(11111)))/ in oRe. That is oRE=/(?!((00000)|(11111)))/ The test strings are 92708, 00000, 11111 in checkStr The expression used is checkStr.search(oRE). The...
55
by: Zytan | last post by:
I see that static is more restricted in C# than in C++. It appears usable only on classes and methods, and data members, but cannot be created within a method itself. Surely this is possible in...
2
by: AAaron123 | last post by:
You can use RadioButtonRenderer to make a button look like a radio button. Is there a similar way to make check boxes look like radio check boxes? Same about menu items?
1
by: srinivasan srinivas | last post by:
Thanks, Srini Bollywood, fun, friendship, sports and more. You name it, we have it on http://in.promos.yahoo.com/groups/bestofyahoo/
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
marktang
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,...
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
jinu1996
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...
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...

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.