Question

In: Physics

(IN C++)A special tax regulation allows an employee to set aside earnings to pay for qualified...

(IN C++)A special tax regulation allows an employee to set aside earnings to pay for qualified medical expenses and other items.   

At LocalPharm, a privately owned pharmacy, codes are assigned to each product If the code starts with an 'C', 'D', or 'H', the item is eligible for reimbursement. Otherwise, the product is not.

Write a program that inputs the records contained within a file listing LocalPharm’s inventory. Each record contains an inventory code, an item description, and a cost. Your program should output a list of all inventory items. For items that are eligible for reimbursement, the term “Qualified Expense” should appear next to the item in your output.

A sample input file might look like this:

A1010 Strawberry Shampoo 7.99 C3940 Liquid Vitamins 10.12 C9304 Diaper Rash Cream 6.58 C9854 Cleansing Wipes 4.15 D2901 Nutritional Chocolate Shake 8.00 F3743 Flashlight 6.21 F4484 Dryer Clothes 4.20 G3384 Smile Toothpaste 3.93 H1192 Bath Bench 51.53 H2324 Blood Pressure Monitor 34.61 Z3445 Rejuvenating Serum 19.74

Solutions

Expert Solution

Note: Could you plz go through this code and let me know if u need any changes in this.Thank You
=================================

// pharmacyProds.txt (Input file)

A1010 Strawberry Shampoo 7.99
C3940 Liquid Vitamins 10.12
C9304 Diaper Rash Cream 6.58
C9854 Cleansing Wipes 4.15
D2901 Nutritional Chocolate Shake 8.00
F3743 Flashlight 6.21
F4484 Dryer Clothes 4.20
G3384 Smile Toothpaste 3.93
H1192 Bath Bench 51.53
H2324 Blood Pressure Monitor 34.61
Z3445 Rejuvenating Serum 19.74

==============================

#include <fstream>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>

using namespace std;

int findSeperatorIndex(string str);
int main() {
//Declaring variables
ifstream dataIn;
string code;
int index;
string name;
double price;
string str;
dataIn.open("pharmacyProds.txt");
//checking whether the file name is valid or not
if(dataIn.fail())
{
cout<<"* File Not Found *";
return 1;
}
else
{
//Reading the data from the file
while(getline(dataIn,str))
{
index=str.find(" ");
code=str.substr(0,index);
str=str.substr(index+1,str.length()-1);
if(str.at(0)=='C' || str.at(0)=='D' || str.at(0)=='H')
{
cout<<code<<" "<<str<<" -- Qualified Expense"<<endl;
}
else
{
cout<<code<<" "<<str<<endl;
}
  
}
dataIn.close();
}

  
return 0;
}

==================================

Output:

PLEASE LIKE MY ANSWER


Related Solutions

IRAC/ILAC for annexure A PAYG Installment is an amount set aside to be used to pay...
IRAC/ILAC for annexure A PAYG Installment is an amount set aside to be used to pay tax liabilities.
Qualified pension plans offer important tax benefits. What is the special tax treatment and what qualifies...
Qualified pension plans offer important tax benefits. What is the special tax treatment and what qualifies a pension plan for these benefits? Evaluate this statement: The excess of the actual return on plan assets over the expected return decreases the employer’s pension cost.
An employee earned $4,600 in February working for an employer. Cumulative earnings of the previous pay...
An employee earned $4,600 in February working for an employer. Cumulative earnings of the previous pay periods are $4,800. The FICA tax rate for Social Security is 6.2% of the first $127,200 of earnings each calendar year and the FICA tax rate for Medicare is 1.45% of all earnings. The current FUTA tax rate is 0.6%, and the SUTA tax rate is 5.4%. Both unemployment taxes are applied to the first $7,000 of an employee’s pay. What is the amount...
An employee earned $4,600 in February working for an employer. Cumulative earnings of the previous pay...
An employee earned $4,600 in February working for an employer. Cumulative earnings of the previous pay periods are $4,800. The FICA tax rate for Social Security is 6.2% of the first $127,200 of earnings each calendar year and the FICA tax rate for Medicare is 1.45% of all earnings. The current FUTA tax rate is 0.6%, and the SUTA tax rate is 5.4%. Both unemployment taxes are applied to the first $7,000 of an employee’s pay. What is the amount...
Question 1 A pollution tax allows regulators to set the __________of pollution in a given geographic...
Question 1 A pollution tax allows regulators to set the __________of pollution in a given geographic area. 10 points    Question 2 If a government chooses a scheme of pollution control using marketable permits as a main tool to manage the environment, then the reduction in pollution __________. will take place in the firms where the cost of doing so is the least expensive should take place in every firm based on the length of time the firm has to comply...
How much will you need to have set aside to pay for 4 years of college if the freshman year cost is expected to be $70,000
How much will you need to have set aside to pay for 4 years of college if the freshman year cost is expected to be $70,000 and is expected to rise 2% annually while they attend college? Assume you can earn 4% on your funds. A. $272,025. B. $254,100. C. $264,260. D. $309,140. E. $280,000.
For each of the described pay periods, determine the taxable earnings subject to FUTA tax: NOTE:...
For each of the described pay periods, determine the taxable earnings subject to FUTA tax: NOTE: For simplicity, all calculations throughout this exercise, both intermediate and final, should be rounded to two decimal places at each calculation. A business employs two individuals, whose taxable earnings to date (prior to the current pay period) are $3,000 and $31,400. During the current pay period, these employees earn $3,300 and $1,450, respectively. Taxable earnings subject to FUTA tax:
C++ Task: Compute the weekly pay for each employee at the Wahoo Widget Company. For each...
C++ Task: Compute the weekly pay for each employee at the Wahoo Widget Company. For each employee, you will calculate the base pay according to the appropriate salary category, and then subtract taxes and deductions. Write the program in C++ only. Input: For each employee, read an employee ID (a 4-digit integer) and a salary category code (see below). Then read whatever other information might be needed to compute a net salary for that person. Because of occasional employee turn-over,...
Mutual funds a. distribute earnings to receive favorable tax treatment . b. pay federal income taxes....
Mutual funds a. distribute earnings to receive favorable tax treatment . b. pay federal income taxes. c. pay taxes only on capital gains. d. pay only state and local taxes.
Suppose you are a typical person in the U.S. economy. You pay 4 percent of your income in a state income tax and 15.3 percent of your labor earnings in federal payroll taxes (employer and employee shares combined).
2. Problems and Applications Q2Suppose you are a typical person in the U.S. economy. You pay 4 percent of your income in a state income tax and 15.3 percent of your labor earnings in federal payroll taxes (employer and employee shares combined). You also pay federal income taxes as in the following table:On Taxable Income...The Tax Rate Is...From $0 to $9,07510.0%From $9,076 to $36,90015.0%From $36,901 to $89,35025.0%From $89,351 to $186,35028.0%From $186,351 to $405,10033.0%From $405,101 to $406,75035.0%From $406,751 and above39.6%Complete the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT