Sample Assignment Assignment 5 Name: ___________________________ CSC-1110 Section: ______ Assignment 5 COMPLETE THE HONOR CODE BELOW HONOR CODE: I pledge that this program represents my own program...

1 answer below »
python coding


Sample Assignment Assignment 5 Name: ___________________________ CSC-1110 Section: ______ Assignment 5 COMPLETE THE HONOR CODE BELOW HONOR CODE: I pledge that this program represents my own program code, I have received help from no one and I have given help to no one. OR I received help from NAME OR NO ONE in designing and debugging my program. I have given help to NAME OR NO ONE in designing and debugging my program. This assignment is required. The grading form shows point values for this assignment. Please review it now. Show screen shots of the python code with comments and your input/output window. You should use several well-planned sets of data to check out your program. Testing your programs with just the data that is asked for in the assignment does not necessarily mean that the programs will work for all cases. Please include the following comments in each of your Python programs: Your Name Section Date Description Assignment Number A python template (python_template.py) has been provided for you to use. Name this document XXX_Assignment 5 where XXX are your initials. Include a python file named P01.py, P02.py, etc. for each problem. 1. Most things that you purchase include a sales tax. Write a program that asks the user to enter the purchase price of an item, then displays the purchase price, the sales tax amount, and the total amount of the purchase. Use 7.11% as the percentage of the sales tax. Create a function called sales_tax_amount. This function takes in the price of the item and returns the amount of the sales tax. Here's the sample program that you will use to test your function: Welcome to the Sales System Please enter the cost of your item: 127.99 The coverage amount needed for a $197820 structure is $158256.00. Would you like to enter another? Enter y for yes or n for no y Please enter the value of the structure that will receive coverage: 89211 The coverage amount needed for a $89211 structure is $71368.80. Would you like to enter another? Enter y for yes or n for no n Thank you and goodbye! Comment your source code and describe your code to someone who may be viewing it for the first time. PLACE SCREEN SHOTS OF THE PYTHON CODE AND ALL I/O BELOW. Write a function called "future_value" which will determine the value of a dollar figure at a specific date. The future value formula is as follows: where FV is the future value, PV is the dollar value for today, r is the interest rate, and n is the number of periods. Here's the information for the function you are to create: # function: future_value # input: three numbers (PV (float), r (float), and n (int)); # processing: determines the future value of a dollar amount given the PV, r, and n. # output: The future value calculation Here's the sample program that you will use to test your function. Copy the following lines and paste them into your python program file under your method definitions.: answer1 = future_value(100, 0.05, 5) print (answer1) answer2 = future_value(20000, 0.05, 10) print (answer2) answer3 = future_value(4000, 0.03, 1) print (answer3) answer4 = future_value(900, 0.06, 4) print (answer4) And here's the expected output: 127.63 32577.89 4120.00 1136.23 Comment your source code and describe your code to someone who may be viewing it for the first time. PLACE SCREEN SHOTS OF THE PYTHON CODE AND ALL I/O BELOW. For this part you will be writing three functions and the main program to test these functions: # function: getUserInput # input: no input # processing: this function asks the user to enter a value for their guess # output: the value that the user enters as a guess # function: getRandomNumber # input: the lower bound number and upper bound number to use to generate the random value (both integers) # processing: this function uses the lower and upper bound values to get a random value from the random function. # output: returns the random chosen number # function: is_higher_or_lower # input: target_number and current_number (both integers) # processing: This function determines whether the current_number is higher or lower than the target_number # output: returns the string value ‘higher’ or ‘lower’ The program you are going to create is a number guessing game. Here are the steps you will use to create your program: Step 1: You will ask the user for the number of tries to guess the secret number before the game is over. You must make sure that the number of tries is at least one. If it is not, then you must prompt the user to a valid value. Step 2: Get the secret number from the getRandomNumber function. Step 3: Begin the game by asking the user for their guess. If the secret number is not the same as the guessed value, then use the is_higher_or_lower function to determine if the secret number is higher or lower from the guessed value. Step 4: This will continue until either the user guesses the right number before the number of tries or they have used all their guesses. Step 5: If the user does not guess the number before the number of tries is up then the program will let them know what the secret number was. Run this program with 4 as the number of tries. Show the input/output for this game as well as the code. Comment your source code and describe your code to someone who may be viewing it for the first time. PLACE SCREEN SHOTS OF THE PYTHON CODE AND ALL I/O BELOW.
Answered 2 days AfterMar 14, 2021

Answer To: Sample Assignment Assignment 5 Name: ___________________________ CSC-1110 Section: ______ Assignment...

Pratap answered on Mar 16 2021
145 Votes
"""-----SALES SYSTEM-----
System to provide the details of the amount payable,
with tax included w
hile purchasing items
"""
print("Welcome to the Sales System")
def calculate_total_amount(purchase_price):
"""Function to calculate tax amount
and total cost for the item purchased
with fixed tax rate"""
sales_tax = 7.11 #fixed tax rate
tax = round((purchase_price * (sales_tax / 100)), 2) #tax calculation round to 2 decimal
total = round((purchase_price + tax), 2) #total payable amount
return tax, total
def follow_up():
"""Function to ask follow...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here