Name: _______Key________
Quiz 8 (Week 9) Key
CS-150, Winter '02, Dr. C. S. Tritt
double x; int y; ifstream fin; fin.open("stuff.txt"); while (fin >> x >> y) cout << "Result is: "
<< x*y << '\n'; fin.close(); |
Assume the file stuff.txt contains:
1.3 4 3.4 2 |
Answer Result is: 5.2
Result
is: 6.8
Integer answers –10
Answer: for (double x = Y;
x < Z; x = x + .5) cout << x << " ";
Attempting to increment a constant –15.