HW help

Hi,
Using a Dev C++ 4.9.9.2 compiler and I've got a simple problem from a hw question. Below is my source code. "wc_mt = ceral_weight/metric_ton;" at this line it appears i get an undeclared identifier error, I'm not sure how. Appreciate any help.

//Section CSC-160-500-Computer Science I: C++
//File Name:
//student: foster fox
//Homework Number:
//Description
//Last Changed:

#include<iostream>

using namespace std;
main()
{
double
ceral_weight, wc_mt;
cout <<
"What is the weight of the cereal box in ounces?";
cin >> ceral_weight;
const
double metric_ton = 35273.92
wc_mt = ceral_weight/metric_ton;
cout <<
"The weight of one box is/n";
cout << wc_mt <<endl;

cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
system(
"Pause");
return
0;
}
closed account (zb0S216C)
You're missing a semi-colon after the initialisation of metric_ton: double metric_ton = 35273.92 // <-- Here

Also, please use code-tags. When editing a post, look on the right-hand side of the edit-box and there will be a button that looks like: [<>]. Use that to get the tags.

Wazzak
Last edited on
thanks man, will do next time
Topic archived. No new replies allowed.