Chapter 14: Problem 6
What is wrong with the following \(\mathrm{C}++\) code? Also, provide the correct code. double balance = 25000; double intRate; catch (double x) { cout << "Negative interest rate: " << x << endl; } try { cout << "Enter the interest rate: "; cin >> intRate; cout << endl; if (intRate < 0.0) throw intRate; cout << "Interest: $" << balance * intRate / 100 << endl; }
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.