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())

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education