Question

In: Computer Science

Post a Python program that accepts at least three values as input, performs some computation and...

Post a Python program that accepts at least three values as input, performs some computation and displays at least two values as the result. The program must include an if statement that performs different computations based on the value of one of the inputs. Include comments in your program that describe what the program does. Also post a screen shot of executing your program on at least two test cases.

I would like to build a code along with these guidelines

Enter the area to tile: 30 Enter tile price ($ / sq. foot):

Would you like to include installation?

Yes Enter installation price ($ / sq. foot):

Your estimates: Tile cost: $300.00 Installation cost: $50.00 Total: $350.00

Solutions

Expert Solution

This program calculates annual expenses of a family by asking 
  • Monthly  groceries amount
  • Amount spent of fruits and vegitables
  • Shopping cost
  • and 20% of annual cost is required for electricity , mobile recharge etc.

*********************************************

Python program :

#This program calculates annual expenses of a family
# by calculating monthly expenses
#asking user monthy amount spent on groceries
groceriesAmount=float(input("Enter monthly groceries amount : "))
#asking user monthly amount spent on vegitables and fruits
vegitablesFruitCost=float(input("Enter monthly amount on fruits and vegitables : "))
#asking user amount spent on shopping
shoppingCost=float(input("Enter amount spent on shopping : "))
#calculate total cost for month
monthlyCost=groceriesAmount+vegitablesFruitCost+shoppingCost
#calculate annual cost by multiplying 12
annualCost=monthlyCost*12
#calculate fixed cost per year as 20% of annualCost
fixedCost=annualCost*0.20
#find total cost by adding fixedCost
annual=annualCost+fixedCost
#print details
print("Monthly cost : $"+str(monthlyCost)) #print monthly cost
print("Annual cost : $"+str(annualCost)) #print annual cost
print("Fixed cost of 20% of annual cost : $"+str(fixedCost)) #print fixed cost
print("Total Cost : $"+str(annual)) #print annual total
********************************************

Please refer to the screenshot of the code to understand the indentation of the code :

===========================================

Output :

Screen showing details :

​​​​​​​


Related Solutions

Post a Python program that accepts at least three values as input, performs some computation and...
Post a Python program that accepts at least three values as input, performs some computation and displays at least two values as the result. The program must include an if statement that performs different computations based on the value of one of the inputs. Include comments in your program that describe what the program does. Also post a screen shot of executing your program on at least two test cases.
Post a Python program that accepts at least three values as input, performs some computation, and...
Post a Python program that accepts at least three values as input, performs some computation, and displays at least two values as the result. The program must include an if statement that performs different computations based on the value of one of the inputs. Include comments in your program that describe what the program does. I would like to see a program that is simple like BMI calculator or any other program that can be used in a real-life situation...
Post a Python program that contains an array variable whose values are input by the user....
Post a Python program that contains an array variable whose values are input by the user. It should the perform some modification to each element of array using a loop and then the modified array should be displayed. Include comments in your program that describe what the program does. Also post a screen shot of executing your program on at least one test case.
PYTHON Write a program that accepts a range of input from the user and checks whether...
PYTHON Write a program that accepts a range of input from the user and checks whether the input data is sorted or not. If the data series is already sorted your program should print “True” or should print “False” otherwise. You should not use any sort function for this program. Input: How many numbers you want to input: 3 # user input 3 Input the number: 5 Input the number: 2 Input the number: 7 Output: False
Design a Python script that accepts as input a user-provided list and transforms it into a...
Design a Python script that accepts as input a user-provided list and transforms it into a different list in preparation for data analysis, the transformed list replaces each numeric element in the original list with its base-10 order of magnitude and replaces string elements with blanks. Example: This script accepts as input a user-provided list expected to contain non-zero numbers and strings. It then prints a transformed list replacing numbers with their order of magnitude, and strings as blanks. Type...
PYTHON Write a python program that encrypts and decrypts the user input. Note – Your input...
PYTHON Write a python program that encrypts and decrypts the user input. Note – Your input should be only lowercase characters with no spaces. Your program should have a secret distance given by the user that will be used for encryption/decryption. Each character of the user’s input should be offset by the distance value given by the user For Encryption Process: Take the string and reverse the string. Encrypt the reverse string with each character replaced with distance value (x)...
Write a program that accepts a string and character as input, then counts and displays the...
Write a program that accepts a string and character as input, then counts and displays the number of times that character appears (in upper- or lowercase) in the string. Use C++ Enter a string: mallet Enter a character: a "A" appears 1 time(s) Enter a string: Racecar Enter a character: R "R" appears 2 time(s)
Write a complete MiniMIPS program that accepts a seqeunce of integers at input and after the...
Write a complete MiniMIPS program that accepts a seqeunce of integers at input and after the receipt of each new input value, displays the largest and smallest integers thus far. An input of 0 indicates the end of input values and is not an input value itself. Note that you do not need to keep all integers in memory.
In python, write a function, called ThreeSum, that accepts a list of non-negative numbers as input,...
In python, write a function, called ThreeSum, that accepts a list of non-negative numbers as input, and returns the highest sum of three neighboring elements in it. Write a main method that initializes the following five lists, gets the ThreeSum result for all of them using the above function, and prints the result to the screen. Example of the output: List 1: [4,5,4,5] , Three sum = 14 List 2: [7] , Three sum = 7 List 3: [ ]...
Python Using tkinter, create a GUI interface which accepts input of a GPA. If the GPA...
Python Using tkinter, create a GUI interface which accepts input of a GPA. If the GPA is >= 3.5, display 'Dean’s List' If the GPA is < 2.0, display 'Probation’ If the GPA is < 3.5 and >= 2.0, display 'Regular Standing' Run one test case for each case above and save the output.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT