Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions