Answered step by step
Verified Expert Solution
Question
1 Approved Answer
this is c++ 11. What is an output after the following switch statement executed? int years; double primeRate; double interestRate; years = 15; primeRate =
this is c++ 11. What is an output after the following switch statement executed? int years; double primeRate; double interestRate; years = 15; primeRate = 4.5; switch (years) { case 7: interestRate = primeRate + 0.5; cout << "Interest rate is "<< interestRate << " for "<< years << " years"; break; case 15: interestRate = primeRate + 1.0; cout << "Interest rate is "<< interestRate << " for "<< years << " years"; break; case 30: interestRate = primeRate + 1.5; cout << "Interest rate is "<< interestRate << " for "<< years <<" years"; break; default: cout << "Wrong number of years"; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started