Difference between revisions of "User:Andrew Daniele"

From CDOT Wiki
Jump to: navigation, search
(Other)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
== About Me ==
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|+ Contact Info
 
|+ Contact Info
Line 13: Line 14:
 
|}
 
|}
  
Programming Code of the update:<br />
+
if you need to contact me here is my schedule:<br />
----
+
(I check my emails during studying and catchup time)
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
/*sorting an array of ints*/
+
Human senecaStudent;
void ascending(int* arr, int size)
+
senecaStudent = new Human("1987-12-18", "Daniele", "Andrew");
 +
 
 +
while (senecaStudent.inSemester())
 
{
 
{
   int i;
+
   senecaStudent.wakeUp();
   int j;
+
   senecaStudent.eatBreakfast();
   int temp;
+
   senecaStudent.setAlertStatus("on");
  
   for (i = 0; i < size; i++)
+
   switch(day)
 
   {
 
   {
     for(j = i+1; j < size; j++)
+
  case 1:
     {
+
  case 2:
      if (arr[i] > arr[j])
+
  case 3:
      {
+
  case 4:
        temp = arr[i];
+
  case 5:
        arr[i] = arr[j];
+
     senecaStudent.takeBus("school", "home");
        arr[j] = temp;
+
    senecaStudent.takeBus("home", "school");
      }
+
    senecaStudent.doHomework();
     }
+
     senecaStudent.eatDinner();
 +
    senecaStudent.playWith("whiteboard");
 +
    senecaStudent.study();
 +
  break;
 +
  case 6:
 +
    senecaStudent.catchUp("school", 40); // in percent
 +
    senecaStudent.eatDinner();
 +
    senecaStudent.catchUp("school", 30);
 +
  break;
 +
  case 7:
 +
     senecaStudent.work();
 +
    senecaStudent.eatDinner(); 
 +
    senecaStudent.catchUp("school", 30);
 +
    senecaStudent.playWith("whiteboard");
 +
  break;
 
   }
 
   }
 +
  senecaStudent.setAlertStatus("off");
 +
  senecaStudent.sleep();
 +
}
 +
</syntaxhighlight>
 +
 +
== Other ==
 +
Programming Code of the update:<br />
 +
----
 +
unfortunately I wasn't able to utilize this in the assignment, but I thought I'd share. It's simple, it's elegant, it's efficient. If the user were to go past strLen+1, this would patch up NULL bytes with blanks between the string and the character inserted. This could then be displayed by the display method as it printed everything up to the first NULL byte.
 +
 +
 +
<syntaxhighlight lang="cpp">
 +
while(!editStr[--i]) // patches NULL bytes to join string
 +
{
 +
    editStr[i] = ' ';
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 22:51, 4 October 2013

About Me

Contact Info
Name Andrew Daniele
IRC adaniele87
GitHub adaniele87
Blog adaniele87
E-Mail adaniele1

if you need to contact me here is my schedule:
(I check my emails during studying and catchup time)

Human senecaStudent;
senecaStudent = new Human("1987-12-18", "Daniele", "Andrew");

while (senecaStudent.inSemester())
{
  senecaStudent.wakeUp();
  senecaStudent.eatBreakfast();
  senecaStudent.setAlertStatus("on");

  switch(day)
  {
  case 1:
  case 2:
  case 3:
  case 4:
  case 5:
    senecaStudent.takeBus("school", "home");
    senecaStudent.takeBus("home", "school");
    senecaStudent.doHomework();
    senecaStudent.eatDinner();
    senecaStudent.playWith("whiteboard");
    senecaStudent.study();
  break;
  case 6:
    senecaStudent.catchUp("school", 40); // in percent
    senecaStudent.eatDinner();
    senecaStudent.catchUp("school", 30);
  break;
  case 7:
    senecaStudent.work();
    senecaStudent.eatDinner();   
    senecaStudent.catchUp("school", 30);
    senecaStudent.playWith("whiteboard");
  break;
  }
  senecaStudent.setAlertStatus("off");
  senecaStudent.sleep();
}

Other

Programming Code of the update:


unfortunately I wasn't able to utilize this in the assignment, but I thought I'd share. It's simple, it's elegant, it's efficient. If the user were to go past strLen+1, this would patch up NULL bytes with blanks between the string and the character inserted. This could then be displayed by the display method as it printed everything up to the first NULL byte.


while(!editStr[--i]) // patches NULL bytes to join string
{
    editStr[i] = ' ';
}