Saturday, June 30, 2012

Friday, 29th June 2012

Today went to school, was still wondering what kinda activities awaiting for me...
I feel stupid after the activities cause the available activities are :
- Animal Sounds
- Debate
- Blindfold
- Run around school

i) The animal sounds part is, everyone take lottery with slip of papers. The paper got indicate which animal sound to make, everyone need to make the sounds to form their team.

ii) Debate is about an article, girl 16~17 years old slept with 48 men for 1 year (2010 to 2011). Is it right to reveal her name, since 48 men names was being exposed?

iii) Blindfold is just random people teamed up, and 1 side will get blindfolded. The other person will guide the blindfolded through a path, obstacles are just papers. I find it weird when my  facililator blindfolded me in a way that I can see the floor clearly lol, so I managed to clear the stage without any troubles.

iv) Run around school, is just some sort of treasure hunt. Was assigned a picture of a location, need find the location and take picture in the exact same way. Beside being last team, facililator also misguided us, so we ended up last team. But never mind, lucky no punishment, or else I complain lol.

Although completed the lame activities, but still need to do reflection journal, write about what skills being used x.x
Wrote 600 words in my reflection journal.
Damn, that's really long and tiring. Made me hungry after writing, and also thinking, so much

We were released at 11 am, but Art of Story UT starts at 4.45 pm. Had like 5 hours lol
In the end, we just went back to class to watch Finding Nemo and also Woman in Black.

Slacked at class until 4 and everyone went to their respective UT classrooms.
I managed to do the UT quite fast, spent only half of the time, although I wrote little.
But never mind, I will see how strict they mark first ~.~

Not much new mangas for this week, went to buy a present for a malaysian classmate instead. Didn't give him present for his birthday, just a cheap one anyway.

Thursday, June 28, 2012

Worksheet for Programming Week 08

# For Loop

for a in range(1,10,2):
    print `a` + ": hello"

# For Loop / List

from random import randint
randomList = []

for x in range(10):
    randomList.append(randint(1,100))
    if randomList[x] % 2 != 0:
        print randomList[x]

print randomList

# List / Sum

def totalUp():
    listOfNum = [4,3,6,2]
    total = sum(listOfNum)
    return total

print totalUp()

# Functions

def areaOfRect(w,h):
    area = w * h
    return area

print areaOfRect(5,10)

# Function / List

def printList(x):
    a = x[0]
    b = x[-1]
    c = "First element is " + `a` + ", while Last element is " + `b`
    return c

print printList([154, 198, 123, 136, 239, 257, 207, 262, 178, 228])

# Function / List II

def sumList(x):
    a = x[0]
    b = x[-1]
    c = "The sum of " + `a` + " and " + `b` + " is " + `(a + b)`
    return c

print sumList([193, 220, 113, 248, 132, 289, 188, 124, 163, 255])

# List / Maximum

def findMax(x):
    maxNum = x[0]
    for a in range(len(x)):
        if x[a] > maxNum:
            maxNum = x[a]
    return maxNum

print findMax([171, 135, 160, 295, 105, 253, 169, 224, 298, 139])

# List / Maximum by 4

def findMaxBy4(x):
    maxNum = x[0]
    for a in range(len(x)):
        if x[a] % 4 == 0:
            if x[a] > maxNum :
                maxNum = x[a]
    return maxNum

print findMaxBy4([233, 135, 109, 117, 300, 268, 185, 259, 298, 171])

# List / Maximum / Minimum

def diff(x):
    maxNum = x[0]
    for a in range(len(x)):
        if x[a] > maxNum:
            maxNum = x[a]

    minNum = x[0]
    for a in range(len(x)):
        if x[a] < minNum:
            minNum = x[a]

    difference = maxNum - minNum
    return `maxNum` + " - " + `minNum` + " = " + `difference`

print diff([110, 116, 209, 163, 287, 222, 293, 268, 275, 213])

Reflection Journal for Programming Week 08

The code should be continuous...
1) Create a list named 'numList' with the following numbers: 4, 7, 9, 0, 9, 7, 43, 2, 6, 87
2) Print out the last element in 'numList'
3) Write a loop that prints out ALL the elements in numList (first number printed must be 4)
4) Write a loop that prints out ALL the elements in numList in REVERSE ORDER (first number printed must be 87)
5) Write a loop that prints out all the numbers in numList that are GREATER THAN 10

The code :

numList = [4, 7, 9, 0, 9, 7, 43, 2, 6, 87]
print "This is last element " + `numList[-1]`
print ' '
for x in range(len(numList)):
        print numList[x]
print ' '
numList.reverse()
for x in range(len(numList)):
    print numList[x]
print ' '
for x in range(len(numList)):
    if numList[x] > 10:
        print "Greater than 10 got " + `numList[x]`

Archery Score



































[Original]

from random import randint

def getScore():
    rdmScore = []
    for a in range(10):
        rdmScore.append(randint(100,300))
    return rdmScore

rdmScore = getScore()

def lowestScore():
    lowest = min(rdmScore)
    return lowest

def highestScore():
    highest = max(rdmScore)
    return highest

def averageScore():
    total = sum(rdmScore)
    avg = float(total)/float(len(rdmScore))
    return avg

print "Score (10 games): " + `rdmScore`
print "Average Score : " + `averageScore()`
print "Lowest Score : " + `lowestScore()`
print "Highest Score : " + `highestScore()`

[With Bonus]

from random import randint

def getScore():
    rdmScore = []
    for a in range(10):
        rdmScore.append(randint(100,300))
    return rdmScore

scoreList = getScore()

def lowestScore(scoreList):
    lowest = min(scoreList)
    return lowest

def highestScore(scoreList):
    highest = max(scoreList)
    return highest

def averageScore(scoreList):
    total = sum(scoreList)
    avg = float(total)/float(len(scoreList))
    return avg

players = []
for i in range(5):
    players.append(getScore())

for i in range(len(players)):
    print "Player: " + `i+1`
    print "Score (10 games): " + `players[i]`
    print "Average Score : " + `averageScore(players[i])`
    print "Highest Score : " + `highestScore(players[i])`
    print "Lowest Score : " + `lowestScore(players[i])`
    print

worst = 0
worstScore = averageScore(players[0])
for i in range(1,len(players)):
    if averageScore(players[i]) < worstScore:
        worst = i
        worstScore = averageScore(players[i])

print "Worst player is : Player " + `worst+1`
print "His average score is " + `worstScore`
print

best = 0
bestScore = averageScore(players[0])
for i in range(1,len(players)):
    if averageScore(players[i]) > bestScore:
        best = i
        bestScore = averageScore(players[i])
print "Best player is : Player " + `best+1`
print "His average score is " + `bestScore`


Thursday, 28th June 2012

Ate maggie mee with 2 eggs at 2+ am, too hungry after do programming lol
Brain encountered some logic errors, not sure how to solve
Think I too tired today also x.x

Managed to solve today's problem statement de bonus part by myself
After a long time though

I find it really stupid if someone wants me to approach the person and understand the person from just facial expressions, how the hell do I know

Wednesday, June 27, 2012

Display Month Function

month = raw_input("Enter the number of month")

try:
    month = int(month) - 1
    if month < 0 or month >= 12:
        print "Please enter between 1 to 12"
        exit()

except:
    print "Error"
    exit()

def displayMonth(month):
    listOfMonth = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    return listOfMonth[month]

print displayMonth(month)

Purpose of this code:
- Calculate the number of month and display the month's name
* Plans to take in day & year of birthday
* To calculate horoscope and chinese zodiac

Today's 9gag~




Wednesday, 27th June 2012

Today finally no wear full black
Instead, red top and white bottom

Think this pattern would be more suitable for Creative Concepts

Today's problem trigger is Belief

My team chose Plastic Surgery, is it okay?

I found a few pictures that has plastic surgery jokes in them









Arguments....
Seriously?

Tuesday, June 26, 2012

Tuesday, 26th June 2012

Today need learn molecular stuffs in science, don't think I know how to do this 1 lol
One good thing, group with Muffin =D

So troublesome to live and act normally
I think I will just be emo

Monday, June 25, 2012

Monday, 25th June 2012

Today have to watch Matrix for Art of Story

I watched all three movies before -_-
Simply watched Dantalian no Shoka during the movie lol

Only help little in today's presentation
Changed powerpoint background to black and font to green for a Matrix feel

Went to Causeway Point's Pastamania for dinner with Muffin
She ordered Turkey Bacon Cheesy Crumble while I ordered Hawaiian Pizza

Everytime I say I eat Hawaiian Pizza at Pastamania, people will doubt me
Thought I referring to Pizza Hut -_-

Bought 5 boxes of tissue just now
Price tag wrote $4.00 but $2.99 when bring to counter
$3.00 for 5 boxes of tissue is cheap

Summer Animes 2012 List

Sunday, June 24, 2012

Sunday, 24th June 2012

Woke up at 4.30 pm today, nothing to do x.x

Ate potato chips and cadbury chocolate at late night
Also watched Dantalian no Shoka before sleep

Saturday, 23th June 2012

Watched Finding Nemo with Muffin
Ate sushi before going my house
Then went to eat Mac Donald for dinner x.x
Double Cheese Burger~

Then play mahjong / poker with friends until late night 2 am lol
Ate Mac Donald again
This time is Mc Chicken Meal + some Mc Nuggets

Friday, June 22, 2012

Last Question in Programming UT 1


def my7(a,b):

    total = a+b

    if (a > b):
        diff = a - b
    else:
        diff = b - a

    if (a == 7 or b == 7):
        return True
    elif (total == 7 or diff == 7):
        return True
    else:
        return False

Friday, 22th June 2012

Today Communication Practice
Need go down for a talk, by Mr Sam Tan

Discussed about how communication barrier can be formed by 4 type of noises
- Physical
- Psychological
- Physiological
- Semantic

Afterwards, went for programming UT
So hard sia lol

Guessing Game

Made this game with the help of 6P and prior knowledge from ITE de C# programming

Just a simple guessing game in Python that only requires user to guess a digit from 1 to 99 by just entering the answer they feel is right

The code :

import random

ans = random.randint(1,99)
low = 1
high = 99
temp_low = 0
temp_high = 0
guess = ' '
tries = 1

while (guess != ans):
    tries = tries + 1
    guess = raw_input("Guess the number between 1 and 99: ")

    try:
        guess = int(guess)
        if guess < 1 or guess > 99:
            print "Please enter between 1 to 99"
            exit()

    except:
        print "Invalid Entry, Game Over"
        exit()

    if guess < ans:
        if guess > low:
            temp_low = guess

        low = guess

        if low > temp_low:
            low = low

        else:
            low = temp_low
        print "You entered " + `guess`
        print "It is HIGHER than " + `low` + " but LOWER than " + `high`

    elif guess > ans:
        if guess < high:
                temp_high = guess

        high = guess

        if high < temp_high:
            high = high

        else:
            high = temp_high
        print "You entered " + `guess`
        print "It is HIGHER than " + `low` + " but LOWER than " + `high`

print "Well done!"
print "The answer is "+ `ans` + "!"
print "You took " + `tries` + " tries"

if tries <= 5:
    print "Wow, you're really lucky"
if tries > 5 and tries <= 10:
    print "Not bad, quite lucky~"
else:
    print "Nice effort, you might be luckier on next game!"


Gonna try create Scissor, Paper, Stone game with a similar concept when free

Thursday, June 21, 2012

Worksheet [List]

# Lucky Number

name = raw_input("Enter your full name")

def calculateLuckyNumber(name):
    nameSplit = name.split(' ')
    F = len(nameSplit[0])
    S = len(nameSplit[1])
    T = len(nameSplit[2])
    luckyNum = ((2 * F + S) + T) % 10
    return luckyNum

print calculateLuckyNumber(name)

# Using List

sentence = "Dell profit surges on revived business spend"
words = sentence.split()

print words[0] + " " + words[4] + " " + words[5]
print len(words[0]) + len(words[4]) + len(words[5])

#Filtering Words

sentence = 'cat dog lion tiger mouse cow'
sentenceSplit = sentence.split(' ')

for a in range(0,6,1):
    count = len(sentenceSplit[a])
    if count == 3:
        print sentenceSplit[a]

# Sum Up Numbers

num_list = range(0,30,4)
total = 0
for a in num_list:
    total = total + a
print total

# Sum Up Even Numbers

num_list = range(0,30,3)
total = 0
for x in num_list:
    if x % 2 == 0:
        total+=x
print total

# Count even numbers
num_list = range(0,30,3)

even = 0
for x in num_list:
    if x % 2 == 0:
        even+=1
print even

Thursday, 21th June 2012

Today do programming

I know how to do, but don't know how to explain lol
Need make a program called Fortune Teller / Lucky Lucky
Take in the user's name and day, calculate lucky number & color

Wednesday, June 20, 2012

Wednesday, 20th June 2012

Today Creative Concepts
Need design a float for Chingay festival
Theme is Garden City

I never go to Chingay before, so I don't know what is it lol
Just playing along with it
Need artist for this mission lol

Made a few China quality buildings with paper and others with recycled stuffs.

Both me & Muffin feeling abit sick today
I recovered after drinking cold water & hyper for nothing
But she still sick, hope she recover soon x.x

Blackthorn Morgana

Tuesday, June 19, 2012

Practice of coding during UT clinic [ Electronegativity values difference between elements ]

The UT clinic was unhelpful to a large extent, so I practice programming on my own without any references.

a = raw_input("Please enter the 1st Electronegativity")
b = raw_input("Please enter the 2nd Electronegativity")

try:
    a = float(a)
    if a < 0:
        print "Invalid value"
        exit()

    b = float(b)
    if b < 0:
        print "Invalid value"
        exit()

except:
    print "Please enter valid float"
    exit()

if a > b:
    c = a - b
elif b > a:
    c = b - a

if c < 0.5:
    print "Difference is " + `round(c,2)`
    print "It is Non-Polar Covalent Bond"
    print "Temporary Charges"

if c > 0.5 and c < 2.0:
    print "Difference is " + `round(c,2)`
    print "It is Polar Covalent Bond"
    print "Permanent Charges"

if c > 2.0:
    print "Difference is " + `round(c,2)`
    print "It is Ionic Bond"
    print "Permanent Charges"

Electronegativity and Types of bonds

When two atoms share electrons, a covalent bond is formed.
i.    If electrons are shared more or less equally, a non-polar covalent bond exists between the atoms (e.g. H-C).

ii.    If electrons are shared unequally, a polar covalent bond exists between the atoms (e.g. H-O).













Values of the elements


Tuesday, 19th June 2012

Slept at 10 pm last night
Today woke at 7 am to buy Egg McMuffin for Muffin

Today need study the chemical properties of water
Example:
- Why does ice cube float on water
- Why is water able to dissolve various substances like salt
- Why water has a high boiling point

Notes :
Hydrogen Bonding can only occur when H is interacting with F, N or O

To determine the polar, non-polar or ionic bond.
Need calculate the difference between the elements de elctronegativity values.

Monday, June 18, 2012

Monday, 18th June 2012

Finally art of story

Lesson starts on 8.30, teacher arrive at 9

3rd meeting start at 1.30, teacher reach at 1.45 lol

Sian....

Teacher leaving soon, by end of this month
Make me wondered, who would be my new teacher?
I hope no more Cs =.=

Slept for 2 hours only last night, from 5+ to 7+ am
So tired lol, almost fell asleep on bus

After school, went Causeway Point to eat Pizza Hut
Today Darren's birthday, eat pizza to celebrate
But the offer really shitty, plus got GST & Service Charge
I think I next time eat pizza at my area better lol

Sunday, June 17, 2012

Rounding Decimal Points (Money)

Just a random code I made when got nothing to do, figured might have to count money stuffs sooner or later.

a = raw_input("First price")
b = raw_input("Second price")
c = raw_input("Third price")

try:
    a = float(a)
    if a < 0:
        print "Please enter positive values"
        exit()

    b = float(b)
    if b < 0:
        print "Please enter positive values"
        exit()

    c = float(c)
    if c < 0:
        print "Please enter positive values"
        exit()

except:
    print "Invalid"
    exit()

def ExtraCost(a,b,c):
    cost = a + b + c
    gst = cost * 0.07
    svc = cost * 0.1
    print "Intial cost is $" + `round(cost, 2)`
    print "GST is $" + `round(gst, 2)`
    print "Service charge is $" + `round(svc, 2)`
    total = cost + gst + svc
    return round(total, 2)

print "Final cost is $" + `ExtraCost(a,b,c)`

Sunday, 17th June 2012

Woke up around 4 today x.x
Last night slept too late, nothing to do today anyway
Slacking~

Think will get this on Tuesday for Muffin




Don't feel like going to school tomorrow cause I got 3 Cs from 5 lessons only =.=
Wonder what do I have to write to get B or better...

Saturday, June 16, 2012

Saturday, 16th June 2012

Woke up late today despite is 1st month with her x.x

Ate a $10 cake with her

Walked around Jcube until 9+

Went to check out all the stores in Jcube, saw some weird ones
Also saw people ice skate, kinda cool
But I still remember how I sucked in ice skating, so I won't go down to skate



Roughly like that, nothing much o.o

Friday, June 15, 2012

Friday, 15th June 2012

Today reached school quite early, around 8
Waiting for class to start x.x

Didn't change group today cause teacher forgot

Today Communication Practice need do something about Air Force 1
I lazy elaborate lol

1 word to describe, troublesome

Managed to bullshit about my reflection journal for Communication Practice
Still got Air Force de need to bullshit, why need 300 words also sia
They really will read it de meh =.=

Thursday, June 14, 2012

Reflection Journal for Programming 06

The Question (from http://bit.ly/KxmVcS) :





























The Code :

# 4 line version

for i in range(0,10,1):
    print (i*'#') + (22 - i*2) * ' ' + (i*'#')
for i in range(10,0,-1):
    print (i*'#') + (22 - i*2) * ' ' + (i*'#')


OR

# 5 line version

def hourglass(a,b,c):
    for i in range (a,b,c):
        print (i*'#') + (22 - i*2) * ' ' + (i*'#')

hourglass(0,10,1)
hourglass(10,0,-1)


Reflection : Managed to figure out how the pattern of the code should be after 10 minutes of screwing around with the codes.
I'm bad with visualizing such stuffs in my mind with program codes, hope next time don't have such troublesome question lol.


Thursday, 14th June 2012

Today programming lesson
Tio scam
Not ball, but is a moving stick
Teacher tell me is a running man, what shitty graphics is that lol


Gao~

Managed to finish today de programming target cause got help from other programmers
Hate visualizing weird things =.=


Reflection Journal also need write about codes LOL

After programming lesson, went for 2nd UT
Which is Communication Practice

Kinda easy actually, at least easier than Creative Concepts lol
At least no need think about durian and batman~

Wednesday, June 13, 2012

Wednesday, 13th June 2012

Slept at 12.30 last night, today woke up quite tired x.x
Was deep in thoughts this morning, thinking how to stop my cat escaping the house through my window.
Father thought I having troubles, asked me why am I so quiet lol

Sian, today Creative Concept need to act out
It's for overcoming stage fright

But I don't have stage fright, I have act fright x.x

Muffin came my house after school, to make notes and also study for tomorrow's UT
After we made notes for Communication Practice, I sent her back to Clementi
We went to eat Pepper Lunch and also Ice Kacang.

She ordered beef pepper lunch while I ordered the salmon one ~.~
The Ice Kacang sucks seriously lol, wonder the red bean low quality or what


Hope tomorrow can finish UT on time x.x

Tuesday, June 12, 2012

Tuesday, 12th June 2012

Reached school early & suffered in science terribly cause is chemistry topic -_-
Not gonna elaborate much about it.


Managed to do my Creative Concept UT without much difficulties, I liked the Durian & Batman part lol.
UT ended around 5.30, still got another one on Thursday x.x


Went to eat Mac Donalds with Muffin at Admiralty, also purchased a new shampoo & toothpaste.
The new shampoo states with conditioner, seems to work o.o
Can feel my hair smoother now, hope the effects last lol



Asked programming 06 problem statement from Sotong, mindfu3ked by it



Gonna die on Thursday le x.x

Monday, June 11, 2012

Monday, 11th June 2012

Woke at 5 am, unable to sleep x.x
School finally starting soon, feeling slightly uneasy (not sure why)

Reached school on 8 am, kinda early
Wonder today do what, hope I won't fall asleep ~.~

Today need do about perspective of story, my group decided on Snow White.
Need to re-write Snow White story from the view of step mother/witch.

Managed to survive today, got along with my team mates cause of random chit chat.
Talk with guys about anime stuffs, while talk with girls about bullies in school.
Today briefly taught Muffin abit of programming, also went to eat Okonomiyaki with her.
Reached home at 9, also tio bus sick from 858 -_-

Sunday, June 10, 2012

Sunday, 10th June 2012

Slept at 8 am, woke at 3 pm.


Nothing to do & tomorrow starts school le x.x
I don't mind going school, I just hate how Art of Story already gave me 3 C for 5 lessons =.=



Wanted to go find Muffin this evening, uncle suddenly came to visit.
So my father bring us go eat at a seafood restaurant

- Lobster porridge
- Fried egg with prawns
- Fried chicken
- Random vegetables

Then uncle asked me pei him walk Chong Pang to see durians, mini ones (50 cents each)

In the end buy until 16, my father took home 8.

Durians x.x

Saturday, June 9, 2012

Saturday, 09th June 2012

Woke up at near 5 pm today, nothing to do x.x

Went out to buy a new nokia phone (C1), of course black color phone
Also bought a memory card for it, price seems reasonable.
4 GB memory for $10





















Ate plain Double Cheese Burger Meal upsized
Wonder what to do next x.x

Got Shaolin Soccer English Subbed, just in case Muffin wanna watch it.

Installed Wanko to Kurasou for fun, maybe next time replay x.x

Friday, June 8, 2012

Friday, 08th June 2012

Slept at 5 am last night, I also forgot what I did.
Woke at 11 am cause pei Muffin go RP today

She gonna study for her science while I do nothing & slack


Slacked at school until 4 pm, then went to my aunt house
Think I too blur today, forgot teach her the buffet question of programming lolz

Ate together at my aunt house

- Egg
- Salmon
- Random vegetables with prawns in it

Sent Muffin to Admiralty MRT then I went back to Yishun

Bought 10 lolipops for $1, & also an emergency charger just in case my PSP or handphone runs out of battery when I'm outside.
The charger needs 2 AA batteries, that's okay with me o.o

School gonna reopen soon x.x


Just managed to get John Carter HD & Jurassic Park Trilogy ~.~

Thursday, June 7, 2012

Zoo Fare.py

Went to check my Zoo Fare.py file, realized got some flaws in my way of coding

Old Code :

adult = int(raw_input("Please key in the amount of adults : "))
children = int(raw_input("Please key in the amount of children : "))
eldery = int(raw_input("Please key in the amount of senior citizens : "))
location = raw_input("Choose Zoo or Zoo and Night Safari (ZOO/ZNS): ")
upgrade = raw_input("Upgrade to Zoo-per Saver Pass (Y/N): ")


def TotalCost(adult_ticket, child_ticket, eldery_ticket) :
    totalfare = (adult * adult_ticket) + (children * child_ticket) + (eldery * eldery_ticket)

    if (upgrade == "y" or upgrade == "yes") :
        totalprice = (adult * 7) + (children * 4) + (eldery * 7) + totalfare
        print "The total cost would be $" + str(totalprice)
        print "Would you like some fries with that?"


    elif (upgrade == "n" or upgrade == "no") :
        print "The total cost would be $" + str(totalfare)
        print "Would you like some fries with that?"


if (location == "zoo") :
        TotalCost(20,13,10)


elif (location == "zns") :
        TotalCost(42,28,26)


New Code :

adult = raw_input("Please key in the amount of adults : ")
children = raw_input("Please key in the amount of children : ")
eldery = raw_input("Please key in the amount of senior citizens : ")
location = raw_input("Choose Zoo or Zoo and Night Safari (ZOO/ZNS): ")
upgrade = raw_input("Upgrade to Zoo-per Saver Pass (Y/N): ")


try:
    adult = int(adult)
    if adult < 0:
        print "Please enter value equal or more than 0 for adults"
        exit()


    children = int(children)
    if children < 0:
        print "Please enter value equal or more than 0 for children"
        exit()


    eldery = int(eldery)
    if eldery < 0:
        print "Please enter value equal or more than 0 for eldery"
        exit()


except ValueError:
    print "Please key in the amount of people in numbers"

    exit()
upgrade = upgrade.lower()
location = location.lower()


def TotalCost(adult_ticket, child_ticket, eldery_ticket) :
    totalfare = (adult * adult_ticket) + (children * child_ticket) + (eldery * eldery_ticket)

    if (upgrade == "y" or upgrade == "yes") :
        totalprice = (adult * 7) + (children * 4) + (eldery * 7) + totalfare
        print "The total cost would be $" + `totalprice`       


    elif (upgrade == "n" or upgrade == "no") :
        print "The total cost would be $" + `totalfare`       


    else :
        print 'Please key in either Yes(Y) or No(N) for the Upgrade'


if (location == "zoo") :
        TotalCost(20,13,10)


elif (location == "zns") :
        TotalCost(42,28,26)


else :
        print 'Please key in either Zoo or Zns'


What changes has been made :
- Able to determine whether the number of people keyed in are integers, instead of strings or other weird variables
- Able to accept strings for condition upgrade == 'n' or upgrade == 'no' regardless of upper or lower case, example would be like 'nO', 'NO'.
- Display error message if the user keyed in wrong answer in any string statement.
- Found alternative to cast interger into string by typing `x` instead of the standard casting str(x)
- Fixed logical error of negative values input, resulting lesser money count or even negative results

Conclusion :
Although I'm able to detect errors & prevent my program from crashing due to unknown values being entered, my codes will become longer.
No choice but to learn this as teacher will expect our codes have no errors at all in future, just face it lol


Amount of code lines jumped from 21 to 50 lol

Thursday, 07th June 2012

Woke up around 1+ pm today
Slacked around by browsing 9gag, play counter strike & etc until 6 pm


Went to buy plain Double Cheese Burger meal, upsized for lunch, & also Froot Loops cornflakes for dinner.
The cereal had a Madagascar whistle, lion 1.
Think will give Miss Maguro that whistle ~.~




Wednesday, 06th June 2012 (Late post)

Slept at 6 am, woke at 11.30 am x.x
Only few hours of sleep & went for pizza lol

Ordered the cheesy 7 double bliss meal, kinda worth it for $26.90
Since got the cheesy pizza & also a hawaiian regular pan.
Also redeemed a personal pan hawaiian.


Muffin ate half of the cheesy pizza & gave the other half to Maguro, while I ate the regular hawaiian as brunch & personal hawaiian as dinner.

Watched Shanghai Knights with Muffin, Jackie Chan still funny lolz
Showed Muffin my old photos when I still looked nerd.
Also showed her how to play a cat with laser.


Quite a funny day o.o

Guess tomorrow will just slack, nothing to do lol
I'm not the type to do revision

Tuesday, June 5, 2012

Tuesday, 05th June 2012 [Holidays de Programming Homework]

Almost forgot to do my programming homework lol
Slacked too much during this 2 weeks holidays x.x


Lazy study for UT, think will just briefly go through what I learnt so far when I got the mood.

Managed to complete my programming homework within 30 minutes, but also spent 15 minutes finding my printer's driver.
I lazy write out my codes on paper, might as well just print them out.


=====================================================================

Q1 - Writing function

def handlebars (X1,X2):
    return "--" + X1 + "--" + X2 + "--"


print handlebars('me','you')
print handlebars('love','hate')


Q2 - Printing Area of Rectangle

def area (width, height):
    area = width * height
    return area


print area(5,6)

Q3 - Returning Area of Rectangle

def area (width, height):
    area = width * height
    return area


print area(5,6)

Q4 - More about areas

def cube(x):
    area = x * x
    return area


def rect(x,y):
    area = x * y
    return area


print rect(35,50) - cube(10)

I should use return value when calculating and print value when obtained result

Q5 - Function : Bigger number

def big(x,y):
    if (x > y) :
        return x
    elif (y > x):
        return y
    else :
        return "Both values are equal"


print big(10,30)
print big(-10,-30)


Q6 - Buffet Price

def getPrice(x,y):
    if(x == 'male' and y >= 12):
        return 20
    elif (x == 'male' and y < 12):
        return 12

    elif (x == 'female'and y >= 12):
        return 18
    elif (x == 'female' and y < 12):
        return 10


print getPrice("male", 15)
print getPrice("male", 10)


Q7 - Total Buffet Price

def getPrice(x,y):
    if(x == 'male' and y >= 12):
        return 20
    elif (x == 'male' and y < 12):
        return 12
    elif (x == 'female'and y >= 12):
        return 18
    elif (x == 'female' and y < 12):
       return 10


def totalPrice():
    peter = getPrice("male", 42)
    mary = getPrice("female", 42)
    alan = getPrice("male", 11)
    john = getPrice("male", 10)


    totalprice = peter + mary + alan + john
    return totalprice
print "The total price for a family outing is $" + `totalPrice()`

=====================================================================
Easy to type la, but I really hate writing everything out on my paper.
My handwriting sucks, why bother writing something that I can't recognize lol


Gonna use this blog to record what I learnt so far too, maybe summarize or make notes.

Pizza~

# Update : Edited on Thursday, 21th June 2012


Tuesday, 05th June 2012 (3 am, early morning post)

After some consideration, I think I'll resume my blogging.
I know my blog kept on pause & resume, but this is how I blog.

If you ask me why?
This is my blog, I do it my way.
There're also things that I can't blog out, or else other people will die lol

I think I will just blog about daily life stuffs, example things I need to remember or take notes of. I know I have a bad memory.