I am having trouble getting my program to run. I can't figure out where this error is...prob. something easy and i'm just to tired to find it. Anyways here is the project details and the c++ code that I have wrote is attached below since I haven't messed with the code wrap yet. If there are any suggestions on how I can make the program easier pls tell me your 2 cents.

error: 56: ) expected in function main()
I counted and couldn't find where i left a ")" off if someone would show me another way to write the formula into an easier to handle form it would be greatly appreciated as well.

Program #4

The equation of state for carbon dioxide is given by Reynolds as
****formula in word attachment*******

where ρ is the density in kg/m^3, P is the pressure in Pa, T is the temperature in K, and the constants are given below:
A1=2.2488558×10^-1 A11=1.2115286×10^-10
A2=−1.3717965×10^2 A12=1.0783386×10^-7
A3=−1.4430214×10^4 A13=4.3962336×10^-11
A4=−2.9630491×10^6 A14=−3.6505545×10^4
A5=−2.0606039×10^8 A15=1.9490511×10^7
A6=4.5554393×10^-5 A16=−2.9186718×10^9
A7=7.7042840×10^-2 A17=2.4358627×10^-2
A8=4.0602371×10^1 A18=−3.7546530×10^1
A9=4.0029509×10^-7 A19=1.1898141×10^4
A10=−3.9436077×10^-4 γ=5.0×10^-6

Write a C++ function that will calculate the pressure of superheated carbon dioxide given the density and temperature. Also write a driver program that will illustrate the use of the function for the following data points:
Case # Density (kg/m^3) Temperature (K)
1 18.5908 300
2 50.0 500
3 50.0 700
4 50.0 900

Recommended Answers

All 2 Replies

As far as I can tell, in "(a14*pow(temp,(12-14))" the ( is unclosed.
It's on the 5th line in your big calculation.

It would help if you format this big calculation a little.. it doesn't matter if there are spaces or tabs around math operations... that way it would be much easier to spot the problem.

Also... you forgot the ; after the big calculation.

My system can't read the Word attachment.
Word .doc files are virus vectors.
You might want to post the math doc in hypertext.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.