am writing a program to determine the best price that will attract maximum demand. first i had to generate random number to enable me determine the price and quantity demanded at the particular price.
my problem is that the program has alot of errors. can u help me debug, please!!! i need it urgently. such error include unable to load include file stdio.h and so on. the source code is as shown below - /* programe to solve mr jones problem. by odo emeka*/
-
-
#include <stdio.h>
-
#include <stdlib.h>
-
#include <time.h>
-
-
intmain()
-
{
-
-
int i, j, NOWS, FIXC, Maxdemand, Minprice, Totmh;
-
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[i] = 1000+(rand()%2500)
-
IF(price[i]<=price[i++]
-
Minprice=price[i];
-
else
-
Minprice = price[i++];
-
-
{
-
-
FOR(j=1,j<=10,j++){
-
demand[j] = 3000+(rand()%5000
-
IF(demand[j] >= demand[j++])
-
Maxdemand = demand[j];
-
else
-
Maxdemand = demand[j++];
-
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 "hours");
-
printf("The price that will attract above max. demand = \n", PPST);
-
-
Return 0
-
}
1 1500 Ganon11 3,652
Recognized Expert Specialist
Please post the exact list of errors you are receiving - it will help us immensely to find and help correct your errors.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Jeff |
last post by:
Use the MS Script Editor included free with MS Office 2002 and above,
for debugging Internet Explorer (IE).
This subject is of great interest to many JS developers, as there is no
obvious, low cost way to do sophisticated debugging in
IE6 other than to use the debugger described below, which is horribly
documented otherwise. I feel...
|
by: pauldepstein |
last post by:
I am trying to debug a program with the Bloodshed dev c++ compiler.
The program tries to use a recursive function to price financial
options.
It compiles but I get a memory violation when I run it.
When I run it through the debugger, using watch variables,
ofstream tritree_basic("tritree_basic_data.txt",
|
by: pauldepstein |
last post by:
I am debugging a program to price options which involves a recursive
function:
double node::get_equity(Parameter * const params_ptr, int x, int y,
const int rights)
This recursive function is behaving oddly. I made it print statements
into a debug file to try and capture the anomalous behaviour, and I did
capture something that to me...
|
by: Arne Garvander |
last post by:
Sometimes I get an exception in the browser and I get prompted to start
Visual Studio 2005 for debugging.
Sometimes I would like to start client side debugging on demand. How can I
do that?
--
Arne Garvander
(I program VB.Net for fun and C# to get paid.)
|
by: achintmehta |
last post by:
I am working on MontaVista Linux on a PPC board.
The compiler I am using is a gnu cross compiler cross compiler
(ppc-82xx-gcc)
The application/software that is being run, is messing up the memory
due to which a subsequent malloc fails.
When the application core is dumped I do not get any backtrace in the
code (although the application is...
| |
by: krystian |
last post by:
Hello,
I've been following the previous thread "Windows Service Starts and
Immediately Stops" and I have a similar problem.
I've been trying to get started on a windows service and have followed the
following rather well known tutorial (I also make some references to it
in this writeup):
|
by: Diez B. Roggisch |
last post by:
Hi,
I'm fiddling around with pydb. Installation and usage are fine. What I
especially like is the fact that you can attach a signal such that you drop
into debugging mode on demand.
But this is of limited use to me in situations where a server is written in
python. According to the source, pydb's debugger class Gdb extends cmd.Cmd.
It...
|
by: jwwicks |
last post by:
Introduction
This tutorial describes how to use Visual Studio to create a new C++ program, compile/run a program, resume work on an existing program and debug a program. It is aimed at the beginning CIS student who is struggling to get their programs working. I work in the computer lab at the college I'm attending and I see many students who...
|
by: jwwicks |
last post by:
C/C++ Programs and Debugging in Linux
This tutorial will give you a basic idea how to debug a program in Linux using GDB. As you are aware Visual Studio doesn’t run on Linux so you have to use some of the tools provided on the command-line. If you hate the command line tools, get over it since you’re bound to be using them at some point in your...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
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...
| |
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. ...
|
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...
|
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...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |