Question

C++ chapter 2 programming challenge #3 Write a program that will compute the total sales tax...

C++ chapter 2 programming challenge #3

Write a program that will compute the total sales tax on a $95 purchase. Assume the state sales tax is 4 percent, and the county sales tax is 2 percent.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code.cpp

#include <iostream>
using namespace std;
int main()
{
double totalSales = 95, totalSalesTax;
double stateSalesTax = 4, countrySalesTax = 2;
totalSalesTax = totalSales * (stateSalesTax + countrySalesTax) / 100;
cout << "Total sales tax = " << totalSalesTax << endl;

return 0;
}

\color{red}\underline{Output:}

Total sales tax 5. Process exited after 0. Press any key to continue - - - 86481 seconds with return value 0

Add a comment
Know the answer?
Add Answer to:
C++ chapter 2 programming challenge #3 Write a program that will compute the total sales tax...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a program that will compute the total sales tax on a $95 purchase. Assume the...

    Write a program that will compute the total sales tax on a $95 purchase. Assume the state sales tax is 4 percent and the county sales tax is 2 percent ... and then display the amounts for the total sales tax, state sales tax, and county sales tax. the pseudo code is: since the tax rates do not vary, we will declare them as constants: const double STATE_SALES_TAX_RATE = 0.04 //copy initialization const double CNTY_SALES_TAX_RATE(0.02) //direct initialization declare variable to...

  • Q2.     Write a program that will compute the total sales tax on a $45 purchase. Assume...

    Q2.     Write a program that will compute the total sales tax on a $45 purchase. Assume that the state sales tax is 4% and county sales tax is 2%. Declare a variable called price , of datatype double Ask the user to enter a price and the user inputs in the purchase price. Use setprecision(2) like Q1. in C++

  • In Java, write a program that will ask the user to enter the amount of a...

    In Java, write a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county sales tax. Assume the state sales tax is 4 percent and the county sales tax is 2 percent. The program should display the amount of the purchase, the state sales tax, the county sales tax, the total sales tax, and the total of the sale (which is the sum of the amount of purchase...

  • Property Tax Program -Must use C programming I attempted this program but couldn't figure what I...

    Property Tax Program -Must use C programming I attempted this program but couldn't figure what I did wrong ;( Property Tax Program Complete the following program: A retail company must file a monthly sales tax report listing the total sales for the month and the amount of state and county sales tax collected. The state sales tax rate is (4 percent and the county sales tax rate is 2 percent. Write a program that asks the user to enter the...

  • This is JAVA. Must write a short description of this program, usually a sentence or two...

    This is JAVA. Must write a short description of this program, usually a sentence or two will be sufficient. All the classes, methods and data fields should be clearly documented (commented). Write a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county sales tax. Assume the state sales tax is 4 percent and the county sales tax is 2 percent. The program should display the amount of...

  • starting out with >>> C++ EARLY OBJECTS - Chapter 15 Programming Challenge #7 Write a program...

    starting out with >>> C++ EARLY OBJECTS - Chapter 15 Programming Challenge #7 Write a program that creates two rectangular shapes and then animates them. The two shapes should start on opposite ends of the screen and then move toward each other. When they meet in the middle of the screen, each shape reverses courses and moves toward the edge of the screen. The two shapes keep oscillating and bouncing off of each other in the middle of the screen....

  • Sales Tax Write a program that will compute the sales tax of an item and the...

    Sales Tax Write a program that will compute the sales tax of an item and the total cost of the item with the sales tax. Then, print out the tax and the total cost. The input will be the cost of the item. The tax rate is 8%. Use the float registers and float values. The answer will be represented with 8 place values to the right of the decimal point - with an extraneous value in the 8th decimal...

  • It must be C++ Chapter 13 Programming Challenge 2: Employee Class. See instruction: Chapter 13 Programming...

    It must be C++ Chapter 13 Programming Challenge 2: Employee Class. See instruction: Chapter 13 Programming Challenge 2 Employee Class.pdf Program Template: // Chapter 13, Programming Challenge 2: Employee Class #include <iostream> #include <string> using namespace std; // Employee Class Declaration class Employee { private: string name; // Employee's name int idNumber; // ID number string department; // Department name string position; // Employee's position public: // TODO: Constructors // TODO: Accessors // TODO: Mutators }; // Constructor #1 Employee::Employee(string...

  • Programming: Chapter 3 Write a a program that asks the user to enter a golfer's score...

    Programming: Chapter 3 Write a a program that asks the user to enter a golfer's score for three games of golf, and then displays the average of the three scores.

  • File Encryption and Decryption chapter 9 programming exercise #3 Design and write a python program to...

    File Encryption and Decryption chapter 9 programming exercise #3 Design and write a python program to successfully complete chapter 9 programming exercise #3. File Encryption and Decryption Write a program that uses a dictionary to assign “codes” to each letter of the alphabet. For example: codes = { ‘A’ : ‘%’, ‘a’ : ‘9’, ‘B’ : ‘@’, ‘b’ : ‘#’, etc . . .} Using this example, the letter A would be assigned the symbol %, the letter a would...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT