Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Pseudo Codes
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
GhettoSingh




PostPosted: Tue Jun 10, 2003 9:55 pm   Post subject: Pseudo Codes

k i'm finanly done my program and nwo my teacher asks for peusdo codes. Does anyone know what they are and could they help me make them?

This is the prgm that i need the peusdo codes for:

colorback (black)
cls
for colors:1..60

var font3:int font3:= Font.New ("Algerian:18")
Font.Draw ("Calender Program Created by", 150, 200, font3, colors)
Font.Draw ("Amardeep & Mark", 200, 160, font3, colors)
delay (50)
end for
delay (9)

colorback (white)
for a:1..25
put ""
end for
color (blue)
var month : array 1 .. 12 of int := init (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
var currweekday, currweek, selectedmonth : int
var w : string
put "For which month do want to see a calender (in numbers) ?"
get selectedmonth
put "What is the first day of this month? (0 is sunday, 6 is saturday)"
get currweekday

color (brightred)
if selectedmonth = 1 then
w := "January"
elsif selectedmonth = 2 then
w := "February"
elsif selectedmonth = 3 then
w := "March"
elsif selectedmonth = 4 then
w := "April"
elsif selectedmonth = 5 then
w := "May"
elsif selectedmonth = 6 then
w := "June"
elsif selectedmonth = 7 then
w := "July"
elsif selectedmonth = 8 then
w := "August"
elsif selectedmonth = 9 then
w := "September"
elsif selectedmonth = 10 then
w := "October"
elsif selectedmonth = 11 then
w := "November"
elsif selectedmonth = 12 then
w := "December"
end if

var font1: int font1:= Font.New ("Algerian:15")
locate (8, 39 - length (w) div 2)
Font.Draw ( w,253, 275, font1, red)
locate (10, 30)
var font2: int font2:= Font.New ("Arial:10")
Font.Draw ( "S M T W T F S ", 234, 245, font2, blue)
currweek := 1
for currday : 1 .. month (selectedmonth)
locate (currweek + 10, (currweekday + 10) * 3)
put currday
if currweekday = 6 then
currweekday := 0
currweek += 1
else
currweekday += 1
end if
end for
delay (5000)
colorback (black)
cls
for colors:1..255

var font3:int font3:= Font.New ("Algerian:18")
Font.Draw ("Calender Program Created by", 150, 200, font3, colors)
Font.Draw ("Amardeep & Mark", 200, 160, font3, colors)
delay (50)
end for


if u can help that would be great
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Jun 10, 2003 10:03 pm   Post subject: (No subject)

pseudo code is "fake" code. (pseudo means "fake" is some language or another...)

basically its how those lazy teachers wish programming will be done so that they dont have to actually think whats behind that code.

in other words... its more of a natural language description of what your code does.

such as beginning of your program would look like :

draw black background then start a loop from 1 to 60. Each time through the loop, a new font variable is being decleared and text is displayed in different colors...
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
GhettoSingh




PostPosted: Tue Jun 10, 2003 10:04 pm   Post subject: (No subject)

OH so no commands?
Tony




PostPosted: Tue Jun 10, 2003 10:11 pm   Post subject: (No subject)

no

Laughing
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
GhettoSingh




PostPosted: Tue Jun 10, 2003 10:16 pm   Post subject: (No subject)

thankz bud
PaddyLong




PostPosted: Wed Jun 11, 2003 3:29 pm   Post subject: (No subject)

*cough*
naoki




PostPosted: Wed Jun 11, 2003 4:33 pm   Post subject: (No subject)

well, my teacher taught me that pseudocode was sort of mirroring normal code, except you remove all the spacing and pretty titles.
Like for your Font.Draw commands you wouldn't talk about since they're just used to make your program look pretty

You just wanna keep the code that explains the core of your program. It's just things like "elsif" become "else if" and "exit when" becomes "exit if flag". put becomes output and get becomes input

there's some more but i hate typing. pm me if u need some more help
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: