Monday, October 4, 2010

HW

1. Cheating of the student next to you on a test. Copying thier answers.
2.

  • xenon: a colorless odorless inert gaseous element occurring in the earth's atmosphere in trace amounts
    wordnetweb.princeton.edu/perl/webw
  • Or a grade that you receive for a class for cheating. You receive no credit and it goes down as academic dishonesty.
3. Zero points for the project, homework, or exam.
4. Aip files are kept in the Dean's office
5. 6 years or until graduation
6. The possibility of losing all credit for that assignment.

Sunday, September 26, 2010

Check if in Order

1. Create variable A
2. Have variable A equal the first number in the list
3. Proceed to check if A is larger than the next number
4. If A is larger than any of the numbers checked Prompt No
5. If A is smaller than the checked number have it equal that number then repeat step 3
6. If A has checked all the numbers given and was never larger prompt Yes

This will work because it will test all the given numbers in order to check if they are from least to greatest. It will finish in finite time because it will only test n-1 times before it prompts yes or no. The program will terminate after it prompts the yes or no statement.

Wednesday, September 15, 2010

Number Search

1. Prompt user to enter a number to search for
2. Identify this variable as A
3. Check to see if variable A is equal to the first of the 5 random numbers
4. Repeat step 3 with the 2nd, 3rd, 4th, and 5th possible numbers
5. Display Yes if A matches any of the 5 numbers
6. If A doesn't match any of the 5 then Display no
7. Terminate Program

This will work because it's longest possible trials would be (n) or in this case 5 tests. The program terminates a match is or is not found in the first 5 tests. This means that the solution is finite as well as correct. This is the most efficient way I could find to search for a certain variable in a number sequence.

Sunday, September 12, 2010

Max Number

1. Create a variable [A]
2. Define variable [A] as an integer
3. Prompt user to enter 5 random real numbers
4. Have variable [A] copy the users first number input
5. If the next number is > [A], then [A] will replace itself with that number
6. Repeat until all numbers are tried
7. Display [A] to the user as the highest number
8. Terminate after 30 seconds

This should work in a definite amount of time given that the user has input real numbers. The only way it wouldn't work would be if the user put in letters or numbers that had decimal places. In an ideal program I would have fail safe messages that warn the user that he is inputing improper numbers. I have very limited programming knowledge up till this point and I am just starting to take C++ this semester. Hope this is good enough.

Wednesday, September 8, 2010

Pure Awesomeness! 2

I think another very efficient way of writing our program would be to do it the same way as we were in class but with the highest numbers. So instead of checking for the smallest and moving it to the front, look for the largest and move the largest number to the back. It would be just as efficient its just a different way of doing things. I tried thinking of a more efficient way to create the output but I couldn't think of one... Unless I knew what the range of numbers that were being selected for the program are.

Wednesday, August 25, 2010

Pure Awesomeness!

The biggest change for me would have to be the freedom! I get to do what I want when I want to. This is a big change but it is one for the better. The only drawback is having to set my own pace and I have to rely on myself to get my homework done. My first year doesn't seem too bad so far. Most of my classes are easy. But in the near future I think it might be a bumpy ride!

P.S.

Throwing knives and riot shields killed my love for Call of Duty permanently. Battlefield Bad Company 2 ownz.