Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Write a program in C++ that creates a class. Requirements The class will have the following private member variables: int month double sales double countytaxrate

Write a program in C++ that creates a class.

Requirements

The class will have the following private member variables:

int month

double sales

double countytaxrate = 0.04, citytaxrate = 0.02

double totalcollected, countyamt, cityamt, totaltaxamt

string monthname

The class will have the following public member functions:

Default constructor to set the member variables to 0 or an empty string, set countytaxrate and citytaxrate to their appropriate percentage shown above

inputdata users will enter the month and sales amount

convertmonth convert from an integer month number to the month name

calctax this function will calculate the county and city taxes

printSales a function to print Sales in the following format:

Month: MonthName (which will be converted from an integer number)

Total Collected $ 26572.89

Sales $ 25068.76

City Sales Tax $ 501.38

County Sales Tax $ 1002.75

Total Sales Tax $ 1504.13

Output must look like this with 2 decimal points printing and lined up

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_2

Step: 3

blur-text-image_3

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

Databases Organizing Information Digital And Information Literacy

Authors: Greg Roza

1st Edition

1448805929, 978-1448805921

More Books

Students explore these related Databases questions