You are required by law to stop twenty feet away from a school bus when driving.
Answer:
Each object of this class has its own copy of GREETING
Explanation:
option c: Each object of this class has it’s own copy of GREETING
This is the only false statement. When a variable is preceded by the Static key word only one copy of that variable is created, no matter the amount of object created from the instance of that class.
option a: Each object of this class can access GREETING, this is true.
option b: The value of GREETING can’t be changed in any methods, this is true because GREETING is preceded by the keyword final.
option d: GREETING.length() = 2, this is true because the method length() is use to get the length of the string "Hi" which is 2.
option e: GREETING.toUpperCase() = "HI", this is also true because the method toUpperCase() convert all the character of "Hi" to uppercase.
Note: All these are peculiar to java programming language.
Answer:
salary=float(input("Enter salary : "))
numDependents=int(input("Enter number of dependents : "))
stateTax=salary*0.065
federalTax=salary*0.28
dependentDeduction=salary*0.025*numDependents
totalWithholding=stateTax + federalTax+ dependentDeduction
takeHomePay=salary- totalWithholding
print("State Tax :$",str(stateTax))
print("Federal Tax :$",str(federalTax))
print("Dependents:$",str(dependentDeduction))
print("Salary :$",str(salary))
print("Take-Home Pay:$",str(takeHomePay))
Explanation:
- Take the salary as input from user.
- Take number of dependents as an input from user.
- Calculate the state tax and Federal Tax. Then calculate the independent detection tax by multiplying salary with 0.025 as well as number of dependents.
- After that calculate total withholding and then calculate home pay by subtracting total withholding from salary.
- Finally print all the details.