The Student Room Group

Programming Help..........

I need to do the following:

"A liquid is draining from a tank (with a cross sectional area of 10 m2) through a smooth vertical pipe (with a diameter of 5 cm) connected to the bottom of the tank (as in the Fluid Flow course ‘Rating’ calculation).

Write a C program to calculate the flow velocity in the pipe. The program should ask the user to specify whether the liquid is water, acetone or glycerol (see table 1 for physical properties) and to enter the length of the drain pipe. Assume a liquid depth in the tank of 2m"

Using a BORLAND COMPILER!

Can any of you guys/gals tell me how to program this task.

help is greatly appreciated.
Reply 1
Wish I could help, can't code in C, sorry! Is it only C you're allowed to use?
Reply 2
darryladie
Wish I could help, can't code in C, sorry! Is it only C you're allowed to use?


Yep, im afraid its only c and I have to use borland to program it.
Reply 3
Do you know anything about C?
Reply 4
JamieB
Do you know anything about C?


I know the basics, variables,strings, loops etc
Reply 5
Wow, this seems like a tough question! I did a bit of googling for how to work out the flow velocity, and found http://www.efunda.com/formulae/fluids/draining_tank.cfm which seems correct but doesnt take into account the visocosity not the length of the drain pipe... So i really dont know! This is a physics type thing right, I'm glad i dont take physics! I was going to right some rough pseudo code for you (since im a java programmer and not a C programmer, and fully writing it in C for you would be cheating!)
Here's my psuedo code minus any calculations :wink:
This is object orientated psuedo code with parameter passing methods :wink:


boolean correct = false
String liquid
string length
DO {

PRINT "input the type of liquid"
Take user INPUT set as as liquid
Print "input the length"
Take user INPUT set as length

If Liquid == "Water"{
water(length)
done=true
end;
}else{
If Liquid == "Acetone"{
acetone(length)
done=true
end;
}else{
If Liquid =="Glycerol"{
glycerol(length)
done=true
end;
}
else{
PRINT "that was no a valid liquid type, try again!"
PRINT "valid inputs are water, acetone and glycerol"
}
}while(done == false)



In java that would be the "main" method, and then you'd have the water, glycerol and acetone methods. Which would basically be the calculation bits.
And yup im aware that whole psuedo code is pointless :wink: and yes im aware technically its more like extremly craply written java than psuedo code :wink:

Latest

Trending

Trending