+ 1
WHAT IS INCORRECT IN THIS CODE ?
#include <iostream> using namespace std; int main() { int canav,color,tax,clr,ttl0; canav = 40; cin>>color; clr = color * 5; ttl0 = clr + canav; tax = (10/100) * ttl0 ; int ttl = tax+canav+clr; cout<<ttl; return 0; }
1 Answer
+ 2
There's a couple things, first tax should be a float, 1.1 to be exact. The equation for sales and calculating sales tax is tax*(canav+clr). Also, your final total needs to be rounded, so you're gonna need cmath, I hope this helps