Suppose that overSpeed and fine are double variables

Suppose that overSpeed and fine are double variables

March 9, 2022
9 Views
0
0

The number in parentheses at the end of an exercise refers to the learning objective listed at the beginning of the chapter.
Suppose that overSpeed and fine are double variables. Assign the value to fine as follows: If 0 < overSpeed <= 5; the value assigned to fine is $20.00; if 5 < overSpeed <= 10; the value assigned to fine is $75.00; 10 < overSpeed <= 15; the value assigned to fine is $150.00; if overSpeed > 15; the value assigned to fine is $150.00 plus $20.00 per mile over 15. (3)

Answer and ExplanationSolution by a verified expert

Explanation
Sample code 2:

#include

using namespace std;

int main()
{
double overSpeed=12;
double fine;

if(overSpeed>0 && overSpeed<=5) { fine=20; } else if(overSpeed>5 && overSpeed<=10) { fine=75; } else if(overSpeed>10 && overSpeed<=15) { fine=150; } else if (overSpeed>15)
{
fine=150+(20*(overSpeed-15));
}
else
{
fine=0;
cout<<"Some error"; } cout<<"Fine amount is "<

using namespace std;

int main()
{
double overSpeed=22;
double fine;

if(overSpeed>0 && overSpeed<=5) { fine=20; } else if(overSpeed>5 && overSpeed<=10) { fine=75; } else if(overSpeed>10 && overSpeed<=15) { fine=150; } else if (overSpeed>15)
{
fine=150+(20*(overSpeed-15));
}
else
{
fine=0;
cout<<"Some error"; } cout<<"Fine amount is "<

Purchase this answer to view it.
Click the button to login/signup and buy full solution at 2 USD only.

The Best Research Paper Writing Service

Would you want to pay someone to write your paper professionally from scratch? 100% Original and 0% AI Content!.

🎓 Write my Essay
📚 Write my Persuasive Essay
📋 Humanize AI Content for Turnitin
💻 Write my Reflective Essay
📑 Write my Research Paper
📜 Write my Thesis Paper
📘 Write my Dissertation
📋 Write my Case Study
📝 Write my Online Exam
✒️ Write my Term Paper
Write my Paper