Question

Basic C++ Tax Program

Please write the PrintTax program that reads in an income value and print out its corresponding tax amount of 25% in the cuIf you could explain what code does what within the program that would be appreciated! Just starting out and even using user input is not easy for me...

0 0
Add a comment Improve this question Transcribed image text
Answer #1
#include <iostream>
#include <iomanip>   
using namespace std;

int main () {
   double income;
   
   //Reading income
   cout<<"Please enter income: ";
   cin>>income;
   
   //Making precision to 2
   cout<<fixed<<setprecision(2)<<endl;
   
   //Printing income
   cout<<"Income :$"<<(income)<<endl;
   
   //Printing tax
   cout<<"Tax: $"<<(income*0.25)<<endl;
   return 0;
}
Add a comment
Know the answer?
Add Answer to:
Basic C++ Tax Program If you could explain what code does what within the program that...
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 C program named space_to_line.c that features a while loop that continuously reads input from...

    Write a C program named space_to_line.c that features a while loop that continuously reads input from the user one character at a time and then prints that character out. The exception is that if the user inputs a space character (‘ ‘), then a newline character (‘\n’) should be printed instead. This will format the output such that every word the user inputs is on its own line. Other than changing the spaces to newlines, the output should exactly match...

  • **C# Visual Basic** You will create a program that uses an enumerator to store the days...

    **C# Visual Basic** You will create a program that uses an enumerator to store the days of the week and months of the year and then ask the user for their birthday and then print it out to the screen along with their age. Your output should look like this: Enter the day of the week you were born on (sun, mon, ect...): Enter the month you were born in (Jan, Feb, ect...): Enter the day of the month you...

  • please code in basic c++ program Write a program that uses the following formula: n (ax...

    please code in basic c++ program Write a program that uses the following formula: n (ax - ib) i=1 Your program will prompt the user for the number of iterations for the calculation. input values for n, x, a, b, and c. n must be a positive integer, but x, a, b, and c can be any real numbers. Then it will perform the calculation and output the result. Then, it will ask the user if they would like to...

  • Exercise 7: Program exercise for Basic List operations Write a complete Python program including minimal comments...

    Exercise 7: Program exercise for Basic List operations Write a complete Python program including minimal comments (ile name, your name, and problem description) that solves the following problem with the main function: Problem Specification: Write a program that reads a number of scores from the user and performs the following 1. Read scores from the user until the user enters nothing but Center > key 2. Store scores into a list for processing below 3. Find the average of the...

  • Using basic c++ write a separate code for each question. 1. Palindrome if else • Try...

    Using basic c++ write a separate code for each question. 1. Palindrome if else • Try to find if a 5 digit input number is a palindrome • Get one 5 digit number from user • Output: Enter a five-digit integer: 12345 12345 is not a palindrome Enter a five-digit integer: 34543 34543 is a palindrome 2. WiFi Diagonostics using multiple ifs PRINT: This program will help you diagnose a bad WiFi connection. 1 st level Check the below (Use...

  • Java Programming Basic and Clean Approach, Please post the answer in Text Format. Computing Tax Problem...

    Java Programming Basic and Clean Approach, Please post the answer in Text Format. Computing Tax Problem Description: The United States federal personal income tax is calculated based on filing status and taxable income. There are four filing statuses: single filers, married filing jointly, married filing separately, and head of household. The tax rates vary every year. Table 3.2 shows the rates for 2009. If you are, say, single with a taxable income of $10,000, the first $8,350 is taxed at...

  • Can you add code comments where required throughout this Python Program, Guess My Number Program, and...

    Can you add code comments where required throughout this Python Program, Guess My Number Program, and describe this program as if you were presenting it to the class. What it does and everything step by step. import random def menu(): #function for getting the user input on what he wants to do print("\n\n1. You guess the number\n2. You type a number and see if the computer can guess it\n3. Exit") while True: #using try-except for the choice will handle the...

  • Write the Code in C program. Create a random password generator that contains a user-specified number...

    Write the Code in C program. Create a random password generator that contains a user-specified number of characters. Your program should prompt the user for the desired length of the password. Length of password: To create your password, use the random number generator in the stdlib.h C library. To generate random numbers, you will need the srand() and rand() functions. srand(seed) is used to "seed" the random number generator with the given integer, seed. Prompt the user for the seed...

  • Write in C++ using emacs. Write a program that calculates the ending balance of several savings...

    Write in C++ using emacs. Write a program that calculates the ending balance of several savings accounts. The program reads information about different customers’ accounts from an input file, “accounts.txt”. Each row in the file contains account information for one customer. This includes: the account number, account type (premium, choice, or basic account), starting balance, total amount deposited, and total amount withdrawn. Your program should: - open the file and check for successful open, - then calculate the ending balance...

  • Answer in C using basic C and loops. ASSIGNMENT: Write a program that will display how...

    Answer in C using basic C and loops. ASSIGNMENT: Write a program that will display how many times a ball will bounce until its height is less than 1 inch. A ball has a property called the coefficient of restitution, a number between 0.0 and 1.0, that indicates how 'bouncy' the ball is. A coefficient of restitution of .5 means that the ball will bounce-up 50% of its initial height after each bounce Write a program to ask the user...

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