Answered You can hire a professional tutor to get the answer.

QUESTION

File Edit View Window Help @@E%-| m (13501124) I mxvlgllcavlg Figure 4 Multiple Allernatlves r1 chter' 2 8.0? False r1 enter 2 7.0? False r1 chter' 2...

I need help with all of the questions below. The programming language for these questions is Python.

Could a tutor please provide screenshots of all the questions running in IDLE of Python. So I know how to correctly type each code in as I am new to programming. Thanks in advance.

3. Find the errors in the following if statements, correct where necessary.

a) if x > 0 then 

          print(x)

b) if 1 + x > x ** sqrt(2) :

          y = y + x

c) if x 1 :

          y += 1

d) letterGrade = "F"

   if grade >= 90 :

           letterGrade = "A"

   if grade >= 80 :

           letterGrade = "B"

   if grade >= 70 :

           letterGrade = "C"

   if grade >= 60 :

           letterGrade = "D"

4. Using the flow chart below, construct the if, elif, else control structure necessary to implement the flow chart.

Complete the program to describe the earthquake by asking the user to enter a magnitude on the Richter scale and print out the effect that magnitude would have had (e.g. "Many buildings destroyed").

5. Compose a program that sets a password as "changeme" and asks the user to enter the password and keeps asking until the correct password is entered and then says "Accepted".

The program should count how many attempts the user has taken and tell them after they have been accepted.

Extra Challenge:

If the user takes more than 5 attempts the program should say, "Access denied, please press enter to exit and contact security to reset your password"

6. What do the following nested loops display? Hand trace.

           for i in range(3) :

                      for j in range(1, 4) :

                                  print(i + j, end="")

           print()

7. Compose a program that will generate a table to print powers of the first 5 numbers. Your output should be similar to the sample given below. 

  • Attachment 1
  • Attachment 2
File Edit View Window Help @@E%-|©© m (13501124) I ® ® mxvlgllcavlg Figure 4Multiple Allernatlves r1 chter‘ 2 8.0? False r1 enter 2 7.0? False r1 chter‘ 2 6.0? False r1 filter 2 4.5? False No demmcn'onof buildings True True True True Monmum Many building:dammed, some collapse Damage IDpoorly consumedbuildings & " aIllfi-m u
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question