473,698 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

have a look again

33 New Member
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 1600
rajesh6695
96 New Member
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
3740
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 created the manifest file and located it in the same folder as the exe of my program but it wont work. Can someone please look at the code from this link which I pasted into the genaral section of my code. Is this the correct area to paste the code?...
0
3943
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 version of this document can be found at: http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download
1
2033
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 you setup the asp pages so that it is easy to change the text based on where the user is connecting from? Thanks, Mike
55
4474
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 healthily w/o spending big bucks at special healthy food places and also take care of life's daily chores w/o feeling like a robot. Any time for social activites with people other than programmers? Is feeling like a robot a typical description of a...
2
1774
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 True <<<<prp.value --prp.name = allow zero length 10 <<<<<< prp.value --prp.name = Type True <<<<prp.value --prp.name = allow zero length 10 <<<<<< prp.value --prp.name = Type True <<<<prp.value --prp.name = allow zero length 4 <<<<<< prp.value...
19
2433
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; //every class may have this statement self.hello = function() {
7
3141
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 values returned are are 0,1,1 - the values should be 0,-1,-1. The positive lookahead expressiono RE=/(?=((00000)|(11111)))/ returns -1, 0, 0 respectively - this is correct
55
6221
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 C# in some way? Or maybe no, because it is similar to a global variable (with its scope restricted) which C# is dead against? Zytan
2
1335
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
3529
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
8601
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,...
0
9156
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9021
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 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...
1
8892
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,...
0
8860
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6518
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 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...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4614
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
1998
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.