Search This Blog

Monday, 27 February 2012

PRG 1

Group Activty: Navigation / Get menu selection

start process
case menu

get value

case value = "A", "a" then
Display 'PageA.html
else

case value = "B", "b"
get value 'Sport,News
if value = sport then
Display 'PageSport.html
else
if value = news then
Display 'PageNews.html

else

case value = "C", "c" then
Display 'PageC.html

else

case value = "D", "d" then
Display 'PageD.html

else

case value = "E", "e" then
Display 'PageE.html

else

case value = "F", "f" then
Display 'PageF.html

else value = "H", "h" then
Display 'PageH.html

else
'Display "Invalid Choose Re-enter"
loop
End case

End

Sunday, 26 February 2012

If PasswordId = PasswordSet Then
                              Display "You have Entered the correct Password"
Else

                              Display "Invalid Password"
End if

End

Activity 2 prg1

R
X
Y

R = Y

get R,X,Y
If Y > 100 then
       x - 10

end if

Else

If Y > 200 then
       X = 0
       Y = 0

end if

end

Activity 4.4


Switch Colour

Case "Pink","pink"
                           Display 'Pink

Case "Green","green"
                           Display 'Green

Case "Orange","orange"
                           Display 'Orange

Case "Purple","purple"
                           Display 'Purple

Case "Black","black"
                           Display 'Black

Case Else
                           Display "Invalid Colour"

End
End Select

Activity 4.2

If number > 8
      Display "This number meets the condition"
   Else
      Display "This number does not meet the condition"
End if

question 2

any number 8 and below, the reason is that the if statement is > then 8

Activity 4.1

 step 1

You need to know the cost of sending a parcel to someone. The price of sending the item depend upon its weight. The postal service has set a standard charge per kilo of item weight. if the postal charge is greater than 100.00, a 10% discount is applied to the amount.

step 2

Weight
CostPerKilo

step 3

CostOfParcel

step 4

start
get Weight
get CostPerKilo
get CostOfParcrel
calculate Weight * CostPerKilo
if CostOfParcel > 100 then
           'CostOfParcel * 0.9
end if
Dislplay CostOfParcel
end

Switch condition

Switch Month
case "january" or having J, j
         DoSomething
etc...

case else
        DoSomething else

end select

case 1
case 2
case 3

Else
end select
words and names are kept as string data

Activity 3.1

Describing Algorithm i did in 1.1 and 1.2
The Algorithms i developed solve the problem
if the it is false they end if

Keywords

And = both
or = one selection

if UserAge >=18 and UserAge <=25
       'let them in
else
       'direct them to retirement village
end if

else = if false do the next step

end if = close if statement

PRG 1

Individual Activity: Update Enviroment Variables (1 frame)

step 1
Each frame, X is incremented by R and Y is incremented by T. if X becomes greater than 5000 then Y is decremented by 1000. if Y becomes less than 0, Y and X are set to 0
step 2
R
T
step 3
X incremented by R
Y incremented by T
step 4
start
get R
get T
get X is incremented by R
get Y is incremented by T
if X > 5000
{
then Y - 1000
{
if Y < 0
Y set 0
X set 0
}
}

end

Activity 1.2

blog task: Algorithm develpment 2

1: using the five step process, develop an algorithm for the following problem:

step 1
you want to estimate the number of hours it will take you to complete all of the levels in a new video game based on your past performance with other games
step 2
highest performance time
lowest performance time
step 3
estimated performance
step 4
get highest performance time
get lowest performance time
caluculate highest performance time * lowest performance time / 2
display estimated performance time

Activity 1.1

blog task: algorithm development 1
1. using the five step process, develop an algorithm for the following problem:

step 1 ( define the problem )
the focus of the problem is to find out the cost, to send the parcel
step 2 ( define the inputs )
weight of parcel
costperkilo
step 3 (define the outputs )
calculate cost of parcel
step 4 ( define processing )
get wieght of parcel
calculate cost per kilo
displayer the results to the user

Activity 3.3 linked to 1.1

IT