write the full set of logic pseudocode include all abstractions and mainline logic of the given code below: Correct terminology used  Declarations are made with data types   create a file initial.py and write below code #import random module import random def point():   #random integer stored   number = random.randint(1,100)   print("please guess number:")   print("%s number have you guessed"%number)   print("if yes please enter yes else enter no")   return number   run above code create another file computer.py and write below code   #import random library for generating 1-100 import random import initial #define main function def main():   #call module method   number = initial.point()   m = input()   if(m=="yes"):     return "computer win the game"   #no   elif(m=="no"):     for i in range(6):       print("guessing number was greater than or less than:")       print("enter g for greater than:")       print("enter l for less than:")       #for greater or less       o = input()       if(o == 'g'):         #generate random number again         number = random.randint(number,100)         print("%s number have you guessed"%number)         #for yes or no         p = input()         if(p=="yes"):           return "computer win the game after %s"+str(i+2)         else:           continue       #condition for less than       elif(o=='l'):         number = random.randint(1,number)         print("%s number have you guessed"%number)         p = input()         if(p=="yes"):           return "computer win the game after %s"+str(i+1)         else:           continue                   else:         print("please enter valid keyword")         i -= 1         continue     else:       return "computer loss the game after 7 times:" #call main function     print(main())

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter2: Elements Of High-quality Programs
Section: Chapter Questions
Problem 11RQ
icon
Related questions
Topic Video
Question

Please write the full set of logic pseudocode include all abstractions and mainline logic of the given code below:
Correct terminology used 
Declarations are made with data types

 

create a file initial.py and write below code

#import random module

import random

def point():

  #random integer stored

  number = random.randint(1,100)

  print("please guess number:")

  print("%s number have you guessed"%number)

  print("if yes please enter yes else enter no")

  return number

 

run above code

create another file computer.py and write below code

 

#import random library for generating 1-100

import random

import initial

#define main function

def main():

  #call module method

  number = initial.point()

  m = input()

  if(m=="yes"):

    return "computer win the game"

  #no

  elif(m=="no"):

    for i in range(6):

      print("guessing number was greater than or less than:")

      print("enter g for greater than:")

      print("enter l for less than:")

      #for greater or less

      o = input()

      if(o == 'g'):

        #generate random number again

        number = random.randint(number,100)

        print("%s number have you guessed"%number)

        #for yes or no

        p = input()

        if(p=="yes"):

          return "computer win the game after %s"+str(i+2)

        else:

          continue

      #condition for less than

      elif(o=='l'):

        number = random.randint(1,number)

        print("%s number have you guessed"%number)

        p = input()

        if(p=="yes"):

          return "computer win the game after %s"+str(i+1)

        else:

          continue

           

      else:

        print("please enter valid keyword")

        i -= 1

        continue

    else:

      return "computer loss the game after 7 times:"

#call main function    

print(main())

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage