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 -
/* programe to solve mr jones problem. by odo emeka */
-
-
#include <stdio.h>
-
#include <stdlib.h>
-
#include <time.h>
-
-
int main()
-
{
-
-
int i, j, nows, fixc, maxdemand, minprice, totmh, price,demand;
-
float ppst, mnh
-
srand( time(NULL) );
-
-
printf("Enter Number of workers:");
-
scanf("%d", &nows);
-
printf("Enter fixed cost:");
-
scanf("%d", &fixc);
-
if(nows>24)
-
printf("Enter Number less than or equal to 24");
-
else
-
printf("\n");
-
-
for(i=1;i<=10;i++){
-
price = 1000+rand()%2500;
-
if(price<=price++)
-
minprice=price;
-
else
-
minprice = price++;
-
-
{
-
-
for(j=1;j<=10;j++){
-
demand = 3000+rand()%5000;
-
if(demand >= demand++)
-
maxdemand = demand;
-
else
-
maxdemand = demand++;
-
if(maxdemand>=4000)
-
totmh = 48;
-
else
-
totmh = 24;
-
}
-
-
mnh= totmh/nows;
-
ppst= (fixc+minprice)/maxdemand;
-
-
printf("\n\n");
-
printf("Total number of workers in the company\n",nows);
-
printf("The fixed cost of production = \n", fixc);
-
printf("The variable cost = \n", minprice);
-
printf("The max. demand attracted by the above costs = \n", maxdemand);
-
printf("The total men hour involved in the production = \n", totmh);
-
printf("Total hourly input for each workers = \n",mnh);
-
printf("The price that will attract above max. demand = \n", ppst);
-
-
return 0;
-
-
}
-
1 1589 - #include <stdio.h>
-
#include <stdlib.h>
-
#include <time.h>
-
-
int main()
-
{
-
-
int i, j, nows, fixc, maxdemand, minprice, totmh, price,demand;
-
float ppst, mnh; //Include Semicolon to terminate the statment......
-
srand(time(NULL) );
-
-
printf("Enter Number of workers:");
-
scanf("%d", &nows);
-
printf("Enter fixed cost:");
-
scanf("%d", &fixc);
-
if(nows>24)
-
printf("Enter Number less than or equal to 24");
-
else
-
printf("\n");
-
-
for(i=1;i<=10;i++)
-
{
-
price = 1000+rand()%2500;
-
if(price<=price++)
-
minprice=price;
-
else
-
minprice = price++;
-
// { Why do you have this { open braces.....
-
-
for(j=1;j<=10;j++)
-
{
-
demand = 3000+rand()%5000;
-
if(demand >= demand++)
-
maxdemand = demand;
-
else
-
maxdemand = demand++;
-
if(maxdemand>=4000)
-
totmh = 48;
-
else
-
totmh = 24;
-
}
-
mnh= totmh/nows;
-
ppst= (fixc+minprice)/maxdemand;
-
printf("\n\n");
-
printf("Total number of workers in the company\n",nows);
-
printf("The fixed cost of production = \n", fixc);
-
printf("The variable cost = \n", minprice);
-
printf("The max. demand attracted by the above costs = \n", maxdemand);
-
printf("The total men hour involved in the production = \n", totmh);
-
printf("Total hourly input for each workers = \n",mnh);
-
printf("The price that will attract above max. demand = \n", ppst);
-
} //Included to close the for(i=1;i<=10;i++) for loop
-
return 0;
-
}
-
There are some syntax problems Where i had corrected and and added comments where ever corrected...
Please look the code it will compile now........
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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; ...
|
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...
|
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...
|
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?
|
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/
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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
|
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...
|
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,...
|
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...
|
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,...
|
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...
|
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...
| |