Will this program run?
Problem: write a c++ program that prompts the user for a cost per item, number of items purchased, and a discount rate. The program should then calculate and print the total cost, tax due, and amount due.
My program and algorithm:
//prompt the user for a cost per item
//prompt the user for number of items purchased
//prompt the user for a discount rate
//calculate the total cost, tax due, and amount due.
//print the total cost, tax due and amount due
const float salestax = 0.06;
float numberitems, costperitem, discountrate, totalcost, taxdue, amountdue, taxrate, newtotal;
totalcost = numbitems * costperitem;
newtotal = totalcost - (discountrate * totalcost)
taxdue = newtotal * taxrate
amountdue = newtotal + taxdue
cout<<"enter cost per item";
cout<<"enter number of items";
cout<<"enter discount rate";
cout<< “Your amount due is”<< amountdue