- Apr 16, 2001
- 615
- 0
- 0
I had only one class in C++ and because of the current situation in NYC all classes have been cancelled. However, I still need to do the homework. I wrote the program and it works fine, yet, I want to make it display the answer in more detial. What I mean is. Instead of 2.17e17 I want it to be 2.9864e17. Can anyone tell me what I'm doing wrong or need to edit in order for this to work the way I want it to.
double amount_of_mass;
float e_energy_produced;
const double c = 3.00 * :
ow(10.00,8.00);
cout<< "Enter a mass <in kilograms>:";
cin >> amount_of_mass;
e_energy_produced = amount_of_mass * c * c;
// cout.setf(ios::fixed);
// cout.setf(ios::showpoint);
// cout.precision(5);
cout << "\n";
cout << amount_of_mass << " " << "kilograms of matter will release"
<< " " << (e_energy_produced) << " " << "kilojules of energy."<< endl;
return 0;
}
double amount_of_mass;
float e_energy_produced;
const double c = 3.00 * :
cout<< "Enter a mass <in kilograms>:";
cin >> amount_of_mass;
e_energy_produced = amount_of_mass * c * c;
// cout.setf(ios::fixed);
// cout.setf(ios::showpoint);
// cout.precision(5);
cout << "\n";
cout << amount_of_mass << " " << "kilograms of matter will release"
<< " " << (e_energy_produced) << " " << "kilojules of energy."<< endl;
return 0;
}