Answer:
TAX_RATE = 0.20
STANDART_DEDUCTION = 10000.0
DEPENDENT_DEDUCTION = 3000.0
gross_income = float(input("Enter the gross income: "))
number_of_dependents = int(input("Enter the number of dependents: "))
income = gross_income - STANDART_DEDUCTION - (DEPENDENT_DEDUCTION * number_of_dependents)
tax = income * TAX_RATE
print ("The income tax is $" + str(round(tax, 2)))
Explanation:
Define the <em>constants</em>
Ask user to enter the <em>gross income</em> and <em>number of dependents</em>
Calculate the <em>income</em> using formula (income = gross_income - STANDART_DEDUCTION - (DEPENDENT_DEDUCTION * number_of_dependents))
Calculate the <em>tax</em>
Print the <em>tax</em>
<em />
round(number, number of digits) -> This is the general usage of the <em>round</em> function in Python.
Since we need <u>two digits of precision</u>, we need to modify the program as str(<u>round(incomeTax, 2</u>)).
Answer:
Visual Basic for Applications runs as an internal programming language in Microsoft Office applications such as Access, Excel, PowerPoint, Publisher, Word, and Visio. VBA allows users to customize beyond what is normally available with MS Office host applications by manipulating graphical-user-interface (GUI) features such as toolbars and menus, dialogue boxes, and forms. You may use VBA to create user-defined functions (UDFs), access Windows application programming interfaces (APIs), and automate specific computer processes and calculations. Macros can automate just about any task—like generating customized charts and reports, and performing word- and data-processing functions. Programmers,like replicating large pieces of code, merging existing program functions, and designing specific languages. VBA can also work in non-Microsoft settings by using a technology called "COM interface," which allows commands to interact across computer boundaries. Many firms have implemented VBA within their own applications, both proprietary and commercial, including AutoCAD, ArcGIS, CATIA, Corel, raw, and SolidWorks.
<em>(Hope this helps/makes sense!)</em>
Let me re-write the proposition:
p↔q⊕(¬p↔¬r)∧¬q.
Generally, the number of rows in a truth table depends on the number of Variables. Here we have 3 Variables: p,q and r. Each of them can have either the value of 1 or 0, which gives us 2*2*2 possibilities, or 2³, that is 8 possibilities and 8 rows:
p=0, q=0, r=0
p=0, q=0, r=1
p=0, q=1, r=0
p=0, q=1, r=1
p=1, q=0, r=0
p=1, q=0, r=1
p=1, q=1, r=0
p=1, q=1, r=1