Difference between revisions of "Team G - OOP344 - 20132"

From CDOT Wiki
Jump to: navigation, search
(Programming Style)
(Blocks)
Line 14: Line 14:
 
* Do not use tab character
 
* Do not use tab character
 
=== Blocks ===
 
=== Blocks ===
 +
* '''If statement (short one-line statement):'''
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
if(condition){
+
if (condition) doSomething();  // space between if and ( )
   whatever;
+
</syntaxhighlight>
}</syntaxhighlight>
+
* '''If statement (multi-line or long one line statement):'''
 +
<syntaxhighlight lang="cpp">
 +
if (condition) {  // space between if ( ) and {
 +
  // do something // use this for short one-line statements if you'd like
 +
}
 +
</syntaxhighlight>
 +
* '''If else statement:'''
 +
<syntaxhighlight lang="cpp">
 +
if (condition) {
 +
  // do something
 +
} else if (condition) {  // notice spaces
 +
  // do something
 +
} else { // if else statements always use blocks even with short one line statements
 +
   // do something
 +
}
 +
</syntaxhighlight>
 +
 
 +
* '''While statement (short one line statements):'''
 +
<syntaxhighlight lang="cpp">
 +
while (condition) doSomething(); //notice spaces
 +
</syntaxhighlight>
 +
'''OR:'''
 +
<syntaxhighlight lang="cpp">
 +
while (condition) {
 +
  // do something
 +
}
 +
</syntaxhighlight>
 +
 
 +
*'''Function declaration:'''
 +
<syntaxhighlight lang="cpp">
 +
void doSomething(int arg1, char arg2) {  //notice spaces
 +
  // do something
 +
}
 +
</syntaxhighlight>
 +
 
 
=== Variable Naming ===
 
=== Variable Naming ===
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">

Revision as of 14:37, 18 June 2013

Modify this page to the needs of your team.
OOP344 | Weekly Schedule | Student List | Teams | Project | Student Resources

Repository

Master Status

  • Master (last pushed/being pushed) by Kevin Sidhu

Announcements

Programming Style

Will update this soon..

Indentation

  • 2 spaces for indentation
  • Do not use tab character

Blocks

  • If statement (short one-line statement):
if (condition) doSomething();  // space between if and ( )
  • If statement (multi-line or long one line statement):
if (condition) {  // space between if ( ) and {
  // do something // use this for short one-line statements if you'd like
}
  • If else statement:
if (condition) {
  // do something
} else if (condition) {  // notice spaces
  // do something
} else {  // if else statements always use blocks even with short one line statements
  // do something
}
  • While statement (short one line statements):
while (condition) doSomething();  //notice spaces

OR:

while (condition) {
  // do something
}
  • Function declaration:
void doSomething(int arg1, char arg2) {  //notice spaces
  // do something
}

Variable Naming

int main()
{
  int a = 1;
  char* bookNames;
  char bookId
  return 0;
}

Team Members

Add table rows by replacing sample table row, cell values with yours

OOP344 - Team name
First Name Last Name Section Seneca Id & email wiki id IRC nick GITHUB ID Blog URL
Kevin Sidhu B kssidhu1 Kevin Sidhu Coios Coios [http://ksidhucode.blogspot.ca/
Kevin Codes
first name last name A EmailId Xin Li IRC ID Github ID [http://YourBlogURL
Blog Name]
first name last name A EmailId Zhun Xue IRC ID Github ID [http://YourBlogURL

Blog Name]

Discussions