Calculate how many Btu's of heat are delivered into a house given the number of gallons of oil burned and the efficiency of the furnace.

What will be an ideal response?

```
int main()
{
const double BTU_PER_BAR= 5800000; // energy equivalent of a barrel
const int GAL_PER_BAR = 42; // gallons per barrel
int gallons; // gallons of oil burned
double efficiency; // efficiency of the oil furnace
cout << endl << "How many gallons of oil were burned?=> ";
cin >> gallons;
cout << "What is the percent efficiency of the oil furnace?=> ";
cin >> efficiency;
double heat = double(gallons) / GAL_PER_BAR * BTU_PER_BAR
* (efficiency / 100.0);
cout << endl << "There were " << heat
<< " Btu's of heat delivered to the house." << endl << endl;
return 0;
}
```

Computer Science & Information Technology

You might also like to view...

After clicking End Review you still need to save the presentation to keep the accepted revisions

Indicate whether the statement is true or false

Computer Science & Information Technology

(Knight’s Tour: Closed-Tour Test) In the Knight’s Tour, a full tour occurs when the knight makes 64 moves touching each square of the chess board once and only once. A closed tour occurs when the 64th move is one move away from the location in which the knight started the tour. Mod- ify the Knight’s Tour program you wrote in Exercise 6.24 to test for a closed tour if a full tour has

occurred. What will be an ideal response?

Computer Science & Information Technology