Question: #include #include using namespace std; const int NUM=4; int main() { //This is for printing money in the proper format cout < < setprecision(2) <

#include #include using namespace std;

const int NUM=4;

int main() { //This is for printing money in the proper format cout << setprecision(2) << fixed;

//1. Declare two arrays one for cost and one for tax double costArray[NUM]; double taxArray[NUM]={0};

//2. Declare additional variables such as letter input, totals for cost and tax. char taxApplied; double totalCost=0.0, totalTax=0.0;

//3. Loop five times for (int i=0, i<5, i++) { //i. prompt for cost cout << "cost? ";

//ii. input the cost into the array cin >> costArray[0];

//iii. prompt for y and n cout << "tax? (y/n) ";

//iv. input the y and n cin >> taxApplied >> endl;

//v. if the letter is y, then store the tax into the tax array if (taxApplied = "y") taxArray[i]=costArray[i]*.10; }

return 0; }

Find the errors in 1 2 and 3. and fix them

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!