Itech2000 Pseudocode Assignment Sample Answers


  • Internal Code :
  • Subject Code : ITECH2000
  • University : Federation University
  • Subject Name : IT Computer Science

Mobile Development Fundamentals

Screen 2: How to Play

When Screen 2 Initialize Call FileReader to read howtoplay.txt file

When got text from file Call set Instructions label

When back button is clicked Do open Screen1 (Menu)

Screen 3: Quick Game

Create empty global list

  • Procedure RandomGenerator(min,max)
    • With loop fill list with 9 random no in range of paramaters min and max
    • Set all number buttons text with filled list
    • Call procedure Reset
    • Call procedure RandomTarget with parameters 3 random numbers in range 1 to 9
  • Procedure Reset
    • Enable all number buttons
    • Set all number buttons background with same color
  • Procedure RandomTarget(a,b,c)
    • While parameter a equals b or a equals c set a with random number in range 1 to 9
    • While parameter a equals b or b equals c set b with random number in range 1 to 9
    • Set target number to sum of numbers in list at index a,b,c
    • Set selected numbers count to 0
    • Set remaining moves to 3
    • Set time to 10
    • Enable timer

When Screen 3 Initialize Call procedure RandomGenerator with parameters 1 and 6

  • Procedure DisableAll
    • Disable all number buttons
  • Procedure GameOver
    • Notify Game Over with winstreak count ask to play again or return to menu

When timer notifies reduce time by 1

if time becomes zero then disable the timer and call procedure DisableAll and GameOver

  • Procedure Clicked(number)
    • Update count with count + number
    • Decrease remaining moves
    • If Target reached then increment streak count, disable clock, call procedure DisableAll and RandomGenerator with parameters 1 and 6 + winstreak count
    • Else if remaining moves equals 0 or selected count exceeds target then disable clock, call procedure DisableAll and GameOver

When number button is clicked then disable button, change background and call procedure Clicked with parameter number

When choice is made in notifier if choice is play again reset win streak and call procedure RandomGenerator with parameters 1 and 6 else open Screen1 (Menu)

Screen 4: Custom Game

When start button is clicked then hide timer checkbox, difficulty check box, min number and max number, If min number is empty then set it 1, If max number is empty then set it 6, If max < min then set min number 1 and max number 6, call procedure RandomGenerator

Create empty global list

  • Procedure RandomGenerator
    • With loop fill list with 9 random no in range of min number and max number
    • Set all number buttons text with filled list
    • Call procedure RandomTarget with parameters 3 random numbers in range 1 to 9
    • Call procedure Reset
  • Procedure Reset
    • Enable all number buttons
    • Set all number buttons background with same color
  • Procedure RandomTarget(a,b,c)
    • While parameter a equals b or a equals c set a with random number in range 1 to 9
    • While parameter a equals b or b equals c set b with random number in range 1 to 9
    • Set target number to sum of numbers in list at index a,b,c
    • Set selected numbers count to 0
    • Set remaining moves to 3
    • If Timer check box is checked then set time to 10 and enable timer, else hide time

When timer notifies reduce time by 1, if time becomes zero then call procedure DisableAll, disable the timer, notify Game Over with winstreak count ask to play again or return to menu

  • Procedure DisableAll
    • Disable all number buttons

When choice is made in notifier if choice is play again show timer checkbox, difficulty check box, min number and max number, reset win, else open Screen1 (Menu)

  • Procedure Clicked(number)
    • Decrease remaining moves
    • Update count with count + number
    • If Target reached then increment streak count, call procedure DisableAll, disable clock, if difficulty checkbox is checked increment max number, call procedure RandomGenerator
    • Else if remaining moves equals 0 or selected count exceeds target then call procedure DisableAll, disable clock and notify Game Over with winstreak count ask to play again or return to menu

When number button is clicked then disable button, change background and call procedure Clicked with parameter number

Components/Blocks

  • Notifier : Notifier is used for notifying game over when either time ran out,selected number count exceeded target or moves ran out. It is used to notify game over because it restricts to make a choice out of available options when cancelable is disabled.
  • CheckBox : Check box is used in custom game screen for time and difficulty enabling and disabling in custom game. It was used because of its suitablity in enabling/disabling process.
  • Labels : Labels are used to label the values displayed in text boxes like time,count etc. They are used because they help in decribing.
  • TextBoxes : Textbox are used in custom game to input min and max number. They are used because they allow user input and can be restricted to number only input.
  • Buttons : Buttons are used to display randomly generated numbers in game board so that number can be selected by clicking that button and after number select events can be called.
  • Clock : Clock is used to notify after every 1 sec so that time can be updated and game can be stopped after 10 sec.
  • Arrangements : Horizontal and Vertical arrangements are used to display nine numbers in the form of 3x3 matrix because screen alows arrangement vertical only. So three vertical arrangemnts in horizontal arrangements are used.
  • List Construct : List construct is used to save nine random numbers so that we can generate target number by adding three random numbers from list selected from three unique random indexes to make sure the three number sum availability.
  • Repetition Construct : For loop is used to fill list with nine random numbers to minimze block repeatition because of same range for all random numbers in the list. While loop is used to take unique indexes for calculating target sum from list.
  • Decision construct using a Boolean (AND or OR) expression : It is used to identify game over in case of move ran out or selected numbers count exceeding so that notifier can be called for game over.
  • Procedures : Procedure is used for event after number selection so that number count, remaining moves, win streak can be updated and game over can be checked each time when number is selected without repeatition of blocks in each number button click block.

Remember, at the center of any academic work, lies clarity and evidence. Should you need further assistance, do look up to our Computer Science Assignment Help


Book Online Sessions for Itech2000 Pseudocode Assignment Sample Answers Online

Submit Your Assignment Here