Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Inft2051 Mobile Application Programming

Guide to referencing in program code

In this course you have been exposed to the basic concepts ofmobile application programming, but  it has been clear from the outset that much ofyour learning will be through independent search and  discovery. The project is your chance to gain a deep understanding of these concepts by applying     them to a reasonably substantial mobile app programming task. It is important that you master these concepts yourself.

 

While you are encouraged to use ideas and materials from sources beyond the course materials, you  must acknowledge assistance from these sources by ‘attributing’ it in comments in your code. These comments must clearly explain where or who the code or assistance came from, and how much help or code was provided. It is not enough to say, “we Googled this” or “we got an idea the internet” or  “a classmate helped us to get this going”.

 

Here is a detailed guide to who you can get help from and where you can get code from. Please pay  careful attention to it. In case you are not clear about the difference between getting help and getting code: getting help generally means discussing ideas, approaches, or problems, with no reference to   actual code; but it can also mean getting limited assistance with resolving specific syntax errors or    runtime errors (debugging). Getting code generally means copying and pasting, or copying in other   ways from other people’s programs, or having other people write code in your program, or closely    examining other people’s code and then rewriting and adapting it.

Assistance: who might you want help from?                                                Status

Yourself, your teammates

Highly encouraged

Your lecturer, your tutor

Encouraged

Classmates, online forums

Attribution required

Relatives, friends, other students not in this course

Attribution required

Any other sources

Attribution required

Resources: where might you want to get code from?                                  Status

Course notes and examples, your teammates

Encouraged

Books, for example C# textbooks; online sources

Attribution required

Classmates, relatives, friends, other students

Attribution required

Hired coders

Not acceptable

Any other sources

Ask the lecturer

 

Obtaining code or assistance for which attribution is required without attributing it or obtaining any code or assistance from sources marked ‘Not acceptable’, is a breach of academic integrity, and can be referred to the School Academic Conduct Officer for investigation. Furthermore,providing code or assistance that is not properly attributed is also a breach of academic integrity, and can be treated as such.

If you do receive code or assistance for any of the project, there is a specific way in which you must provide the attribution in your program. We call this a reference comment.

 

The reference should say whether it is for externally sourced code, an externally sourced algorithm, or personal assistance. It should be given a unique identifier so that its end can be clearly marked.

 

The beginning and end of each reference should be marked in a particular way that stands out from the code. In the examples below we use lines of ‘=’ symbols to do this. Each reference   should include:

•    its purpose: why was external code or assistance sought?

•    the date the code or assistance was used.

•    the source ofthe code or assistance.

•    the author of the code, if known, or the person providing assistance.

•    the url, if applicable.

•    any adaptation that was required to incorporate external code; • a brief description of assistance that was provided, if applicable.

In addition, you should provide the same information in a reference list, a separate word-processed

document, where the format is not so tightly constrained.

Here are some examples.

Comment in code:

//=============================================

// Reference A3: externally sourced algorithm

// Purpose: constrain the cursor so that it cannot leave the current form

// Date: 30 March 2018

// Source: Microsoft developer network documentation

// Author: unknown

// url: https://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(v=vs.110).aspx // Adaptation required: removed the cursor repositioning that was included in the example              //=============================================

this.Cursor = new Cursor(Cursor.Current.Handle);

Cursor.Position = new Point(Cursor.Position.X, Cursor.Position.Y); Cursor.Clip

= new Rectangle(this.Location, this.Size);

//=============================================

// End reference A3

//=============================================


Corresponding entry in reference list:

Microsoft developer network documentation, author unknown,

https://msdn.microsoft.com/enus/library/system.windows.forms.cursor.clip(v=vs.110).aspx

Explanation of how to constrain the cursor so that it cannot leave the form. Used the code provided in the documentation, but removed the code that repositioned the cursor if it had moved outside the form, as we didn’t wish to do this.

 

Comment in code:

//=============================================

// Reference C5: externally sourced code

// Purpose: get a program to respond when user clicks on a picture box

// Date: 12 May 2018

 

// Source: stackoverflow

// Author: Sergey Berezovskiy

// url: https://stackoverflow.com/ questions/13455439/adding-a-mouse-click-eventhandler-to-a-picturebox // Adaptation required: changed variable names                                                                                                          //=============================================

private void picbxBigPic_Click(object sender, EventArgs e)

{

// this is where you put the code to respond when picbxBigPic is clicked

}

//=============================================

// End reference C5

//=============================================

Corresponding entry in reference list:

Sergey Berezovskiy, stackoverflow, https://stackoverflow.com/ questions/13455439/adding-a-

mouseclick-eventhandler-to-a-picturebox

Code to recognise the event generated when user clicks in a picture box. Copied the code, changing only the variable names.

 

Comment in code:

//=============================================

// Reference P7: personal assistance

// Purpose: deal with NullPointerException error

// Date: 24 Apr 2018

// Source: fellow student Susan Piper

// Assistance: explained the need to instantiate each object in the array

//=============================================

teamMember[i] = new Player();

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

// End reference P7

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


Corresponding entry in reference list:

Susan Piper, Inft2051 student; personal assistance

We didn’t understand why we kept getting this NullPointerException, so we asked in the lab. Susan came and had a look at our code, and pointed out that we were initialising the array but not each element ofthe  array. We changed the code so that it initialised each element, and stopped getting the exceptions.