Lab 4 At one college, the tuition for a full-time student is $8,000 per semester. It has been announced that the tuition cost per semester will increase by 3 percent each year for the next 5 years....

Python



Lab 4 At one college, the tuition for a full-time student is $8,000 per semester.  It has been announced that the tuition cost per semester will increase by 3 percent each year for the next 5 years. Write a program with a loop that displays the projected semester tuition cost per semester for the next 5 years. The program should print output in the this format. The current tuition cost per semester is $8,000.00. In 1 year, the tuition per semester will be $8,240.00. In 2 years, the tuition per semester will be $8,487.20. In 3 years, … In 4 years, … In 5 years, … Lab 5 A prime number is a number that is only evenly divisble by itself and 1. For example, the number 5 is prime because it can only be evenlly divided by 1 and 5. The number 6, however, is not prime because it can be divided evenly by 2 and 3. Write a Boolean function named is_prime which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise. Use the function in a program that prompts the user to enter a number and then prints whether the number is prime. You should use a count controlled for loop to cycle through all of the numbers from 3 to the square root of the number + 1. Something like this:  for i in range(3, int(math.sqrt(number))+1, 2): Notice the step is 2, so you're increasing the value of i by 2 with each pass of the loop.         for counter in range(3, int(math.sqrt(n))+1, 2):             result = n%counter             print("The index is: " + str(counter) + " the number is " + str(n)                   + " and the resulting modulus is: " + str(result))             if n%counter == 0:                 return False         return True Now using your new function, write a program that asks the user for a range of numbers with a start and end point and list all of the numbers that are prime numbers in that range. Lab 5b Design and implement an application to convert temperatures from Fahrenheit to Celsius or Celsius to Fahrenheit.  Create a menu based application with 3 options, Convert Fahrenheit to Celsius, Convert Celsius to Fahrenheit, and Exit.  You'll need a conditional loop and a sentinel value, (For Example: X to Exit). Celsius to Fahrenheit is       Temperature in Celsius * 1.8 + 32 = Temperature in Fahrenheit Fahrenheit to Celsius is       (Temperature in Fahrenheit - 32) * 5/9 = Temperature in Celsius Create two functions for converting temperatures.  Look for opportunities in the design to implement one or more GLOBAL CONSTANTs. Lab 6 Attached Files: ·  numbers10.txt (15 B) Assume that a file containing a series of integers is named numbers10.txt (attached to this assignment). Write a program that asks the user for a filename and reads the numbers from the file and then calculates the average of all the numbers stored in the file. Write the program to handle the following exceptions: • It should handle IOError exceptions that are raised when the file is opened and data is read from it by printing "Trouble opening file. Try again." and not executing any more of the code. • It should handle any ValueError exceptions that are raised when the items that are read from the file are converted to a number by printing "File must have only numbers. Try again." and not executing any more of the code.
Feb 20, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here