Question: In Python please Exercise 6. Numbers Compose a program day.py that accepts a date as input and writes the day of the week on which

 In Python please Exercise 6. Numbers Compose a program day.py that

In Python please

Exercise 6. Numbers Compose a program day.py that accepts a date as input and writes the day of the week on which that date falls. Your program should accept three command-line arguments: m (month), d (day), and y (year). For the month m, use 1 for January, 2 for February, and so forth. For output, write 0 for Sunday, 1 for Monday, 2 for Tuesday, and so forth. Use the following formulas, for the Gregorian calendar, and note that all divisions are meant to be integer divisions (i.e., quotient without a remainder). yo = y- (14 - m) / 12 x = yo + yo / 4 - yo/100 + yo / 400 mo = m +12 * ((14-m)/12)-2 do = (d + x + (31 * mo) / 12) mod 7 Exercise 7. Boolean Expressions Complete the following quizzes.py program by writing the missing expressions. The program reads three quizzes grades from the command line, and check whether the users passed all the quizzes (passed_all), or failed some at least (failed_some): n1 = int (sys.argv[1]) n2 = int(sys.argv[2]) n3 int (sys.argv[]) passed_all = failed some = Exercise 8. Leap Year Compose a program leap.py that takes a positive integer command line argument representing a year number and prints True if the year is leap and False otherwise. A leap year is a year divisible by 4 but not by 100, or is divisible by 400. You may not use nested if statements of if/elif/else statements. You can use boolean expression that evaluates to the correct true/false answer, or simple if / Else statement. Exercise 9. Separating Digits Write a program that allows a user to enter an integer, and separates it into individual digits, and prints the digits with three spaces between them. Exercise 10. Vowels in a String Write a program that counts the number of vowels existing in a specific string s. Assume that s is all lower case letters. A letter is a vowel if it is one of the following: a, e, o, i, u. Exercise 11. Square Root of a Number Write a program mysqrt.py that reads a float from the command line and computes/prints its square root. The algorithm for computing the square root of a positive number 'a' works as follows: given any estimate x of the square root, an improved estimate can be computed as (x + a/x)/2. Therefore your algorithm can start from an initial estimate (say a) and iterate until x? is equal to a to within a small tolerance, say 107. > python mysqrt.py 10.0 3.162277665175675

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!