Question: Please number 16 , 18 and 20 By python Progzan oats King of Programming Exercises 283 16. Odd/Even Counter In this chapter, you saw an

 Please number 16 , 18 and 20 By python Progzan oats
Please number 16 , 18 and 20
By python

Progzan oats King of Programming Exercises 283 16. Odd/Even Counter In this chapter, you saw an example of how to write an algorithm thas determines wbrther a number is even or odd. Write a and keeps a count of how many of thone rangram thar gnerates 109 random numbers them are odd 17. Prime Numbers A erime number is a number that is only evenly divisible by irselt and I. For example, the etums the e greater ndom numbers are even, and how many of o deter- ber 5 is prime because it can only be evenly divided by 1 and 5. The sumber 6, hw ever, is not prime because it can be divided evenly by 1,2, 3, and 6. Write a Boolean fanction named is_prine which takes an integer as an argument and true if the argument is a prime number, or false otherwise. Use the fanction in rompes the user to eter a number chen displays a message i is the onds) asses t a program that p whether the number is prime TIP: Recall that the % operator divides one number by another and returns the emainder of the division. In an expressen such as nue1 % nun2 the t operator will return 0 if nun1 is evenly divisible by nun2. Britons ula 18. Prime Number List This exercise assumes that you have already written the is prine function in Programming Exercise 17. Write another program that displays all of the prime numbers from 1 to 100. The program should have a loop that calls the 1s prine function. 19. Future Value Suppose you have a certain amount of money in a savings account that earms compound monthly interest, and you want to cakulate the amount that you will have after a specific aumber of months. The formula is as follows: . Fis the future value of the account after the specified time period. * P is the present value of the account. * i is the monthly interest rate. The terms in the formula are: t is the number of months. Write a program that prompes the user to enter the est rate, and the number of months that the money will be left in the account. The program should pass these values to a function that returns the future value of the account, after the specified number of months. The program should display the account's future value. account's present value, monthly inter- 20. Random Number Guessing Game Write a program that generates a random number in the range of 1 through 100, and asks the user to guess what the number is. If the user's guess is higher than the random number, the program should display "Too high, try again." If the user's guess is lower than the

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!