Login

Welcome, Guest. Please login or register.

March 29, 2024, 06:01:58 pm

Author Topic: Try these questions, budding IT:SD candidates :)  (Read 1461 times)  Share 

0 Members and 1 Guest are viewing this topic.

excal

  • VN Security
  • Victorian
  • ATAR Notes Legend
  • *******
  • Posts: 3490
  • Über-Geek
  • Respect: +21
Try these questions, budding IT:SD candidates :)
« on: October 14, 2008, 10:52:03 am »
0
These are taken from a university-level programming subject, just to give you a taste of how capable you guys will probably have become after your year of IT:SD.

1a. Rewrite in psuedocode the following IF statement to use nested IFs

IF (age < 18 AND duration = 2 AND fareZone ="Zone 1") THEN
      cost = 3.75
END IF

b. Explain in plain english what this psuedocode is attempting to do.

2. How many times will the following algorithm execute?

num1 = 10
num2 = 2
DO WHILE (num1 < num2)
     num1 = num1 / 2
     num2 = num2 * num2
END DO

excal (VCE 05/06) BBIS(IBL) GradCertSc(Statistics) MBBS(Hons) GCertClinUS -- current Master of Medicine candidate
Former Global Moderator

Ahmad

  • Victorian
  • Part of the furniture
  • *****
  • Posts: 1296
  • *dreamy sigh*
  • Respect: +15
Re: Try these questions, budding IT:SD candidates :)
« Reply #1 on: October 14, 2008, 12:13:05 pm »
0
I will pay 20 dollars to whoever determines, with proof, the positive integer values of n for which the code below terminates.

Code: [Select]
n = positive integer

while (n is not equal to 1)
    if (n % 2 == 1)
        n = 3*n + 1
    else
        n = n/2
    end if
end while
Mandark: Please, oh please, set me up on a date with that golden-haired angel who graces our undeserving school with her infinite beauty!

The collage of ideas. The music of reason. The poetry of thought. The canvas of logic.


cara.mel

  • Guest
Re: Try these questions, budding IT:SD candidates :)
« Reply #2 on: October 14, 2008, 12:19:42 pm »
0
1?

Ahmad

  • Victorian
  • Part of the furniture
  • *****
  • Posts: 1296
  • *dreamy sigh*
  • Respect: +15
Re: Try these questions, budding IT:SD candidates :)
« Reply #3 on: October 14, 2008, 12:39:41 pm »
0
Is that the only value? (:
Mandark: Please, oh please, set me up on a date with that golden-haired angel who graces our undeserving school with her infinite beauty!

The collage of ideas. The music of reason. The poetry of thought. The canvas of logic.


cara.mel

  • Guest
Re: Try these questions, budding IT:SD candidates :)
« Reply #4 on: October 14, 2008, 12:57:50 pm »
0
Probably not, given the fact that you've questioned me :P

2^a, where a is another positive integer
5 works as well
and 3
in fact all of them <=10 work =/
« Last Edit: October 14, 2008, 01:09:14 pm by caramel »

flame

  • Victorian
  • Adventurer
  • *
  • Posts: 19
  • Respect: 0
Re: Try these questions, budding IT:SD candidates :)
« Reply #5 on: October 20, 2008, 10:11:02 pm »
0
Ooo IT! :P

2. How many times will the following algorithm execute?

num1 = 10
num2 = 2
DO WHILE (num1 < num2)
     num1 = num1 / 2
     num2 = num2 * num2
END DO

Hmm..trick question? It shouldn't execute at all, because 10 is not lower than 2. If I'm completely wrong, let me know :D

Hopefully exam won't be too bad...but if practice exam we did was any indication, not good! Haha well did no study for that and got like 60%, so obviously a lot of cramming to come.

I vote we have some revision sessions on this forum :)