can anybody help me

I have no clue on how to create an I-P-O program. an i have past the last 2 weeks trying to understand how to create one and i have 2 programs due by midnight in I-P-O form.

can someone please help me.
Last edited on
What's an I-P-O and what's an I-O-P?
my professor want me to create 2 programs that start with :

#include<iostream.h>

and both programs are due by 11:59 tonight i have spent that past 2 weeks trying to create the programs and have gotten no where.
That's the whole requirement? Two programmes and they must have that line at the top? No other requirements?
#include<iostream.h>

Yup, I was right. :-)

As for I-P-O, Google isn't really helping.
My guess is Input-Process-Output.
basically the only problem is i do not know how to set the entire thing .

i have the algorithms for both programs i just get very confused and frustrated with creating the program it self
Try something like this, then:

1
2
3
4
5
6
7
8
#include<iostream>

int main()
{

  // Your code here
  return 0;
}


Make all those changes your assessor insists on, like void main() and <iostream.h> and so on.
Last edited on
i tried that and the complier i have to use keeps giving the same error. I know how to create the programs in #include<iostream> form but when i put the programs in the other form and change the "int main" to void main i am always getting a "{"error that i do not know how to solve.
and when i look at my professors examples i get even more confused.
Last edited on
What are the errors? Can you copy and paste them here?

If your compiler refuses to compile void main() then there's not much you can do, other than go out looking for a broken compiler that will accept incorrect code. Depends on what happens if you tell your instructor he's wrong, I suppose.
Last edited on
the complier says error>> { expected


and when I put the "{" where it wants me to put it it gives me:

error>> symbols after end of program

my normal program looks like this and works perfectly

#include <iostream>
using namespace std;


int main ()

{ cout << "please choose five numbers between 1 and 1000";

int smallest, largest;
int a,b,c,d,e;
int result;
int average;
int count;
int input;
int enld;

smallest=1000;
largest=1;
result= a+b+c+d+e;
average= result/5;

while (count<5);
{ if(input<smallest)
smallest=input;
if (input>largest)
largest=input;}

result=a+b+c+d+e;

average=result/5;

cout<<smallest<<enld<<largest<<enld<<average;



return 0; }
Last edited on
And what does the code that doesn't compile look like?
it look like this:
#include <iostream.h>


void main ()

{ cout << "please choose five numbers between 1 and 1000";

int smallest, largest;
int a,b,c,d,e;
int result;
int average;
int count;
int input;
int enld;

smallest=1000;
largest=1;
result= a+b+c+d+e;
average= result/5;

while (count<5);
{ if(input<smallest)
smallest=input;
if (input>largest)
largest=input;}

result=a+b+c+d+e;

average=result/5;

cout<<smallest<<enld<<largest<<enld<<average;



return 0; }
You might be just plain out of luck. There should be no such file as iostream.h, so it's doomed from the start.

What more can we say? Your first code was correct, this second code is just plain wrong. If your instructor insists you produce wrong code, how you handle that is unfortunately not something we can help with.

Whilst I'm here, I note that you never actually put any values into input and

while (count<5);

is wrong; the semi-colon there marks the end of the while loop, so you have a while loop with nothing in it. Also, your statement implies that you want to loop something as long as count is less than 5, but you never change the value of count, so how will it ever stop?



thanks i thing that was the main error from the start because the complier that i have to use for these programs did not find any error after i deleted the semicolon after the loop.
There should be no such file as iostream.h

I'm pretty sure iostream.h should exist, but its use is deprecated.
Last edited on
do loop usually take along time?
It depends how many times you go round the loop, and how long each loop takes :)

If you suspect it's not running correctly, stick in something like:

cout << "Going round loop, count is now " << count << endl;

so that you can be sure your loop is actually looping.

Remember, if your loop will run until some condition is met (e.g. until count is 5 or more), you must do somehting in your loop to change the value of count. In your code above, your loop will run forever because you never change the value of count.
Last edited on
Topic archived. No new replies allowed.