One example of cheating would be looking at another person's test and copying their answers.
An XE is a sanction for dishonesty for violating the AIP.
You can also just be given a zero for what you are doing for violating the AIP.
The AIP file is kept in the Dean's office for 6 years or until the student graduates.
One reason not to cheat is because you risk expulsion, getting a zero, or getting a failing grade.
Wednesday, September 29, 2010
Sunday, September 26, 2010
Check Sorted In Java
import java.util.*; import java.lang.*; public class Example6 { public static void main (String [] args) { int numbers[] = {1145,22242,313422,4124242,51234242,42222222}; boolean sorted = true; int k = 0; int size = numbers.length - 1; while (sorted == true && k < size) { int A1 = numbers[k]; int AN = numbers [k+1]; System.out.print (A1); System.out.println (AN); if (A1 < AN) { k++; } else { sorted = false; } } if(sorted) System.out.println("Sorted"); else System.out.println ("Not Sorted"); } }
This program will work for any set of numbers because it will check to see if the first number is less than the second number and so on and so forth until the end of the array. It will only go through the array one time so it will finish in a finite time.
Monday, September 20, 2010
Search For Number In Java
import java.util.*; public class Example3 { public static void main (String [] args) { int numbers[] = {1,2,3,4,5}; int number = 0; int k, size; boolean found = false; k = 0; while (found == false && k<5) { if (numbers[k] == number) { found=true; } else { k ++; } } if(found) System.out.println("Found"); else System.out.println ("Not Found"); } }
The program will output found if the number is found, else not found. The program ends because it goes through the list one time, matching int number to the each number in the array.
Sunday, September 12, 2010
public class Example3 { public static void main (String [] args) { int numbers[] = {174,576,3458,245}; int max = 0,i; for (i = 1; i < numbers.length; i++) { while (numbers[i]>max) { max = numbers[i]; } } System.out.println (max); } }
Assigns the first value to an integer and then goes through the array comparing the first value to the rest of the values. When a larger value is found that value becomes the max integer and is then compared until the largest variable is found. This will terminate as it goes through the array of numbers only once comparing the current max to the rest of the numbers.
Wednesday, September 1, 2010
JAVA Sort
import java.util.*; public class Example { public static void main (String[] args) { Random number = new Random(); // Generate 5 randoms numbers from 1 to 100 int number1 = number.nextInt(100); int number2 = number.nextInt(100); int number3 = number.nextInt(100); int number4 = number.nextInt(100); int number5 = number.nextInt(100); int[] numbers = new int[] {number1, number2, number3, number4, number5}; Arrays.sort(numbers); System.out.println(Arrays.toString(numbers)); } }
Subscribe to:
Posts (Atom)