Skip to content

Instantly share code, notes, and snippets.

@jobscry
Last active September 24, 2015 13:57
Show Gist options
  • Save jobscry/758403 to your computer and use it in GitHub Desktop.
Save jobscry/758403 to your computer and use it in GitHub Desktop.
/**File name:PA2 ConvertDecimalstoBinary.java
Your name: Omar Aguilar
Instructor Name: Professor Grady
Date: 12/16/10
Class Name: UMUC 141A851
University Name: UMUC DE Asia
*/
import javax.swing.JOptionPane; //import class for JOptionalPane
public class PA3 {
public static void PA3{
int numberOfStudents;
String studentName, str;
double studentGrade;
//JOptionPane to give the user oportunity keep running the program untill they decide to stop it.
int option = JOptionPane.YES_OPTION;
//Start of Loop statements
do {
//start of JOptionPane
option = JOptionPane.showInputDialog (null, “Enter number of students:”);
//JOptionPane confimation dialog promping the user if they want to continue using the program.
option = JOptionPane.showConfirmDialog(null, “Would you like to run this probram again?”,
“Confimation”, JOptionPane.YES_NO_OPTION);
} while (option == JOptionPane.YES_OPTION);
//First Step asking user for # of students
str = JOptionPane.showInputDialog(null, "How many Student are there?);
numberOfStudents = Integer.parseInt(str);
//Second step creating two arrays one for student name and one for student grades
String[] studentName = new String[numberOfStudents];
double[] sudentGrades = new double[numberOfStudents];
//Third step loop on numberOfStudents and studentNames
str = JOptionPane.showInputDialog(null, "Enter Student Name:)
studentName[x] = str;
str = JOptionPane.showInputDialog(null, "Enter Student Grade: ");
studentGrade[x] = Integer.parseInt(str);
//Fourth step start of sort
public static void selectionSort(double[] studenGrade, string[], + studentName, string[]){
for (int i – 0; i < studentGrade.length )
}
System.exit(0); //exits
}
}
/**File name:PA2 ConvertDecimalstoBinary.java
Your name: Omar Aguilar
Instructor Name: Professor Grady
Date: 12/16/10
Class Name: UMUC 141A851
University Name: UMUC DE Asia
*/
import javax.swing.JOptionPane; //import class for JOptionalPane
public class PA3 {
public static void PA3{
int numberOfStudents;
String studentName, str;
double studentGrade;
//JOptionPane to give the user oportunity keep running the program untill they decide to stop it.
int option = JOptionPane.YES_OPTION;
//Start of Loop statements
do {
//start of JOptionPane
option = JOptionPane.showInputDialog (null, “Enter number of students:”);
//JOptionPane confimation dialog promping the user if they want to continue using the program.
option = JOptionPane.showConfirmDialog(null, “Would you like to run this probram again?”,
“Confimation”, JOptionPane.YES_NO_OPTION);
} while (option == JOptionPane.YES_OPTION);
//First Step asking user for # of students
str = JOptionPane.showInputDialog(null, "How many Student are there?);
numberOfStudents = Integer.parseInt(str);
//Second step creating two arrays one for student name and one for student grades
String[] studentName = new String[numberOfStudents];
double[] sudentGrades = new double[numberOfStudents];
//Third step loop on numberOfStudents and studentNames
str = JOptionPane.showInputDialog(null, "Enter Student Name:)
studentName[x] = str;
str = JOptionPane.showInputDialog(null, "Enter Student Grade: ");
studentGrade[x] = Integer.parseInt(str);
//Fourth step start of sort
public static void selectionSort(double[] studenGrade, string[], + studentName, string[]){
for (int i – 0; i < studentGrade.length )
}
System.exit(0); //exits
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment