Sunday, August 9, 2009
Saturday, August 8, 2009
Math 128 - Algorithm
Problem: Find the smallest and the second smallest element in the sequence (s1,s2,...sn).
This is my java code for our assignment last time in Math 128.
Note: This code will only work in Sorted values in the sequence.
For example:
1 2 3 4 5 6 7 8 9 10
or
4 3 2 1
import java.util.*;
public class mi{
public static void main(String[]args){
Scanner scan = new Scanner (System.in);
System.out.print("How many numbers in the sequence? ");
int n=scan.nextInt();
int a[]=new int [n];
System.out.println();
System.out.println("*********************************");
System.out.println();
for (int x=0;xsmall2)
{
small=small2;
small2=a[y];
}
else if (smallsmall && small
{
small=small;
small2=small2;
}
}
System.out.println();
System.out.println("*********************************");
System.out.println();
System.out.println("The smallest value in the sequence is "+ small);
System.out.println("The second smallest value is " + small2);
}
}
If you want a better java program code or idea about this, you can also ask Mr. Joel "Pare" Benaldo also known as MaCuBeX.
Joel Benaldo
This is my java code for our assignment last time in Math 128.
Note: This code will only work in Sorted values in the sequence.
For example:
1 2 3 4 5 6 7 8 9 10
or
4 3 2 1
import java.util.*;
public class mi{
public static void main(String[]args){
Scanner scan = new Scanner (System.in);
System.out.print("How many numbers in the sequence? ");
int n=scan.nextInt();
int a[]=new int [n];
System.out.println();
System.out.println("*********************************");
System.out.println();
for (int x=0;x
{
small=small2;
small2=a[y];
}
else if (small
{
small=small;
small2=small2;
}
System.out.println("*********************************");
System.out.println();
System.out.println("The smallest value in the sequence is "+ small);
System.out.println("The second smallest value is " + small2);
}
}
If you want a better java program code or idea about this, you can also ask Mr. Joel "Pare" Benaldo also known as MaCuBeX.
Joel Benaldo
.: Who I am :.
John Ray Deloso is my complete name.
I am 18 years old. I'm taking up BSIT (2nd year).
My current address is Purok Archie Heigths, Matiao, Mati, Davao Oriental.
I'm hoping that you will be one of my friends and because of that, you can contact me: 09295557411 - this is my mobile number. You can text or call anytime but most of the time please don't expect a reply..(hahahaha)
^^
I am friendly and approachable.
* This is me...
I really like internet surfing, mp3 downloading,
photo editing,etc. (hahaha)
-John Ray Paulin-
Wednesday, August 5, 2009
Tuesday, August 4, 2009
Real Time Remote PC Control
This is how to control remote PC by your own PC.
First, right click 'My Computer' and left click 'Properties.
Then, click the 'Remote' tab.
Just make sure that these two options are not unchecked.
And also make sure that you have the "Computer's name"
(This is for the Server or the Remote PC)
In your own PC(Viewer):
"Start"--->All Programs--->Accessories--->Communications--->Remote Desktop/Connection
And enjoy manipulating the Server or the Remote PC.
First, right click 'My Computer' and left click 'Properties.
Then, click the 'Remote' tab.
Just make sure that these two options are not unchecked.
And also make sure that you have the "Computer's name"
(This is for the Server or the Remote PC)
In your own PC(Viewer):
"Start"--->All Programs--->Accessories--->Communications--->Remote Desktop/Connection
And enjoy manipulating the Server or the Remote PC.
Subscribe to:
Posts (Atom)