Excel VBA, Fast
For each of the following, create a solution in Python and in Excel
1. Ask the user to enter two numbers. If the second number is not zero, print the quotient of the two numbers, otherwise print a message to the effect of not being able to divide by zero.
2. Create a simulated two dice game, if you roll a 7 or an 11, you win. Otherwise, you lose. Hint: look up random functions in Excel and Python.
3. Write a program that asks the user to enter a number from 1 to 12 and prints out the name of the corresponding month. (Excel=lookup() function. Python if…elif..else)
4. Modify the program below to set total to zero when the user inputs a negative value.
result = 10.0
print “Please enter the total: ”
total = float (raw_input())
if (total > 100.0):
result = 25.0
else:
result = 80.0
print “Result is ”, result)
5. Design an algorithm for the following, then translate it into a Python code:
a. A shoe salesman’s monthly wage is either $5/hr or 8% commission on his sales that month, whichever is greater. Additionally, he gets a $100 bonus for selling at least $2000 worth of shoes during that month. Your solution should have the user enter a salesman’s total monthly hours and total monthly sales, then outputs his monthly wage.
b. The normal work hours is 40 hours per week. A company pays overtime for hours worked over 40 hours at 1.5 times the base pay rate. Write an algorithm that will read the employee’s pay rate, the number of hours worked during the week, and output the total pay for the employee.
c. A certain courier company has a two tiered charging system. They normally charge a flat rate of $ 1.50 per kg. However, if a package weighing more than 10 kg will be delivered more than 200 km, then they charge $2.50 per kg. Write an algorithm that will read the weight of the package and the distance to its destination and calculate the shipping cost.
Note: to submit this, you will need a multi-sheet Excel worksheet (ie one solution per sheet) and a multi-cell Python notebook (ie on solution per cell)
BOTH of which will need to be zipped together for a single submission
Is this the question you were looking for? If so, place your order here to get started!