just a quick question. I have a school project which I have to solve the problem again as a new separate problem. Provide the tax calculation using only one line of code and without using any if/else or switch statements or using the ternary operator. I may be able to do the calculations i one line of code but I have no idea what to write if I am supposed to get rid of the conditional statements. Below is my code that I am supposed to change. My teacher is kind of picky about what we can use and what not. Also this project was given to us when we hadn't learned functions in all that. I am looking for an answer that is not too higher level, since I am new to c++. /***************************************************************
Write a program for a state that computes tax according to the rate schedule:• No tax on first $15,000 of income• 5% tax on each dollar from $15,001 to $25,000• 10% tax on each dollar over $25,000 ***************************************************************/
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
using namespace std;
int main()
{
string income2;
double income;
const double FIRSTTAX = 500;
double secondDifference;
const double FTAX = 0.05;
const double TTAX = 0.1;
cout << "Please enter the annual income: $ ";
getline (cin, income2);
stringstream (income2)>> income;
if (income == 0 || income <= 15000 )
{
cout << "No income on first 15000 " << endl;
}
else if (income > 15000 && income <= 25000)
{
income = (income - 15000)* FTAX;
cout << " Your net income " << income <<endl;
}
else if (income > 25000)
{
secondDifference = (income - 25000) * TTAX +(income - 15000- (income - 25000)) * FTAX;
cout << " Your net income " << income <<fixed<<setprecision(2) <<endl;
cout << " Your tax " << secondDifference <<fixed<<setprecision(2) << endl;
}
return 0;
}