1 What is the overloadview function or even an example of it

1. What is the overload/view function or even an example of it

2. What are controlling functions or an example of one

3. What are model/lowest level functions or an example

PYTHON (JES)

This is the program I am using if it helps with understanding my question:

def playGame():
location = \"Porch\"
showIntroduction()
while not (location == \"Exit\") :
showRoom(location)
direction = requestString(\"Which direction?\")
location = pickRoom(direction, location)
def showIntroduction():
printNow(\"Welcome to the Adventure House!\")
printNow(\"In each room, you will be told\")
printNow(\" which directions you can go.\")
printNow(\"You can move north, south, east, or west\")
printNow(\" by typing that direction.\")
printNow(\"Type help to replay this introduction.\")
printNow(\"Type quit or exit to end the program.\")
def showRoom(room):
if room == \"Porch\":
showPorch()
if room == \"Entryway\":
showEntryway()
if room == \"Kitchen\":
showKitchen()
if room == \"LivingRoom\":
showLR()
if room == \"DiningRoom\":
showDR()
def pickRoom(direction, room):
if (direction == \"quit\") or (direction == \"exit\"):
printNow(\"Goodbye!\")
return \"Exit\"
if direction == \"help\":
showIntroduction()
return room
if room == \"Porch\":
if direction == \"north\":
return \"Entryway\"
if room == \"Entryway\":
if direction == \"north\":
return \"Kitchen\"
if direction == \"east\":
return \"LivingRoom\"
if direction == \"south\":
return \"Porch\"
if room == \"Kitchen\":
if direction == \"east\":
return \"DiningRoom
if direction == \"south\":
return \"Entryway\"
if room == \"LivingRoom\":
if direction == \"west\":
return \"Entryway\"
if direction == \"north\":
return \"DiningRoom\"
if room == \"DiningRoom\":
if direction == \"west\":
return \"Kitchen\"
if direction == \"south\":
return \"LivingRoom\"
def pickRoom(direction, room):
if (direction == \"quits\") or (direction == \"exit\"):
printNow(\"Goodbye!\")
return \"Exit\"
if direction == \"help\":
showIntroduction()
return room
if room == \"Porch\":
if direction == \"north\":
return \"Kitchen\"
if direction == \"east\":
return \"LivingRoom\"
if direction == \"south\":
return \"Porch\"
if room == \"Kitchen\":
if direction == \"east\":
return \"DiningRoom\"
if direction == \"south\":
return \"Entryway\"
if room == \"LivingRoom\":
if direction == \"west\":
return \"Entryway\"
if direction == \"north\":
return \"DiningRoom\"
if room == \"DiningRoom\":
if direction == \"west\":
return \"Kitchen\"
if direction == \"south\":
return \"LivingRoom\"
def showPorch():
printNow(\"You are on the porch of a frightening looking house.\")
printNow(\"The windows are broken. It\'s a dark and stormy night.\")
printNow(\"You can go north into the house. If you dare.\")
  
def show Entryway():
printNow(\"You are in the entry way of the house.\")
printNow(\" There are cobwebs in the corner.\")
printNow(\"You feel a sense of dread.\")
printNow(\"There is a passageway to the north and another to the east.\")
printNow(\"The porch is behind you to the south.\")

def showKitchen():
printNow(\"You are in the kitchen. \")
printNow(\"All the surfaces are covered with pots,\")
printNow(\" pans, food pieces, and pools of blood.\")
printNow(\"You think you hear something up the stairs\")
printNow(\" that go up the west side of the room.\")
printNow(\" along the floor.\")
printNow(\"You can go to the south or east.\")
  
def showLR():
printNow(\"You are in a living room.\")
printNow(\"There are couches, chairs, and small tables.\")
printNow(\"Everything is covered in dust and spider webs.\")
printNow(\"You hear a crashihng noise in another room.\")
printNow(\"You can go north or west.\")
  
def showDR():
printNow(\"You are in the dining room.\")
printNow(\"there are remains of a meal on the table.\")
printNow(\" You can\'t tell what it is,\")
printNow(\"Was that a thump to the west?\")
printNow(\"You can go south or west\")
def pickRoom(direction, room):
if (direction == \"quit\") or (direction == \"exit\"):
printNow(\"Goodbye!\")
return \"Exit\"
if direction == \"help\":
showIntroduction()
return room
if room == \"Porch\":
if direction == \"north\":
return \"Entryway\"
if room == \"Entryway\":
if direction == \"north\":
return \"Kitchen\"
if direction == \"east\":
return \"LivinRoom\"
if direction == \"south\":
return \"Porch\"
if room == \"Kitchen\":
if direction == \"east\":
return \"DiningRoom\"
if direction == \"south\"
return \"Entryway\"
if room == \"LivingRoom\":
if direction == \"west\":
return \"Entryway\"
if direction == \"north\":
return \"DiningRoom\"
  
if room == \"DiningRoom\":
if direction == \"west\":
return \"Kitchen\"
if direction == \"south\":
return \"LivingRoom\"
printNow(\"You can\'t (or don\'t want to) go in that direction.\")
return room
def showRoom(room):
printNow(\"===========\")
if room == \"Porch\":
showPorch()
if room == \"Entryway\":
showEntryway()
if room == \"Kitchen\":
showKitchen()
if room == \"LivingRoom\":
showLR()
if room == \"DiningRoom\":
showDR()
def playGame():
location = \"Porch\"
showIntroduction()
while not (location == \"Exit\"):
showRoom(location)
direction = requestString(\"Which direction?\")
location = pickRoom(direction, location)
def showEntryway():
global ghost
printNow(\"You are in the entry way of the house.\")
printNow(\" There are cobwebs in the corner.\")
printNow(\"You feel a sense of dread.\")
if ghost == 0:
printNow(\"You suddenly feel cold.\")
printNow(\"You look up and see a thick mist.\")
printNow(\"It seems to be moaning.\")
printNow(\"Then it disappears.\")
ghost = 1
printNow(\"There is a passageway to the nirth and another to the east.\")
printNow(\"The porch is behind you to the south.\")
  
def show Kitchen():
global ghost
printNow(\"You are in the kitchen. \")
printNow(\"All the surfaces are covered with pots,\")
printNow(\" pans, food pieces, and pools of blood.\")
printNow(\"You think you hear something up the stairs\")
printNow(\" that go up the west side of the room.\")
printNow(\"It\'s a scraping noise, like something being dragged\")
printNow(\" along the floor.\")
if ghost == 1:
printNow(\"You see the mist you saw earlier.\")
printNow(\"But now it\'s darker, and red.\")
printNow(\"The moan increases in pitch and volume\")
printNow(\" so now it sounds more like a yell!\")
printNow(\"Then it\'s gone.\")
ghost = 0
printNow(\"You can go to the south or east.\")

Solution

1. The view is what we see as output. In the above example, when we perform some operation the printNow function gives the output as representation of information, through which user interact with the program.

2. Controller function controls the flow of commands given by user of program between model and view function. In the above example, if conditions can be used as controller function. As these if conditions, will lead the different functions to different views.

3. Model functions store the data and different logics that are retrieved by controller functions and then provide a view. These also provide an abstraction layer for data. In the above example, different functions like showIntroduction(), playGame(), showEntryway() works as Model functions.

1. What is the overload/view function or even an example of it 2. What are controlling functions or an example of one 3. What are model/lowest level functions o
1. What is the overload/view function or even an example of it 2. What are controlling functions or an example of one 3. What are model/lowest level functions o
1. What is the overload/view function or even an example of it 2. What are controlling functions or an example of one 3. What are model/lowest level functions o
1. What is the overload/view function or even an example of it 2. What are controlling functions or an example of one 3. What are model/lowest level functions o

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site