MedVision ad

Software Marathon 2011 (1 Viewer)

iLazy

Member
Joined
Oct 3, 2010
Messages
74
Location
Parramatta
Gender
Male
HSC
2011
Uni Grad
2014
Distinguish between a context diagram and a data flow diagram. (4 marks)
A context diagram basically shows an overview of how a program functions by showing the flow of data, represented using two external entities and ONE process. However a dataflow diagram shows the flow of data within a program in a more detailed manner but showing the flow of data between inputs from the external entity, various processes, data storage and data that is outputted back to an external entity.
 

brent012

Webmaster
Webmaster
Joined
Feb 26, 2008
Messages
5,290
Gender
Male
HSC
2011
Oh yes, the one process part seems important in the syllabus.

Nice work in prelim :p actually even in your trials you beat me - I got 75%. How do you find the option topic? I lose most of my marks there, then in mc, then section II for little things like forgetting to put storage in a DFD or talking crap about a dot point I don't really know where I usually get 1/2 or 2/3.
Went pretty well in the option, think i made a slight mistake and lost like 1 mark in a 3-4 marker on division and i wasnt familiar with the exact twos complement subtraction method (i use a different method) which lead to problems when i had to explain why some calculation was wrong or something.

Another question: What is a scenario where direct cut over is the best implementation method?
 

gloopydoop

New Member
Joined
May 1, 2010
Messages
7
Gender
Male
HSC
2011
hello everyone,

direct cut over is used for small scale systems, were little data needs to be transferred between old/new systems

whats the difference between data validation and verification?
 

SpiralFlex

Well-Known Member
Joined
Dec 18, 2010
Messages
6,960
Gender
Female
HSC
N/A
A context diagram represents the flow of data between systems whereas a data-flow diagram represents the flow of data between processes in a particular system.

Is that seriously a 4 marker?
No. I just wanted to test you on basics they can ask if they are mean...
 

MrBrightside

Brightest Member
Joined
Jan 18, 2010
Messages
2,032
Gender
Undisclosed
HSC
N/A
Another question: What is a scenario where direct cut over is the best implementation method?
When the old program is no longer needed or fails to meet the needs of the client / user / organisation.
Also used when updates to a program must be applied. The program is temporarily taken offline to online users so that it can be maintained.

Question: Write an algorithm that would enable an extracted string to be inserted in between two other strings.

E.g. "Feeling happy", insert the word "very" to make "Feeling very happy", Index starts at 0 at F. Spaces count as an index.
 
Last edited:

_pizza

Member
Joined
Mar 31, 2011
Messages
37
Location
Space
Gender
Male
HSC
N/A
When the old program is no longer needed or fails to meet the needs of the client / user / organisation.
Also used when updates to a program must be applied. The program is temporarily taken offline to online users so that it can be maintained.

Question: Write an algorithm that would enable an extracted string to be inserted in between two other strings.

E.g. "Feeling happy", insert the word "very" to make "Feeling very happy", Index starts at 0 at F. Spaces count as an index.

Code:
BEGIN Subprogram StringLength(s : string)
  index = 0
  length = 0
  REPEAT
    length = length + 1
    increment index
  UNTIL s(index) doesn't contain a character
  Return length
END

BEGIN InsertString (OriginalString, InsertString, TempString : string, position : integer)

  index = position
  counter = 0

  WHILE index <= (StringLength(OriginalString))      // Copy the part of the original string that will appear after the inserted substring
    TempString(counter) = OriginalString(index)
    increment index
  ENDWHILE

  index = position
  counter = 0

  WHILE counter <= StringLength(InsertString)      // Insert the substring into its position, overwriting existing characters
    OriginalString(index) = InsertString(counter)
    increment counter
  ENDWHILE

  counter = 0
  WHILE counter <= StringLength(TempString)        // Append the original characters
    OriginalString(index) = TempString(counter)
    increment index
    increment counter
  ENDWHILE

END
That's from memory, and I've never done it with a 0 index start before, so its possible I've made errors.
 
Last edited:

MrBrightside

Brightest Member
Joined
Jan 18, 2010
Messages
2,032
Gender
Undisclosed
HSC
N/A
I think there is, idk where they are. I agree 100% about the independant exams haha, ive said exactly that to friends. BTW there is a slight difference between open source and public domain, open source can be released under a certain license (often GPL) which means that any derivatives of the software must be released and comply with that particular license. Public domain is 100% free to do anything with.
Open source is not in the syllabus. HNNNNGGG
 

_pizza

Member
Joined
Mar 31, 2011
Messages
37
Location
Space
Gender
Male
HSC
N/A
Oh right, and my question is a Software Dev's view of hardware question:

Describe the role of the two's complement system in the division of binary numbers within the ALU.
 

MrBrightside

Brightest Member
Joined
Jan 18, 2010
Messages
2,032
Gender
Undisclosed
HSC
N/A
Code:
BEGIN Subprogram StringLength(s : string)
  index = 0
  length = 0
  REPEAT
    length = length + 1
    increment index
  UNTIL s(index) doesn't contain a character
  Return length
END
Hey, I don't understand this concept

This is the algorithm from the excel book to find the length

Code:
BEGIN SUBPROGRAM StringLength(String)
   Index = 1
  WHILE String[Index] contains a character
      Increment Index
  ENDWHILE
      Length = Index - 1
      RETURN Length
END SUBPROGRAM StringLength
say if there are 20 items, start at 1 going to 20 = 20 items, therefore why are they subtracting 1? that would cause a one off error?

and IF I wanted to start at index = 0 what would the length code be? Length = Index + 1 ?

Also do we need to write SUBPROGRAM? I usually just write the intrinsic name of the algorithm.

and one other thing if we are swapping elements in an array how do we reference it?

Is Swap(Array[Index], Array[Index + 1]) fine?

I've seen it as Swap(Array, Index, Index + 1) is that also correct?
 

harrisony

goodbye cruel world
Joined
Jun 1, 2009
Messages
3,596
Gender
Undisclosed
HSC
N/A
It's psuedocode, there is no defined language syntax either would be fine
 

harrisony

goodbye cruel world
Joined
Jun 1, 2009
Messages
3,596
Gender
Undisclosed
HSC
N/A
hello everyone,

direct cut over is used for small scale systems, were little data needs to be transferred between old/new systems

whats the difference between data validation and verification?
validation would be making sure the types are correct, verification would be if the data is actually what you want
 

MrBrightside

Brightest Member
Joined
Jan 18, 2010
Messages
2,032
Gender
Undisclosed
HSC
N/A
Distinguish between lexical and syntactical analysis
 

_pizza

Member
Joined
Mar 31, 2011
Messages
37
Location
Space
Gender
Male
HSC
N/A
Hey, I don't understand this concept

This is the algorithm from the excel book to find the length

Code:
BEGIN SUBPROGRAM StringLength(String)
   Index = 1
  WHILE String[Index] contains a character
      Increment Index
  ENDWHILE
      Length = Index - 1
      RETURN Length
END SUBPROGRAM StringLength
say if there are 20 items, start at 1 going to 20 = 20 items, therefore why are they subtracting 1? that would cause a one off error?

and IF I wanted to start at index = 0 what would the length code be? Length = Index + 1 ?

Also do we need to write SUBPROGRAM? I usually just write the intrinsic name of the algorithm.

and one other thing if we are swapping elements in an array how do we reference it?

Is Swap(Array[Index], Array[Index + 1]) fine?

I've seen it as Swap(Array, Index, Index + 1) is that also correct?
They're subtracting 1 because of the nature of the while loop - it will stop looping when index is 1 more than the length of the string, because it is there that it finds no character. However, if you started indexing at 0, this would correct the issue, because you're essentially not counting the first character.

Swap procedures can be written however it makes sense to you in pseudocode basically, I usually just do Swap(item1, item2) and call it with the correct indices from the array I want to swap values in.

And yeah you don't have to write subprogram, I probably won't bother in the exam itself.

Hmm in hindsight I should have subtracted 1 from length before returning it also.. There's -1 mark. Still, not bad considering I've read that algorithm once in the past week. Might go memorise these now..
 
Last edited:

_pizza

Member
Joined
Mar 31, 2011
Messages
37
Location
Space
Gender
Male
HSC
N/A
Distinguish between lexical and syntactical analysis
Lexical analysis is the first stage of translating source code into executable code. It is the process of examining each word to ensure it is a valid part of the language, and involves assigning identifiers with tokens, which are stored in a symbol table, or lexicon, for reference. Reserved words will have predefined tokens, while new variables will require new tokens. Once a token has been assigned to a string of characters, each time that string appears the same token will be used. Errors that occur in this part of translation result from undeclared identifiers, incorrect naming of identifiers etc.

Syntactical analysis is the following stage of translation, in which the tokenised code is checked against the rules of the language. The code is formed into a parse tree based on the rules of the language, so that the meaning can be established, and each statement will have only one parse tree and therefore only one meaning. Errors will be generated if the code doesn't conform the syntax of the language. Type checking is carried out in this stage of translation to detect data types, and errors may be generated if type mismatches occur.
 

MrBrightside

Brightest Member
Joined
Jan 18, 2010
Messages
2,032
Gender
Undisclosed
HSC
N/A
You know for setting "Last" in an algorithm, do you set it to Last Position or Array.Length?
 

_pizza

Member
Joined
Mar 31, 2011
Messages
37
Location
Space
Gender
Male
HSC
N/A
You know for setting "Last" in an algorithm, do you set it to Last Position or Array.Length?
Well depends on the context. If its a minor aspect of a rough bit of pseudocode, just say it like it is.
Eg.

set last to the length of theArray
WHILE index <= last...

But if you've got an arrayLength subprogram to work with, then I always use it.
Eg.

set last to ArrayLength(theArray)
WHILE index <= last...

Actually lately I've just been passing arrayLength as a parameter to whatever procedure I've been writing, seems a lot nicer.
 
Last edited:

MrBrightside

Brightest Member
Joined
Jan 18, 2010
Messages
2,032
Gender
Undisclosed
HSC
N/A
Hi, about that insert string algorithm, I've come across someone's notes and they did this:

Code:
BEGIN InsertString(start,newData,array)
  temp = ExtractString(1,start - 1,array) + newData
  temp = temp + ExtractString(start,array.length,data)
  InsertString = temp
END InsertString

BEGIN ExtractString(start,length,array)
  index = start
  while index < start + length
    temp = temp + array(index)
    index = index + 1
  endwhile
  ExtractString = temp
END ExtractString


However the excel book does this:

Code:
BEGIN InsertString(InsertString, Position)
 Index = Position
 Counter = 0
 OriginalStringLength = StringLength(OriginalString)
 {Create a copy of the end of the original string}
 WHILE Index <= OriginalStringLength
  TempString[Counter] = OriginalString[Index]
  Increment Index
  Increment Counter
 ENDWHILE
 TempStringLength = Index
 {Calculate Length of Inserted String}
 Index = Position
 Counter = 0
 InsertStringLength = StringLength(InsertString)
 {Attach new string}
 WHILE Counter <= InsertStringLength
  OriginalString[Index] = InsertString[Counter]
  Increment Index
  Increment Counter
 ENDWHILE
 Counter = 0
 {Attach end of original string back onto the string}
 WHILE Counter <= TempStringLength
  OriginalString[Index] = Temp[Counter]
  Increment Index
  Increment Counter
 ENDWHILE
END InsertString
Is the 1st one still logically correct? I'm thinking of splitting the excel algorithm into subprograms.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top