directory structure change, organize by class number as opposed to mod number
Signed-off-by: Amrit Panesar <apanesar@4195tech.com>
This commit is contained in:
1 parent
2a3d6fc042
commit
8683384387
480 files changed
+7
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -1,70 +0,0 @@
|
||||
// Amrit Panesar
|
||||
// 10/01/2012
|
||||
// Classwork #10 Page 618 Malik.
|
||||
|
||||
public class Classwork10
|
||||
{
|
||||
public static void main(String[] args) //main
|
||||
{
|
||||
int[][] alpha = new int[10][20]; //a
|
||||
|
||||
for(int[] row : alpha)
|
||||
{
|
||||
for (int coloumn : row)
|
||||
{
|
||||
coloumn = 5; //b
|
||||
}
|
||||
}
|
||||
|
||||
boolean bset = true;
|
||||
for (int[] row : alpha)
|
||||
{
|
||||
for (int coloumn : row)
|
||||
{
|
||||
if (bset)
|
||||
coloumn = 1; //c
|
||||
else
|
||||
coloumn = 2; //c
|
||||
}
|
||||
bset = false;
|
||||
}
|
||||
|
||||
int curRow = 0;
|
||||
int curCol = 1;
|
||||
alpha[0][0] = 5;
|
||||
for (int i=1; i<(10*20)-1; i++)
|
||||
{
|
||||
if (curCol == 20)
|
||||
{
|
||||
curCol = 0;
|
||||
curRow++;
|
||||
}
|
||||
if (curCol == 0)
|
||||
{
|
||||
alpha[curRow][curCol] = alpha[curRow-1][19] *2; //d
|
||||
}
|
||||
else
|
||||
{
|
||||
alpha[curRow][curCol] = alpha[curRow][curCol-1] *2; //d
|
||||
}
|
||||
curCol++;
|
||||
}
|
||||
|
||||
for (int[] row : alpha)
|
||||
{
|
||||
for (int coloumn : row)
|
||||
{
|
||||
System.out.print(coloumn + ' '); //e
|
||||
}
|
||||
System.out.println(); //e
|
||||
}
|
||||
|
||||
for (int[] row : alpha)
|
||||
{
|
||||
for (int coloumn : row)
|
||||
{
|
||||
System.out.println(coloumn + ' '); //f
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
public class DebugFive2
|
||||
// Prints odd numbers
|
||||
// Prints new line after every 10
|
||||
{
|
||||
public static void main(String[] args) throws InterruptedException
|
||||
{
|
||||
int num, count = 0;
|
||||
for(num = 1; num <= 100; num += 2)
|
||||
{
|
||||
System.out.print(" " + num);
|
||||
++count;
|
||||
if(count == 10)
|
||||
{
|
||||
count = 0;
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("End of odd numbers");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
public class DebugSeven4
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
String aString = "The sly brown fox jumped over the lazy dog";
|
||||
|
||||
int numLetters = 0;
|
||||
int stringLength = aString.length();
|
||||
|
||||
for(int i=0; i < stringLength; i++)
|
||||
{
|
||||
char ch = Character.toLowerCase(aString.charAt(i));
|
||||
|
||||
if(Character.isLetter(ch))
|
||||
numLetters++;
|
||||
}
|
||||
System.out.println("The number of letters is " + numLetters);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
public class DebugSix1
|
||||
// Start with a penny
|
||||
// Double it every day
|
||||
// How much do you have in a month?
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
double money = 0.01;
|
||||
int day = 1;
|
||||
while(day <= 31)
|
||||
{
|
||||
money = 2 * money;
|
||||
System.out.println("After day " + day +
|
||||
" you have " + money);
|
||||
day++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
public class DebugSix2
|
||||
// Print the character values
|
||||
// of 65 through 122
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
char letter;
|
||||
int a = 0;
|
||||
for(a = 65; a <= 122; a++)
|
||||
{
|
||||
letter = (char)a;
|
||||
System.out.print(" " + letter);
|
||||
if(a == 85 || a == 105)
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
|
||||
System.out.println("\nEnd of program");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
@@ -1,93 +0,0 @@
|
||||
import javax.swing.*;
|
||||
|
||||
public class FooTax
|
||||
{
|
||||
|
||||
public static void main(String[] args) //main
|
||||
{
|
||||
String sMarriage = JOptionPane.showInputDialog("Are you (S)ingle, (M)arried, or (H)ead of Houshold");
|
||||
char cSel = sMarriage.toLowerCase().charAt(0);
|
||||
double dStdDeduct = 0.00;
|
||||
if (cSel == 's')
|
||||
dStdDeduct = 157.00;
|
||||
else if (cSel == 'h')
|
||||
dStdDeduct = 314.00;
|
||||
else
|
||||
{
|
||||
// assume married.
|
||||
String sWitholding = JOptionPane.showInputDialog("How many depedendant allowances do you claim?\n(Please enter a number)");
|
||||
int iWithholdings = Integer.parseInt(sWitholding);
|
||||
if (iWithholdings < 2)
|
||||
dStdDeduct = 157.00;
|
||||
else
|
||||
dStdDeduct = 314.00;
|
||||
}
|
||||
JOptionPane.showMessageDialog(null,
|
||||
"Your Standard Deduction is: "+dStdDeduct, //message
|
||||
"Thank You", //title
|
||||
JOptionPane.INFORMATION_MESSAGE //type
|
||||
);
|
||||
String sExemptions = JOptionPane.showInputDialog("How many exemption allowances do you claim?\n(Please enter a number)");
|
||||
int iExemptions = 0;
|
||||
try
|
||||
{
|
||||
iExemptions = Integer.parseInt(sExemptions);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null,
|
||||
"Your input was incorrect, please re-run the program", //message
|
||||
"Fatal Error", //title
|
||||
JOptionPane.ERROR_MESSAGE//type
|
||||
);
|
||||
return;
|
||||
}
|
||||
double dExeDeduct = 0.00;
|
||||
switch (iExemptions)
|
||||
{
|
||||
case 0:
|
||||
dExeDeduct = 0.00;
|
||||
break;
|
||||
case 1:
|
||||
dExeDeduct = 4.68;
|
||||
break;
|
||||
case 2:
|
||||
dExeDeduct = 9.35;
|
||||
break;
|
||||
case 3:
|
||||
dExeDeduct = 14.03;
|
||||
break;
|
||||
case 4:
|
||||
dExeDeduct = 18.70;
|
||||
break;
|
||||
case 5:
|
||||
dExeDeduct = 23.38;
|
||||
break;
|
||||
case 6:
|
||||
dExeDeduct = 28.05;
|
||||
break;
|
||||
case 7:
|
||||
dExeDeduct = 32.73;
|
||||
break;
|
||||
case 8:
|
||||
dExeDeduct = 37.40;
|
||||
break;
|
||||
case 9:
|
||||
dExeDeduct = 42.08;
|
||||
break;
|
||||
case 10:
|
||||
dExeDeduct = 46.75;
|
||||
break;
|
||||
default:
|
||||
dExeDeduct = (4.68 * iExemptions);
|
||||
break;
|
||||
}
|
||||
JOptionPane.showMessageDialog(null,
|
||||
"Your exemption allowance is: "+dExeDeduct, //message
|
||||
"Thank You", //title
|
||||
JOptionPane.INFORMATION_MESSAGE //type
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
/*sdgjfalkshdfjkasdhfjkdshaflkjasdhfljksAD*/
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Foobar
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
System.out.println(calendar);
|
||||
System.out.println("HOUR: " + calendar.get(Calendar.HOUR));
|
||||
System.out.println("MINUTE: " + calendar.get(Calendar.MINUTE));
|
||||
System.out.println("SECOND: " + calendar.get(Calendar.SECOND));
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
import javax.swing.*;
|
||||
|
||||
public class IfGuidedExercise
|
||||
{
|
||||
|
||||
public static void main(String[] args) //main
|
||||
{
|
||||
String sInput = JOptionPane.showInputDialog("Please enter a phrase.");
|
||||
String input = JOptionPane.showInputDialog("Please enter a whole number.");
|
||||
int iInt01 = 0;
|
||||
try
|
||||
{
|
||||
iInt01 = Integer.parseInt(input);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null, "We're sorry, \""+input+"\" was"
|
||||
+ " an incorrect input.", "Error", JOptionPane.ERROR_MESSAGE);
|
||||
System.exit(0);
|
||||
}
|
||||
if (iInt01 == 7)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null,
|
||||
"Thank You for inputting a 7", //message
|
||||
"Thank You", //title
|
||||
JOptionPane.INFORMATION_MESSAGE //type
|
||||
);
|
||||
}
|
||||
if (iInt01 < 0)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null,
|
||||
"Thank You for inputting a negative number", //message
|
||||
"Thank You", //title
|
||||
JOptionPane.INFORMATION_MESSAGE //type
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
JOptionPane.showMessageDialog(null,
|
||||
"Thank You for inputting a positive number", //message
|
||||
"Thank You", //title
|
||||
JOptionPane.INFORMATION_MESSAGE //type
|
||||
);
|
||||
}
|
||||
if (iInt01 >= 5 && iInt01 <= 10)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null,
|
||||
"Thank You for inputting "+iInt01+", its square is: "+
|
||||
Math.pow(iInt01,2), //message
|
||||
"Thank You", //title
|
||||
JOptionPane.INFORMATION_MESSAGE //type
|
||||
);
|
||||
}
|
||||
if (sInput.equals("Green") && iInt01 == 7)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null,
|
||||
"Congradulations on your achievement!",
|
||||
"A winner is you!", //title
|
||||
JOptionPane.INFORMATION_MESSAGE //type
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
JOptionPane.showMessageDialog(null,
|
||||
"Better luck next time.",
|
||||
"Failure", //title
|
||||
JOptionPane.INFORMATION_MESSAGE //type
|
||||
);
|
||||
}
|
||||
if ((sInput.equals("White") && iInt01 == 10) ||
|
||||
(sInput.equals("Blue") && iInt01 == 11) ||
|
||||
(sInput.equals("Red")))
|
||||
{
|
||||
JOptionPane.showMessageDialog(null,
|
||||
"Great color choice",
|
||||
"Fabulous", //title
|
||||
JOptionPane.INFORMATION_MESSAGE //type
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
JOptionPane.showMessageDialog(null,
|
||||
"The color choice and number are not a pair.",
|
||||
"Not so Fabulous", //title
|
||||
JOptionPane.INFORMATION_MESSAGE //type
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
import javax.swing.*;
|
||||
|
||||
public class Iterate6897
|
||||
{
|
||||
public static void main(String[] args) //main
|
||||
{
|
||||
String input = JOptionPane.showInputDialog("Please enter a large number.");
|
||||
//System.out.println("Input Length = "+input.length());
|
||||
String sOut ="";
|
||||
int i = input.length();
|
||||
try
|
||||
{
|
||||
Long.parseLong(input);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null, "Your input \""+input+"\" was invalid."
|
||||
, "Fatal Error", JOptionPane.ERROR_MESSAGE);
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
while (i > 0)
|
||||
{
|
||||
char cBuf = input.charAt(i-1);
|
||||
sOut += "" + cBuf;
|
||||
//System.out.println(i + " - " + cBuf + " - " + sOut);
|
||||
i--;
|
||||
}
|
||||
JOptionPane.showMessageDialog(null, "The digits reversed is: "
|
||||
+sOut, "Results", JOptionPane.INFORMATION_MESSAGE);
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
import javax.swing.*;
|
||||
|
||||
public class Iterate7986
|
||||
{
|
||||
public static void main(String[] args) //main
|
||||
{
|
||||
String input = JOptionPane.showInputDialog("Please enter a large number.");
|
||||
int iInt01 = 0;
|
||||
String sOut = "";
|
||||
try
|
||||
{
|
||||
Long.parseLong(input);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null, "Your input \""+input+"\" was invalid."
|
||||
, "Fatal Error", JOptionPane.ERROR_MESSAGE);
|
||||
System.exit(1);
|
||||
}
|
||||
for (int i=0;i<=input.length()-1;i++)
|
||||
{
|
||||
char cBuf = input.charAt(i);
|
||||
sOut += cBuf + " ";
|
||||
iInt01 += Character.getNumericValue(cBuf);
|
||||
//System.out.println(cBuf + " - " + iInt01);
|
||||
}
|
||||
JOptionPane.showMessageDialog(null, "The summation of the digits is: "
|
||||
+iInt01 + "\n" + sOut, "Results", JOptionPane.INFORMATION_MESSAGE);
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
@@ -1,158 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Class Name: PhoneThing *
|
||||
* Author: Amrit Panesar -ASP ,o/ *
|
||||
* Last Edited: 09/12/2012 *
|
||||
* Purpose: Takes input from a user in the form of a phone number, *
|
||||
* validate input, convert from number to letters, allow numbers *
|
||||
* from input to pass-thru, and ignore any whitespace/special *
|
||||
* characters from user input. *
|
||||
******************************************************************************/
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
public class PhoneThing
|
||||
{
|
||||
public static void main(String[] args) //main
|
||||
{
|
||||
String sN00="", sN01="", sN02="abc", sN03="def", sN04="ghi",
|
||||
sN05="jkl", sN06="mno", sN07="pqrs", sN08="tuv", sN09="wxyz";
|
||||
boolean quest = false;
|
||||
while (true)
|
||||
{
|
||||
if (quest)
|
||||
{
|
||||
int ret = JOptionPane.showConfirmDialog(null, "Do you wish to continue?",
|
||||
"Question", JOptionPane.YES_NO_OPTION);
|
||||
if ( ret == JOptionPane.NO_OPTION || ret == JOptionPane.CLOSED_OPTION)
|
||||
System.exit(0);
|
||||
}
|
||||
String input = "";
|
||||
try
|
||||
{
|
||||
input = JOptionPane.showInputDialog("Please enter a phone number.");
|
||||
input = input.toLowerCase();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
String sOut ="";
|
||||
|
||||
if (input.length() < 8)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null, "The phone number: \""
|
||||
+input+"\" was not long enough",
|
||||
"Error", JOptionPane.ERROR_MESSAGE);
|
||||
quest = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int i=0;i<=input.length()-1;i++)
|
||||
{
|
||||
char cBuf = input.charAt(i);
|
||||
if(Character.isDigit(cBuf))
|
||||
{
|
||||
sOut += cBuf;
|
||||
continue;
|
||||
}
|
||||
for (int j=0;j<=9;j++)
|
||||
{
|
||||
switch(j)
|
||||
{
|
||||
case 0:
|
||||
for(int k=0;k<=sN00.length()-1;k++)
|
||||
{
|
||||
if(sN00.charAt(k)==cBuf)
|
||||
sOut += "0";
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
for(int k=0;k<=sN01.length()-1;k++)
|
||||
{
|
||||
if(sN01.charAt(k)==cBuf)
|
||||
sOut += "1";
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
for(int k=0;k<=sN02.length()-1;k++)
|
||||
{
|
||||
if(sN02.charAt(k)==cBuf)
|
||||
sOut += "2";
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
for(int k=0;k<=sN03.length()-1;k++)
|
||||
{
|
||||
if(sN03.charAt(k)==cBuf)
|
||||
sOut += "3";
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
for(int k=0;k<=sN04.length()-1;k++)
|
||||
{
|
||||
if(sN04.charAt(k)==cBuf)
|
||||
sOut += "4";
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
for(int k=0;k<=sN05.length()-1;k++)
|
||||
{
|
||||
if(sN05.charAt(k)==cBuf)
|
||||
sOut += "5";
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
for(int k=0;k<=sN06.length()-1;k++)
|
||||
{
|
||||
if(sN06.charAt(k)==cBuf)
|
||||
sOut += "6";
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
for(int k=0;k<=sN07.length()-1;k++)
|
||||
{
|
||||
if(sN07.charAt(k)==cBuf)
|
||||
sOut += "7";
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
for(int k=0;k<=sN08.length()-1;k++)
|
||||
{
|
||||
if(sN08.charAt(k)==cBuf)
|
||||
sOut += "8";
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
for(int k=0;k<=sN09.length()-1;k++)
|
||||
{
|
||||
if(sN09.charAt(k)==cBuf)
|
||||
sOut += "9";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
System.out.println("ILLOGICAL!?");
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
String sOutput = "";
|
||||
for(int i=0;i<=sOut.length()-1;i++)
|
||||
{
|
||||
if (i <= 6)
|
||||
{
|
||||
if (i == 3)
|
||||
{
|
||||
sOutput += "-";
|
||||
}
|
||||
sOutput += sOut.charAt(i);
|
||||
}
|
||||
}
|
||||
JOptionPane.showMessageDialog(null, "The converted phone number is: "
|
||||
+sOutput, "Results", JOptionPane.INFORMATION_MESSAGE);
|
||||
quest = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
import javax.swing.*;
|
||||
|
||||
public class PosNegZed
|
||||
{
|
||||
public static void main(String[] args) //main
|
||||
{
|
||||
String input = JOptionPane.showInputDialog("Please enter a whole number.");
|
||||
int iInt01 = 0;
|
||||
try
|
||||
{
|
||||
iInt01 = Integer.parseInt(input);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null, "We're sorry, \""+input+"\" was"
|
||||
+ " an incorrect input.", "Error", JOptionPane.ERROR_MESSAGE);
|
||||
System.exit(0);
|
||||
}
|
||||
if (iInt01 > 0)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null, "\""+input+"\" is positive.",
|
||||
"Thank You", JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
else if (iInt01 < 0)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null, "\""+input+"\" is negative.",
|
||||
"Thank You", JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
else if (iInt01 == 0)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null, "\""+input+"\" is zero.",
|
||||
"Thank You", JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
System.exit(0);
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,83 +0,0 @@
|
||||
import javax.swing.*;
|
||||
|
||||
public class ThreeNonDec
|
||||
{
|
||||
public static void main(String[] args) //main
|
||||
{
|
||||
String input = JOptionPane.showInputDialog("Please enter a first whole number.");
|
||||
int iInt01 = 0;
|
||||
try
|
||||
{
|
||||
iInt01 = Integer.parseInt(input);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null, "We're sorry, \""+input+"\" was"
|
||||
+ " an incorrect input.", "Error", JOptionPane.ERROR_MESSAGE);
|
||||
System.exit(0);
|
||||
}
|
||||
input = JOptionPane.showInputDialog("Please enter a second whole number.");
|
||||
int iInt02 = 0;
|
||||
try
|
||||
{
|
||||
iInt02 = Integer.parseInt(input);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null, "We're sorry, \""+input+"\" was"
|
||||
+ " an incorrect input.", "Error", JOptionPane.ERROR_MESSAGE);
|
||||
System.exit(0);
|
||||
}
|
||||
input = JOptionPane.showInputDialog("Please enter a third whole number.");
|
||||
int iInt03 = 0;
|
||||
try
|
||||
{
|
||||
iInt03 = Integer.parseInt(input);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null, "We're sorry, \""+input+"\" was"
|
||||
+ " an incorrect input.", "Error", JOptionPane.ERROR_MESSAGE);
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
String output = "";
|
||||
if (iInt01 >= iInt02 && iInt02 >= iInt03)
|
||||
output += "" + iInt03 + ", " + iInt02 + ", " + iInt01;
|
||||
else if (iInt01 >= iInt02 || iInt02 <= iInt03)
|
||||
{
|
||||
if (iInt01 >= iInt03)
|
||||
output += "" + iInt02 + ", " + iInt03 + ", " + iInt01;
|
||||
else
|
||||
output += "" + iInt02 + ", " + iInt01 + ", " + iInt03;
|
||||
}
|
||||
else if (iInt01 <= iInt02 || iInt02 >= iInt03)
|
||||
{
|
||||
if (iInt02 <= iInt03)
|
||||
output += "" + iInt02 + ", " + iInt03 + ", " + iInt01;
|
||||
else
|
||||
output += "" + iInt02 + ", " + iInt01 + ", " + iInt03;
|
||||
}
|
||||
|
||||
JOptionPane.showMessageDialog(null, "Your numbers in nondecending order is:\n\""+output+"\"",
|
||||
"Thank You", JOptionPane.INFORMATION_MESSAGE);
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,7 +0,0 @@
|
||||
12,Circular saw ,125
|
||||
235,Cooking range ,850
|
||||
301,Table saw ,300
|
||||
302,Stapler ,49
|
||||
303,Lawn Tractor ,650
|
||||
400,Pencils (gross) ,29.95
|
||||
999,Pens(gross) ,39.95
|
||||
|
@@ -1,74 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- You may freely edit this file. See commented blocks below for -->
|
||||
<!-- some examples of how to customize the build. -->
|
||||
<!-- (If you delete it and reopen the project it will be recreated.) -->
|
||||
<!-- By default, only the Clean and Build commands use this build script. -->
|
||||
<!-- Commands such as Run, Debug, and Test only use this build script if -->
|
||||
<!-- the Compile on Save feature is turned off for the project. -->
|
||||
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
|
||||
<!-- in the project's Project Properties dialog box.-->
|
||||
<project name="btree" default="default" basedir=".">
|
||||
<description>Builds, tests, and runs the project btree.</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
<!--
|
||||
|
||||
There exist several targets which are by default empty and which can be
|
||||
used for execution of your tasks. These targets are usually executed
|
||||
before and after some main targets. They are:
|
||||
|
||||
-pre-init: called before initialization of project properties
|
||||
-post-init: called after initialization of project properties
|
||||
-pre-compile: called before javac compilation
|
||||
-post-compile: called after javac compilation
|
||||
-pre-compile-single: called before javac compilation of single file
|
||||
-post-compile-single: called after javac compilation of single file
|
||||
-pre-compile-test: called before javac compilation of JUnit tests
|
||||
-post-compile-test: called after javac compilation of JUnit tests
|
||||
-pre-compile-test-single: called before javac compilation of single JUnit test
|
||||
-post-compile-test-single: called after javac compilation of single JUunit test
|
||||
-pre-jar: called before JAR building
|
||||
-post-jar: called after JAR building
|
||||
-post-clean: called after cleaning build products
|
||||
|
||||
(Targets beginning with '-' are not intended to be called on their own.)
|
||||
|
||||
Example of inserting an obfuscator after compilation could look like this:
|
||||
|
||||
<target name="-post-compile">
|
||||
<obfuscate>
|
||||
<fileset dir="${build.classes.dir}"/>
|
||||
</obfuscate>
|
||||
</target>
|
||||
|
||||
For list of available properties check the imported
|
||||
nbproject/build-impl.xml file.
|
||||
|
||||
|
||||
Another way to customize the build is by overriding existing main targets.
|
||||
The targets of interest are:
|
||||
|
||||
-init-macrodef-javac: defines macro for javac compilation
|
||||
-init-macrodef-junit: defines macro for junit execution
|
||||
-init-macrodef-debug: defines macro for class debugging
|
||||
-init-macrodef-java: defines macro for class execution
|
||||
-do-jar-with-manifest: JAR building (if you are using a manifest)
|
||||
-do-jar-without-manifest: JAR building (if you are not using a manifest)
|
||||
run: execution of project
|
||||
-javadoc-build: Javadoc generation
|
||||
test-report: JUnit report generation
|
||||
|
||||
An example of overriding the target for project execution could look like this:
|
||||
|
||||
<target name="run" depends="btree-impl.jar">
|
||||
<exec dir="bin" executable="launcher.exe">
|
||||
<arg file="${dist.jar}"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
Notice that the overridden target depends on the jar target and not only on
|
||||
the compile target as the regular run target does. Again, for a list of available
|
||||
properties which you can use, check the target you are overriding in the
|
||||
nbproject/build-impl.xml file.
|
||||
|
||||
-->
|
||||
</project>
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
========================
|
||||
BUILD OUTPUT DESCRIPTION
|
||||
========================
|
||||
|
||||
When you build an Java application project that has a main class, the IDE
|
||||
automatically copies all of the JAR
|
||||
files on the projects classpath to your projects dist/lib folder. The IDE
|
||||
also adds each of the JAR files to the Class-Path element in the application
|
||||
JAR files manifest file (MANIFEST.MF).
|
||||
|
||||
To run the project from the command line, go to the dist folder and
|
||||
type the following:
|
||||
|
||||
java -jar "btree.jar"
|
||||
|
||||
To distribute this project, zip up the dist folder (including the lib folder)
|
||||
and distribute the ZIP file.
|
||||
|
||||
Notes:
|
||||
|
||||
* If two JAR files on the project classpath have the same name, only the first
|
||||
JAR file is copied to the lib folder.
|
||||
* Only JAR files are copied to the lib folder.
|
||||
If the classpath contains other types of files or folders, these files (folders)
|
||||
are not copied.
|
||||
* If a library on the projects classpath also has a Class-Path element
|
||||
specified in the manifest,the content of the Class-Path element has to be on
|
||||
the projects runtime path.
|
||||
* To set a main class in a standard Java project, right-click the project node
|
||||
in the Projects window and choose Properties. Then click Run and enter the
|
||||
class name in the Main Class field. Alternatively, you can manually type the
|
||||
class name in the manifest Main-Class element.
|
||||
@@ -1,3 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,8 +0,0 @@
|
||||
build.xml.data.CRC32=dd7311e0
|
||||
build.xml.script.CRC32=b7790081
|
||||
build.xml.stylesheet.CRC32=28e38971@1.53.1.46
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=dd7311e0
|
||||
nbproject/build-impl.xml.script.CRC32=0f79c8dc
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=6ddba6b6@1.53.1.46
|
||||
@@ -1,2 +0,0 @@
|
||||
compile.on.save=true
|
||||
user.properties.file=C:\\Users\\Amrit\\AppData\\Roaming\\NetBeans\\7.2.1\\build.properties
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||
</project-private>
|
||||
@@ -1,71 +0,0 @@
|
||||
annotation.processing.enabled=true
|
||||
annotation.processing.enabled.in.editor=false
|
||||
annotation.processing.processor.options=
|
||||
annotation.processing.processors.list=
|
||||
annotation.processing.run.all.processors=true
|
||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||
build.classes.dir=${build.dir}/classes
|
||||
build.classes.excludes=**/*.java,**/*.form
|
||||
# This directory is removed when the project is cleaned:
|
||||
build.dir=build
|
||||
build.generated.dir=${build.dir}/generated
|
||||
build.generated.sources.dir=${build.dir}/generated-sources
|
||||
# Only compile against the classpath explicitly listed here:
|
||||
build.sysclasspath=ignore
|
||||
build.test.classes.dir=${build.dir}/test/classes
|
||||
build.test.results.dir=${build.dir}/test/results
|
||||
# Uncomment to specify the preferred debugger connection transport:
|
||||
#debug.transport=dt_socket
|
||||
debug.classpath=\
|
||||
${run.classpath}
|
||||
debug.test.classpath=\
|
||||
${run.test.classpath}
|
||||
# This directory is removed when the project is cleaned:
|
||||
dist.dir=dist
|
||||
dist.jar=${dist.dir}/btree.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
excludes=
|
||||
includes=**
|
||||
jar.compress=false
|
||||
javac.classpath=
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
javac.processorpath=\
|
||||
${javac.classpath}
|
||||
javac.source=1.7
|
||||
javac.target=1.7
|
||||
javac.test.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
javac.test.processorpath=\
|
||||
${javac.test.classpath}
|
||||
javadoc.additionalparam=
|
||||
javadoc.author=false
|
||||
javadoc.encoding=${source.encoding}
|
||||
javadoc.noindex=false
|
||||
javadoc.nonavbar=false
|
||||
javadoc.notree=false
|
||||
javadoc.private=false
|
||||
javadoc.splitindex=true
|
||||
javadoc.use=true
|
||||
javadoc.version=false
|
||||
javadoc.windowtitle=
|
||||
main.class=btree.Btree
|
||||
manifest.file=manifest.mf
|
||||
meta.inf.dir=${src.dir}/META-INF
|
||||
mkdist.disabled=false
|
||||
platform.active=default_platform
|
||||
run.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
# Space-separated list of JVM arguments used when running the project.
|
||||
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
|
||||
# To set system properties for unit tests define test-sys-prop.name=value:
|
||||
run.jvmargs=
|
||||
run.test.classpath=\
|
||||
${javac.test.classpath}:\
|
||||
${build.test.classes.dir}
|
||||
source.encoding=UTF-8
|
||||
src.dir=src
|
||||
test.src.dir=test
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.java.j2seproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
|
||||
<name>btree</name>
|
||||
<source-roots>
|
||||
<root id="src.dir"/>
|
||||
</source-roots>
|
||||
<test-roots>
|
||||
<root id="test.src.dir"/>
|
||||
</test-roots>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
@@ -1,120 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Project: btree *
|
||||
* Class Name: Btree *
|
||||
* Author: Amrit Panesar <apanesar@coleman.edu> *
|
||||
* Created On: Nov 7, 2012 *
|
||||
* Hours: X.XX Hours *
|
||||
* Purpose: TODO: Write purpose here. *
|
||||
******************************************************************************/
|
||||
|
||||
package btree;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.util.Scanner;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Amrit Panesar <apanesar@coleman.edu>
|
||||
*/
|
||||
public class Btree {
|
||||
|
||||
/**
|
||||
* @param argv the command line ARGument Vector
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
int argc = args.length;
|
||||
Scanner inFile = null;
|
||||
try {
|
||||
inFile = new Scanner(new FileReader("Product.csv"));
|
||||
} catch (FileNotFoundException ex) {
|
||||
Logger.getLogger(Btree.class.getName()).log(Level.SEVERE, null, ex);
|
||||
System.out.print("File not found, please make product.csv");
|
||||
System.exit(0);
|
||||
}
|
||||
int count = -999;
|
||||
int arrfield = 0;
|
||||
while(inFile.hasNext())
|
||||
{
|
||||
String thisrowstring = inFile.nextLine();
|
||||
String[] thisrow = thisrowstring.split(",");
|
||||
arrfield = thisrow.length;
|
||||
if (count == -999) { count = 0; }
|
||||
count++;
|
||||
}
|
||||
inFile.close();
|
||||
try {
|
||||
inFile = new Scanner(new FileReader("product.csv"));
|
||||
} catch (FileNotFoundException ex) {
|
||||
Logger.getLogger(Btree.class.getName()).log(Level.SEVERE, null, ex);
|
||||
System.out.print("File not found, please make product.csv");
|
||||
System.exit(0);
|
||||
}
|
||||
String[][] csv = new String[count][arrfield];
|
||||
Product[] p = new Product[count];
|
||||
//System.out.println("count = "+count);
|
||||
//System.out.println("arrfield = "+arrfield);
|
||||
count = 0;
|
||||
while(inFile.hasNext())
|
||||
{
|
||||
String thisrowstring = inFile.nextLine();
|
||||
String[] thisrow = thisrowstring.split(",");
|
||||
int i = 0;
|
||||
for (String t:thisrow)
|
||||
{
|
||||
csv[count][i] = t;
|
||||
i++;
|
||||
}
|
||||
p[count] = new Product(csv[count]);
|
||||
if(count == 0) {
|
||||
count++;
|
||||
continue;
|
||||
}
|
||||
Product w = p[0];
|
||||
while(true)
|
||||
{
|
||||
if(w.getiProdNumb() <= p[count].getiProdNumb())
|
||||
{
|
||||
if (w.hasLT())
|
||||
{
|
||||
w = w.getpLT();
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
w.setpLT(p[count]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (w.hasGT())
|
||||
{
|
||||
w = w.getpGT();
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
w.setpGT(p[count]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
count++;
|
||||
}
|
||||
System.out.println("Item\tDescription\tPrice");
|
||||
iot(p[0]);
|
||||
}
|
||||
public static void iot(Product theRootNode)
|
||||
{
|
||||
if (theRootNode != null) {
|
||||
iot(theRootNode.getpGT());
|
||||
System.out.println(theRootNode);
|
||||
//System.out.println("\t\\- R Sibling -> "+theRootNode.getpGT());
|
||||
//System.out.println("\t\\- L Sibling -> "+theRootNode.getpLT());
|
||||
iot(theRootNode.getpLT());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
12,Circular saw ,125
|
||||
235,Cooking range ,850
|
||||
301,Table saw ,300
|
||||
302,Stapler ,49
|
||||
303,Lawn Tractor ,650
|
||||
400,Pencils (gross) ,29.95
|
||||
999,Pens(gross) ,39.95
|
||||
|
@@ -1,118 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Project: btree *
|
||||
* Class Name: Product *
|
||||
* Author: Amrit Panesar <apanesar@coleman.edu> *
|
||||
* Created On: Nov 7, 2012 *
|
||||
* Hours: X.XX Hours *
|
||||
* Purpose: TODO: Write purpose here. *
|
||||
******************************************************************************/
|
||||
|
||||
package btree;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Amrit Panesar <apanesar@coleman.edu>
|
||||
*/
|
||||
public class Product {
|
||||
|
||||
private int iProdNumb;
|
||||
private String sDescrpt;
|
||||
private double dPrice;
|
||||
private Product pGT = null;
|
||||
private Product pLT = null;
|
||||
|
||||
public Product(int iProdNumb, String sDescrpt, double dPrice) {
|
||||
this.iProdNumb = iProdNumb;
|
||||
this.sDescrpt = sDescrpt;
|
||||
this.dPrice = dPrice;
|
||||
}
|
||||
|
||||
public Product(String[] arr) {
|
||||
if(arr.length == 3)
|
||||
{
|
||||
this.iProdNumb = Integer.parseInt(arr[0]);
|
||||
this.sDescrpt = arr[1];
|
||||
this.dPrice = Double.parseDouble(arr[2]);
|
||||
}
|
||||
}
|
||||
|
||||
public Product() {
|
||||
}
|
||||
|
||||
public Product getpGT() {
|
||||
return pGT;
|
||||
}
|
||||
|
||||
public void setpGT(Product pGT) {
|
||||
this.pGT = pGT;
|
||||
}
|
||||
|
||||
public Product getpLT() {
|
||||
return pLT;
|
||||
}
|
||||
|
||||
public void setpLT(Product pLT) {
|
||||
this.pLT = pLT;
|
||||
}
|
||||
|
||||
public int getiProdNumb() {
|
||||
return iProdNumb;
|
||||
}
|
||||
|
||||
public void setiProdNumb(int iProdNumb) {
|
||||
this.iProdNumb = iProdNumb;
|
||||
}
|
||||
|
||||
public String getsDescrpt() {
|
||||
return sDescrpt;
|
||||
}
|
||||
|
||||
public void setsDescrpt(String sDescrpt) {
|
||||
this.sDescrpt = sDescrpt;
|
||||
}
|
||||
|
||||
public double getdPrice() {
|
||||
return dPrice;
|
||||
}
|
||||
|
||||
public void setdPrice(double dPrice) {
|
||||
this.dPrice = dPrice;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return this.iProdNumb+"\t"+this.sDescrpt+"\t"+this.dPrice;
|
||||
}
|
||||
|
||||
public boolean hasGT()
|
||||
{
|
||||
if(this.pGT != null) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public boolean hasLT()
|
||||
{
|
||||
if(this.pLT != null) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasChild()
|
||||
{
|
||||
if(this.pGT != null || this.pLT != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
12,Circular saw ,125
|
||||
235,Cooking range ,850
|
||||
301,Table saw ,300
|
||||
302,Stapler ,49
|
||||
303,Lawn Tractor ,650
|
||||
400,Pencils (gross) ,29.95
|
||||
999,Pens(gross) ,39.95
|
||||
|
@@ -1,74 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- You may freely edit this file. See commented blocks below for -->
|
||||
<!-- some examples of how to customize the build. -->
|
||||
<!-- (If you delete it and reopen the project it will be recreated.) -->
|
||||
<!-- By default, only the Clean and Build commands use this build script. -->
|
||||
<!-- Commands such as Run, Debug, and Test only use this build script if -->
|
||||
<!-- the Compile on Save feature is turned off for the project. -->
|
||||
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
|
||||
<!-- in the project's Project Properties dialog box.-->
|
||||
<project name="linkedlist" default="default" basedir=".">
|
||||
<description>Builds, tests, and runs the project linkedlist.</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
<!--
|
||||
|
||||
There exist several targets which are by default empty and which can be
|
||||
used for execution of your tasks. These targets are usually executed
|
||||
before and after some main targets. They are:
|
||||
|
||||
-pre-init: called before initialization of project properties
|
||||
-post-init: called after initialization of project properties
|
||||
-pre-compile: called before javac compilation
|
||||
-post-compile: called after javac compilation
|
||||
-pre-compile-single: called before javac compilation of single file
|
||||
-post-compile-single: called after javac compilation of single file
|
||||
-pre-compile-test: called before javac compilation of JUnit tests
|
||||
-post-compile-test: called after javac compilation of JUnit tests
|
||||
-pre-compile-test-single: called before javac compilation of single JUnit test
|
||||
-post-compile-test-single: called after javac compilation of single JUunit test
|
||||
-pre-jar: called before JAR building
|
||||
-post-jar: called after JAR building
|
||||
-post-clean: called after cleaning build products
|
||||
|
||||
(Targets beginning with '-' are not intended to be called on their own.)
|
||||
|
||||
Example of inserting an obfuscator after compilation could look like this:
|
||||
|
||||
<target name="-post-compile">
|
||||
<obfuscate>
|
||||
<fileset dir="${build.classes.dir}"/>
|
||||
</obfuscate>
|
||||
</target>
|
||||
|
||||
For list of available properties check the imported
|
||||
nbproject/build-impl.xml file.
|
||||
|
||||
|
||||
Another way to customize the build is by overriding existing main targets.
|
||||
The targets of interest are:
|
||||
|
||||
-init-macrodef-javac: defines macro for javac compilation
|
||||
-init-macrodef-junit: defines macro for junit execution
|
||||
-init-macrodef-debug: defines macro for class debugging
|
||||
-init-macrodef-java: defines macro for class execution
|
||||
-do-jar-with-manifest: JAR building (if you are using a manifest)
|
||||
-do-jar-without-manifest: JAR building (if you are not using a manifest)
|
||||
run: execution of project
|
||||
-javadoc-build: Javadoc generation
|
||||
test-report: JUnit report generation
|
||||
|
||||
An example of overriding the target for project execution could look like this:
|
||||
|
||||
<target name="run" depends="linkedlist-impl.jar">
|
||||
<exec dir="bin" executable="launcher.exe">
|
||||
<arg file="${dist.jar}"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
Notice that the overridden target depends on the jar target and not only on
|
||||
the compile target as the regular run target does. Again, for a list of available
|
||||
properties which you can use, check the target you are overriding in the
|
||||
nbproject/build-impl.xml file.
|
||||
|
||||
-->
|
||||
</project>
|
||||
@@ -1,32 +0,0 @@
|
||||
========================
|
||||
BUILD OUTPUT DESCRIPTION
|
||||
========================
|
||||
|
||||
When you build an Java application project that has a main class, the IDE
|
||||
automatically copies all of the JAR
|
||||
files on the projects classpath to your projects dist/lib folder. The IDE
|
||||
also adds each of the JAR files to the Class-Path element in the application
|
||||
JAR files manifest file (MANIFEST.MF).
|
||||
|
||||
To run the project from the command line, go to the dist folder and
|
||||
type the following:
|
||||
|
||||
java -jar "linkedlist.jar"
|
||||
|
||||
To distribute this project, zip up the dist folder (including the lib folder)
|
||||
and distribute the ZIP file.
|
||||
|
||||
Notes:
|
||||
|
||||
* If two JAR files on the project classpath have the same name, only the first
|
||||
JAR file is copied to the lib folder.
|
||||
* Only JAR files are copied to the lib folder.
|
||||
If the classpath contains other types of files or folders, these files (folders)
|
||||
are not copied.
|
||||
* If a library on the projects classpath also has a Class-Path element
|
||||
specified in the manifest,the content of the Class-Path element has to be on
|
||||
the projects runtime path.
|
||||
* To set a main class in a standard Java project, right-click the project node
|
||||
in the Projects window and choose Properties. Then click Run and enter the
|
||||
class name in the Main Class field. Alternatively, you can manually type the
|
||||
class name in the manifest Main-Class element.
|
||||
@@ -1,3 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,8 +0,0 @@
|
||||
build.xml.data.CRC32=eb087925
|
||||
build.xml.script.CRC32=ad128e81
|
||||
build.xml.stylesheet.CRC32=28e38971@1.53.1.46
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=eb087925
|
||||
nbproject/build-impl.xml.script.CRC32=48e23c93
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=6ddba6b6@1.53.1.46
|
||||
@@ -1,2 +0,0 @@
|
||||
compile.on.save=true
|
||||
user.properties.file=C:\\Users\\Amrit\\AppData\\Roaming\\NetBeans\\7.2.1\\build.properties
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||
</project-private>
|
||||
@@ -1,71 +0,0 @@
|
||||
annotation.processing.enabled=true
|
||||
annotation.processing.enabled.in.editor=false
|
||||
annotation.processing.processor.options=
|
||||
annotation.processing.processors.list=
|
||||
annotation.processing.run.all.processors=true
|
||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||
build.classes.dir=${build.dir}/classes
|
||||
build.classes.excludes=**/*.java,**/*.form
|
||||
# This directory is removed when the project is cleaned:
|
||||
build.dir=build
|
||||
build.generated.dir=${build.dir}/generated
|
||||
build.generated.sources.dir=${build.dir}/generated-sources
|
||||
# Only compile against the classpath explicitly listed here:
|
||||
build.sysclasspath=ignore
|
||||
build.test.classes.dir=${build.dir}/test/classes
|
||||
build.test.results.dir=${build.dir}/test/results
|
||||
# Uncomment to specify the preferred debugger connection transport:
|
||||
#debug.transport=dt_socket
|
||||
debug.classpath=\
|
||||
${run.classpath}
|
||||
debug.test.classpath=\
|
||||
${run.test.classpath}
|
||||
# This directory is removed when the project is cleaned:
|
||||
dist.dir=dist
|
||||
dist.jar=${dist.dir}/linkedlist.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
excludes=
|
||||
includes=**
|
||||
jar.compress=false
|
||||
javac.classpath=
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
javac.processorpath=\
|
||||
${javac.classpath}
|
||||
javac.source=1.7
|
||||
javac.target=1.7
|
||||
javac.test.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
javac.test.processorpath=\
|
||||
${javac.test.classpath}
|
||||
javadoc.additionalparam=
|
||||
javadoc.author=false
|
||||
javadoc.encoding=${source.encoding}
|
||||
javadoc.noindex=false
|
||||
javadoc.nonavbar=false
|
||||
javadoc.notree=false
|
||||
javadoc.private=false
|
||||
javadoc.splitindex=true
|
||||
javadoc.use=true
|
||||
javadoc.version=false
|
||||
javadoc.windowtitle=
|
||||
main.class=linkedlist.Linkedlist
|
||||
manifest.file=manifest.mf
|
||||
meta.inf.dir=${src.dir}/META-INF
|
||||
mkdist.disabled=false
|
||||
platform.active=default_platform
|
||||
run.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
# Space-separated list of JVM arguments used when running the project.
|
||||
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
|
||||
# To set system properties for unit tests define test-sys-prop.name=value:
|
||||
run.jvmargs=
|
||||
run.test.classpath=\
|
||||
${javac.test.classpath}:\
|
||||
${build.test.classes.dir}
|
||||
source.encoding=UTF-8
|
||||
src.dir=src
|
||||
test.src.dir=test
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.java.j2seproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
|
||||
<name>linkedlist</name>
|
||||
<source-roots>
|
||||
<root id="src.dir"/>
|
||||
</source-roots>
|
||||
<test-roots>
|
||||
<root id="test.src.dir"/>
|
||||
</test-roots>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package linkedlist;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.util.Scanner;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Amrit Panesar <apanesar@coleman.edu>
|
||||
*/
|
||||
public class Linkedlist {
|
||||
|
||||
/**
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
Scanner inFile = null;
|
||||
try {
|
||||
inFile = new Scanner(new FileReader("Product.csv"));
|
||||
} catch (FileNotFoundException ex) {
|
||||
Logger.getLogger(Linkedlist.class.getName()).log(Level.SEVERE, null, ex);
|
||||
System.out.print("File not found, please make product.csv");
|
||||
System.exit(0);
|
||||
}
|
||||
int count = -999;
|
||||
int arrfield = 0;
|
||||
while(inFile.hasNext())
|
||||
{
|
||||
String thisrowstring = inFile.nextLine();
|
||||
String[] thisrow = thisrowstring.split(",");
|
||||
arrfield = thisrow.length;
|
||||
if (count == -999) { count = 0; }
|
||||
count++;
|
||||
}
|
||||
inFile.close();
|
||||
try {
|
||||
inFile = new Scanner(new FileReader("product.csv"));
|
||||
} catch (FileNotFoundException ex) {
|
||||
Logger.getLogger(Linkedlist.class.getName()).log(Level.SEVERE, null, ex);
|
||||
System.out.print("File not found, please make product.csv");
|
||||
System.exit(0);
|
||||
}
|
||||
String[][] csv = new String[count][arrfield];
|
||||
Product[] p = new Product[count];
|
||||
//System.out.println("count = "+count);
|
||||
//System.out.println("arrfield = "+arrfield);
|
||||
count = 0;
|
||||
while(inFile.hasNext())
|
||||
{
|
||||
String thisrowstring = inFile.nextLine();
|
||||
String[] thisrow = thisrowstring.split(",");
|
||||
int i = 0;
|
||||
for (String t:thisrow)
|
||||
{
|
||||
csv[count][i] = t;
|
||||
i++;
|
||||
}
|
||||
p[count] = new Product(csv[count]);
|
||||
//System.out.println(p[count].sDescrpt);
|
||||
if (count != 0) { p[count-1].next = p[count]; }
|
||||
//System.out.println(p[count].next);
|
||||
count++;
|
||||
}
|
||||
System.out.println("Item\tDescription\tPrice");
|
||||
Product q = p[0];
|
||||
while(q.hasNext())
|
||||
{
|
||||
System.out.println(q);
|
||||
q=q.next;
|
||||
if(q.hasNext() == false) {
|
||||
System.out.println(q);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Project: linkedlist *
|
||||
* Class Name: Product *
|
||||
* Author: Amrit Panesar <apanesar@coleman.edu> *
|
||||
* Created On: Nov 5, 2012 *
|
||||
* Hours: X.XX Hours *
|
||||
* Purpose: TODO: Write purpose here. *
|
||||
******************************************************************************/
|
||||
|
||||
package linkedlist;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Amrit Panesar <apanesar@coleman.edu>
|
||||
*/
|
||||
public class Product {
|
||||
public int iProdNumb;
|
||||
public String sDescrpt;
|
||||
public double dPrice;
|
||||
public Product next = null;
|
||||
|
||||
public Product(int iProdNumb, String sDescrpt, double dPrice) {
|
||||
this.iProdNumb = iProdNumb;
|
||||
this.sDescrpt = sDescrpt;
|
||||
this.dPrice = dPrice;
|
||||
}
|
||||
|
||||
public Product(String[] arr) {
|
||||
if(arr.length == 3)
|
||||
{
|
||||
this.iProdNumb = Integer.parseInt(arr[0]);
|
||||
this.sDescrpt = arr[1];
|
||||
this.dPrice = Double.parseDouble(arr[2]);
|
||||
}
|
||||
}
|
||||
|
||||
public Product() {
|
||||
}
|
||||
|
||||
public int getiProdNumb() {
|
||||
return iProdNumb;
|
||||
}
|
||||
|
||||
public void setiProdNumb(int iProdNumb) {
|
||||
this.iProdNumb = iProdNumb;
|
||||
}
|
||||
|
||||
public String getsDescrpt() {
|
||||
return sDescrpt;
|
||||
}
|
||||
|
||||
public void setsDescrpt(String sDescrpt) {
|
||||
this.sDescrpt = sDescrpt;
|
||||
}
|
||||
|
||||
public double getdPrice() {
|
||||
return dPrice;
|
||||
}
|
||||
|
||||
public void setdPrice(double dPrice) {
|
||||
this.dPrice = dPrice;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return this.iProdNumb+"\t"+this.sDescrpt+"\t"+this.dPrice;
|
||||
}
|
||||
|
||||
public boolean hasNext()
|
||||
{
|
||||
if (this.next != null) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GradeBook", "GradeBook\GradeBook.vcproj", "{AAD23839-E090-4DDA-A726-ED863081E9F4}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{AAD23839-E090-4DDA-A726-ED863081E9F4}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{AAD23839-E090-4DDA-A726-ED863081E9F4}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{AAD23839-E090-4DDA-A726-ED863081E9F4}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{AAD23839-E090-4DDA-A726-ED863081E9F4}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,16 +0,0 @@
|
||||
#include "GradeBook.h"
|
||||
|
||||
void GradeBook::setcourseName(string cName)
|
||||
{
|
||||
courseName = cName;
|
||||
}
|
||||
|
||||
string GradeBook::getcourseName()
|
||||
{
|
||||
return courseName;
|
||||
}
|
||||
|
||||
void GradeBook::displayMessage()
|
||||
{
|
||||
cout << "Hello! Welcome to " << GradeBook::getcourseName() << endl;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class GradeBook
|
||||
{
|
||||
string courseName;
|
||||
|
||||
public:
|
||||
void setcourseName(string c);
|
||||
string getcourseName();
|
||||
|
||||
void displayMessage();
|
||||
};
|
||||
@@ -1,192 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="GradeBook"
|
||||
ProjectGUID="{AAD23839-E090-4DDA-A726-ED863081E9F4}"
|
||||
RootNamespace="GradeBook"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
GenerateDebugInformation="true"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
GenerateDebugInformation="true"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\GradeBook.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\main.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\GradeBook.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -1,11 +0,0 @@
|
||||
#include "GradeBook.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
GradeBook gb;
|
||||
|
||||
gb.setcourseName("COM 203");
|
||||
gb.displayMessage();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Player", "Player\Player.vcproj", "{0633F1D0-C0F2-494E-8F28-65407CE093E1}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0633F1D0-C0F2-494E-8F28-65407CE093E1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0633F1D0-C0F2-494E-8F28-65407CE093E1}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0633F1D0-C0F2-494E-8F28-65407CE093E1}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0633F1D0-C0F2-494E-8F28-65407CE093E1}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,19 +0,0 @@
|
||||
#include "Player.h"
|
||||
|
||||
void Player::setHealth(float fHealth)
|
||||
{
|
||||
health = fHealth;
|
||||
}
|
||||
float Player::getHealth()
|
||||
{
|
||||
return health;
|
||||
}
|
||||
|
||||
void Player::setScore(int iScore)
|
||||
{
|
||||
score = iScore;
|
||||
}
|
||||
int Player::getScore()
|
||||
{
|
||||
return score;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Player
|
||||
{
|
||||
int score;
|
||||
float health;
|
||||
|
||||
public:
|
||||
void setScore(int iScore);
|
||||
int getScore();
|
||||
|
||||
void setHealth(float fHealth);
|
||||
float getHealth();
|
||||
|
||||
void display();
|
||||
};
|
||||
@@ -1,192 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="Player"
|
||||
ProjectGUID="{0633F1D0-C0F2-494E-8F28-65407CE093E1}"
|
||||
RootNamespace="Player"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
GenerateDebugInformation="true"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
GenerateDebugInformation="true"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\main.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Player.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\Player.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -1,11 +0,0 @@
|
||||
#include "Player.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
Player player;
|
||||
player.setHealth(9999);
|
||||
player.setScore(9001);
|
||||
|
||||
cout << "Player has " << player.getHealth() << " health and a score of " << player.getScore() << endl;
|
||||
cin.get();
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Player", "Player\Player.vcproj", "{0633F1D0-C0F2-494E-8F28-65407CE093E1}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0633F1D0-C0F2-494E-8F28-65407CE093E1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0633F1D0-C0F2-494E-8F28-65407CE093E1}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0633F1D0-C0F2-494E-8F28-65407CE093E1}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0633F1D0-C0F2-494E-8F28-65407CE093E1}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,73 +0,0 @@
|
||||
#include <ctime>
|
||||
#include "Player.h"
|
||||
|
||||
Player::Player()
|
||||
{
|
||||
score = 0;
|
||||
health = 0;
|
||||
name = "";
|
||||
}
|
||||
|
||||
void Player::setHealth(float fHealth)
|
||||
{
|
||||
if (fHealth > 100)
|
||||
fHealth = 100;
|
||||
else if (fHealth < 0)
|
||||
fHealth = 0;
|
||||
|
||||
health = fHealth;
|
||||
}
|
||||
float Player::getHealth()
|
||||
{
|
||||
return health;
|
||||
}
|
||||
|
||||
int Player::getScore()
|
||||
{
|
||||
return score;
|
||||
}
|
||||
void Player::setScore(int iScore)
|
||||
{
|
||||
score = iScore;
|
||||
}
|
||||
|
||||
void Player::setName( string sName )
|
||||
{
|
||||
name = sName;
|
||||
}
|
||||
string Player::getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
void Player::display()
|
||||
{
|
||||
cout << "Player has " << getHealth() << " health and a score of " << getScore() << endl;
|
||||
}
|
||||
|
||||
void Player::run()
|
||||
{
|
||||
cout << "Would you like to play a game?\n:";
|
||||
char playG;
|
||||
cin >> playG;
|
||||
|
||||
while (playG == 'y' || playG == 'Y')
|
||||
{
|
||||
int thisScore = 0;
|
||||
int cScore = 0;
|
||||
|
||||
int wCount = 0;
|
||||
while (wCount < 5)
|
||||
{
|
||||
srand((unsigned int)time(NULL)+rand()%30+rand()%100);
|
||||
thisScore += rand() % 100 + 1;
|
||||
wCount++;
|
||||
}
|
||||
setScore(thisScore);
|
||||
|
||||
cout << "Player 1: " << getName() << ", your score is: " << getScore() << endl;
|
||||
|
||||
cout << "Would you like to play again?\n:";
|
||||
cin >> playG;
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Player
|
||||
{
|
||||
int score;
|
||||
float health;
|
||||
string name;
|
||||
|
||||
public:
|
||||
Player();
|
||||
void setScore(int iScore);
|
||||
int getScore();
|
||||
|
||||
void setHealth(float fHealth);
|
||||
float getHealth();
|
||||
|
||||
void setName(string sName);
|
||||
string getName();
|
||||
|
||||
void display();
|
||||
void run();
|
||||
};
|
||||
@@ -1,192 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="Player"
|
||||
ProjectGUID="{0633F1D0-C0F2-494E-8F28-65407CE093E1}"
|
||||
RootNamespace="Player"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
GenerateDebugInformation="true"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
GenerateDebugInformation="true"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\main.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Player.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\Player.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -1,10 +0,0 @@
|
||||
#include "Player.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
Player gus;
|
||||
gus.setName("Gus");
|
||||
gus.run();
|
||||
|
||||
cin.get();
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StudentInfo", "StudentInfo\StudentInfo.vcproj", "{2BB6D63D-A60F-4162-8F32-136AE500B238}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{2BB6D63D-A60F-4162-8F32-136AE500B238}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2BB6D63D-A60F-4162-8F32-136AE500B238}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2BB6D63D-A60F-4162-8F32-136AE500B238}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2BB6D63D-A60F-4162-8F32-136AE500B238}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,21 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class StudentInfo
|
||||
{
|
||||
string name;
|
||||
int studId;
|
||||
float grade;
|
||||
|
||||
public:
|
||||
void setName(string sName);
|
||||
string getName();
|
||||
|
||||
void setStudID(int iId);
|
||||
int getStudID();
|
||||
|
||||
void setGrade(float fGrade);
|
||||
float getGrade();
|
||||
};
|
||||
@@ -1,192 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="StudentInfo"
|
||||
ProjectGUID="{2BB6D63D-A60F-4162-8F32-136AE500B238}"
|
||||
RootNamespace="StudentInfo"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
GenerateDebugInformation="true"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
GenerateDebugInformation="true"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\main.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Studentinfo.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\StudentInfo.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -1,28 +0,0 @@
|
||||
#include "StudentInfo.h"
|
||||
|
||||
void StudentInfo::setGrade(float fGrade)
|
||||
{
|
||||
grade = fGrade;
|
||||
}
|
||||
float StudentInfo::getGrade()
|
||||
{
|
||||
return grade;
|
||||
}
|
||||
|
||||
void StudentInfo::setName(std::string sName)
|
||||
{
|
||||
name = sName;
|
||||
}
|
||||
string StudentInfo::getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
void StudentInfo::setStudID(int iId)
|
||||
{
|
||||
studId = iId;
|
||||
}
|
||||
int StudentInfo::getStudID()
|
||||
{
|
||||
return studId;
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#include "StudentInfo.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
StudentInfo info;
|
||||
info.setStudID(77260);
|
||||
info.setGrade(90);
|
||||
info.setName("Amrit");
|
||||
|
||||
cout << "ID: " << info.getStudID() << ", " << info.getName() << " has a score of: " << info.getGrade() << endl;
|
||||
cin.get();
|
||||
}
|
||||
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,9 +0,0 @@
|
||||
public class HelloWorld
|
||||
{
|
||||
public static void main (String[] args)
|
||||
{
|
||||
System.out.println("Hello World \nThis is my first Java Program.");
|
||||
System.out.println("The sum of 2 and 3 = " +5);
|
||||
System.out.println("7 + 8 = " + (7 + 8));
|
||||
}
|
||||
}
|
||||
@@ -1,257 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Project: Midterm COM 107 *
|
||||
* Class Name: $12Days *
|
||||
* Author: Amrit Panesar -ASP ,o/ *
|
||||
* Last Edited: 09/06/2012 *
|
||||
* Hours: 1.25 Hours *
|
||||
* Purpose: Creating an application that exhibit adherence to best *
|
||||
* programming practices. Effective application documentation, *
|
||||
* Effective use of whitespace for ease in software maintenance, *
|
||||
* Selection of appropriate data types using meaningful, *
|
||||
* conventional identifiers, Appropriate use of error handling, *
|
||||
* Creating simple and complex Boolean expressions to evaluate *
|
||||
* primitives and strings, Developing a single and dual *
|
||||
* alternative selection structures and linear selection *
|
||||
* structures, Using test cases to validate application output. *
|
||||
* *
|
||||
******************************************************************************/
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class $12Days
|
||||
{
|
||||
public static void main(String[] args) // main
|
||||
{
|
||||
// english words for possessive numbers.
|
||||
String sDay01 = "first", sDay02 = "second", sDay03 = "third",
|
||||
sDay04 = "fourth", sDay05 = "fifth", sDay06 = "sixth",
|
||||
sDay07 = "seventh", sDay08 = "eighth", sDay09 ="nineth",
|
||||
sDay10 = "tenth", sDay11 = "eleventh", sDay12 = "twelfth";
|
||||
|
||||
// actual verse.
|
||||
String sGift01 = "partridge in a pear tree",
|
||||
sGift02 = "turtle doves", sGift03 = "French hens",
|
||||
sGift04 = "calling birds", sGift05 = "golden rings",
|
||||
sGift06 = "geese a-laying", sGift07 = "swans a-swimming",
|
||||
sGift08 = "maids a-milking", sGift09 = "ladies dancing",
|
||||
sGift10 = "lords a-leaping", sGift11 = "pipers piping",
|
||||
sGift12 = "drummers drumming";
|
||||
|
||||
// first part of verse.
|
||||
String sNum01 = "And a ", sNum02 = "Two ", sNum03 = "Three ",
|
||||
sNum04 = "Four ", sNum05 = "Five ", sNum06 = "Six ",
|
||||
sNum07 = "Seven ", sNum08 = "Eight ", sNum09 = "Nine ",
|
||||
sNum10 = "Ten ", sNum11 = "Eleven ", sNum12 = "Twelve ";
|
||||
|
||||
//various strings that assisted with my switch structure below below.
|
||||
String sSoR01 = "On the ",
|
||||
sSor02 = " day of Christmas,\nmy true love sent to me\n",
|
||||
sFNum01 = "A ", // special case for the first instance of day 1
|
||||
sC = ",\n", // common line break
|
||||
sP = ".", // last line ending
|
||||
sE = "!"; // special case for *very* last line (day 12).
|
||||
|
||||
int iDay = 0; // start with an unsupported day, ensures validated input
|
||||
|
||||
Scanner console = new Scanner(System.in); // prompt user for input
|
||||
System.out.print("What day of Chistmas are we on?\n"
|
||||
+ "Please enter the day number.\n"
|
||||
+ ":");
|
||||
|
||||
String sInput = console.nextLine(); // Grab string input.
|
||||
System.out.println(" "); // just for visual appeal.
|
||||
try
|
||||
{
|
||||
iDay = Integer.parseInt(sInput); // see if we can parse an integer
|
||||
}
|
||||
catch (NumberFormatException ex) // bad input, not a number
|
||||
{
|
||||
System.out.println("We're sorry, \""+sInput+"\" was an invalid day.\n"
|
||||
+ "Please re-run the program.");
|
||||
System.exit(1); // error out here. bad input.
|
||||
}
|
||||
if (iDay <= 0 || iDay > 12) // not a number we support. only days 1-12;
|
||||
{
|
||||
System.out.println("We're sorry, \""+sInput+"\" was an invalid day.\n"
|
||||
+ "Please re-run the program.");
|
||||
System.exit(2); // error out here, bad input, unsupported number.
|
||||
}
|
||||
|
||||
|
||||
//this would be much easier if we knew iteration.
|
||||
String sOut = ""; // output buffer.
|
||||
switch (iDay)
|
||||
{
|
||||
case 1:
|
||||
sOut += sSoR01+sDay01+sSor02;
|
||||
sOut += sFNum01+sGift01+sP;
|
||||
break;
|
||||
case 2:
|
||||
sOut += sSoR01+sDay02+sSor02;
|
||||
sOut += sNum02+sGift02+sC;
|
||||
sOut += sNum01+sGift01+sP;
|
||||
break;
|
||||
case 3:
|
||||
sOut += sSoR01+sDay03+sSor02;
|
||||
sOut += sNum03+sGift03+sC;
|
||||
sOut += sNum02+sGift02+sC;
|
||||
sOut += sNum01+sGift01+sP;
|
||||
break;
|
||||
case 4:
|
||||
sOut += sSoR01+sDay04+sSor02;
|
||||
sOut += sNum04+sGift04+sC;
|
||||
sOut += sNum03+sGift03+sC;
|
||||
sOut += sNum02+sGift02+sC;
|
||||
sOut += sNum01+sGift01+sP;
|
||||
break;
|
||||
case 5:
|
||||
sOut += sSoR01+sDay05+sSor02;
|
||||
sOut += sNum05+sGift05+sC;
|
||||
sOut += sNum04+sGift04+sC;
|
||||
sOut += sNum03+sGift03+sC;
|
||||
sOut += sNum02+sGift02+sC;
|
||||
sOut += sNum01+sGift01+sP;
|
||||
break;
|
||||
case 6:
|
||||
sOut += sSoR01+sDay06+sSor02;
|
||||
sOut += sNum06+sGift06+sC;
|
||||
sOut += sNum05+sGift05+sC;
|
||||
sOut += sNum04+sGift04+sC;
|
||||
sOut += sNum03+sGift03+sC;
|
||||
sOut += sNum02+sGift02+sC;
|
||||
sOut += sNum01+sGift01+sP;
|
||||
break;
|
||||
case 7:
|
||||
sOut += sSoR01+sDay07+sSor02;
|
||||
sOut += sNum07+sGift07+sC;
|
||||
sOut += sNum06+sGift06+sC;
|
||||
sOut += sNum05+sGift05+sC;
|
||||
sOut += sNum04+sGift04+sC;
|
||||
sOut += sNum03+sGift03+sC;
|
||||
sOut += sNum02+sGift02+sC;
|
||||
sOut += sNum01+sGift01+sP;
|
||||
break;
|
||||
case 8:
|
||||
sOut += sSoR01+sDay08+sSor02;
|
||||
sOut += sNum08+sGift08+sC;
|
||||
sOut += sNum07+sGift07+sC;
|
||||
sOut += sNum06+sGift06+sC;
|
||||
sOut += sNum05+sGift05+sC;
|
||||
sOut += sNum04+sGift04+sC;
|
||||
sOut += sNum03+sGift03+sC;
|
||||
sOut += sNum02+sGift02+sC;
|
||||
sOut += sNum01+sGift01+sP;
|
||||
break;
|
||||
case 9:
|
||||
sOut += sSoR01+sDay09+sSor02;
|
||||
sOut += sNum09+sGift09+sC;
|
||||
sOut += sNum08+sGift08+sC;
|
||||
sOut += sNum07+sGift07+sC;
|
||||
sOut += sNum06+sGift06+sC;
|
||||
sOut += sNum05+sGift05+sC;
|
||||
sOut += sNum04+sGift04+sC;
|
||||
sOut += sNum03+sGift03+sC;
|
||||
sOut += sNum02+sGift02+sC;
|
||||
sOut += sNum01+sGift01+sP;
|
||||
break;
|
||||
case 10:
|
||||
sOut += sSoR01+sDay10+sSor02;
|
||||
sOut += sNum10+sGift10+sC;
|
||||
sOut += sNum09+sGift09+sC;
|
||||
sOut += sNum08+sGift08+sC;
|
||||
sOut += sNum07+sGift07+sC;
|
||||
sOut += sNum06+sGift06+sC;
|
||||
sOut += sNum05+sGift05+sC;
|
||||
sOut += sNum04+sGift04+sC;
|
||||
sOut += sNum03+sGift03+sC;
|
||||
sOut += sNum02+sGift02+sC;
|
||||
sOut += sNum01+sGift01+sP;
|
||||
break;
|
||||
case 11:
|
||||
sOut += sSoR01+sDay11+sSor02;
|
||||
sOut += sNum11+sGift11+sC;
|
||||
sOut += sNum10+sGift10+sC;
|
||||
sOut += sNum09+sGift09+sC;
|
||||
sOut += sNum08+sGift08+sC;
|
||||
sOut += sNum07+sGift07+sC;
|
||||
sOut += sNum06+sGift06+sC;
|
||||
sOut += sNum05+sGift05+sC;
|
||||
sOut += sNum04+sGift04+sC;
|
||||
sOut += sNum03+sGift03+sC;
|
||||
sOut += sNum02+sGift02+sC;
|
||||
sOut += sNum01+sGift01+sP;
|
||||
break;
|
||||
case 12:
|
||||
sOut += sSoR01+sDay12+sSor02;
|
||||
sOut += sNum12+sGift12+sC;
|
||||
sOut += sNum11+sGift11+sC;
|
||||
sOut += sNum10+sGift10+sC;
|
||||
sOut += sNum09+sGift09+sC;
|
||||
sOut += sNum08+sGift08+sC;
|
||||
sOut += sNum07+sGift07+sC;
|
||||
sOut += sNum06+sGift06+sC;
|
||||
sOut += sNum05+sGift05+sC;
|
||||
sOut += sNum04+sGift04+sC;
|
||||
sOut += sNum03+sGift03+sC;
|
||||
sOut += sNum02+sGift02+sC;
|
||||
sOut += sNum01+sGift01+sE;
|
||||
break;
|
||||
}
|
||||
System.out.println(sOut); // print buffer.
|
||||
System.exit(0); // we're done.
|
||||
}
|
||||
}
|
||||
|
||||
/*Program Output:
|
||||
|
||||
S:\programs\Mod1\Midterm>java $12Days
|
||||
What day of Chistmas are we on?
|
||||
Please enter the day number.
|
||||
:11
|
||||
|
||||
On the eleventh day of Christmas,
|
||||
my true love sent to me
|
||||
Eleven pipers piping,
|
||||
Ten lords a-leaping,
|
||||
Nine ladies dancing,
|
||||
Eight maids a-milking,
|
||||
Seven swans a-swimming,
|
||||
Six geese a-laying,
|
||||
Five golden rings,
|
||||
Four calling birds,
|
||||
Three French hens,
|
||||
Two turtle doves,
|
||||
And a partridge in a pear tree.
|
||||
|
||||
S:\programs\Mod1\Midterm>java $12Days
|
||||
What day of Chistmas are we on?
|
||||
Please enter the day number.
|
||||
:2
|
||||
|
||||
On the second day of Christmas,
|
||||
my true love sent to me
|
||||
Two turtle doves,
|
||||
And a partridge in a pear tree.
|
||||
|
||||
S:\programs\Mod1\Midterm>java $12Days
|
||||
What day of Chistmas are we on?
|
||||
Please enter the day number.
|
||||
:invalid input
|
||||
|
||||
We're sorry, "invalid input" was an invalid day.
|
||||
Please re-run the program.
|
||||
|
||||
S:\programs\Mod1\Midterm>java $12Days
|
||||
What day of Chistmas are we on?
|
||||
Please enter the day number.
|
||||
:5
|
||||
|
||||
On the fifth day of Christmas,
|
||||
my true love sent to me
|
||||
Five golden rings,
|
||||
Four calling birds,
|
||||
Three French hens,
|
||||
Two turtle doves,
|
||||
And a partridge in a pear tree.
|
||||
|
||||
*/
|
||||
@@ -1,51 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Project: Project 1b *
|
||||
* Class Name: Numbers *
|
||||
* Author: Amrit Panesar -ASP ,o/ *
|
||||
* Last Edited: 08/08/2012 *
|
||||
* Hours: 0.25 Hours *
|
||||
* Purpose: To declare variables, constant variables, explore promotions *
|
||||
* explicit type casting, and display the results of these *
|
||||
* activities. *
|
||||
******************************************************************************/
|
||||
|
||||
public class Numbers // direction 1
|
||||
{
|
||||
public static void main(String[] args) // main
|
||||
{
|
||||
int iNumberTwo = 765, iNumberThree = (int) 4.75, iNumberFour = 17, iNumberFive = -2; // direction a + b
|
||||
final int iNumberOne = 3; // as per directon a + c: iNumberOne must be constant
|
||||
double dRealOne = 54.3, dRealTwo = 85, dRealThree = 67.56, dRealFour = 2, dRealFive = 3.3; // direction d + e
|
||||
|
||||
System.out.println("NumberOne stores " + iNumberOne); //direction f
|
||||
System.out.println("NumberTwo stores " + iNumberTwo); //f
|
||||
System.out.println("NumberThree stores " + iNumberThree); //f
|
||||
System.out.println("NumberFour stores " + iNumberFour); //f
|
||||
System.out.println("NumberFive stores " + iNumberFive); //f
|
||||
System.out.println("RealOne stores " + dRealOne); //f
|
||||
System.out.println("RealTwo stores " + dRealTwo); //f
|
||||
System.out.println("RealThree stores " + dRealThree); //f
|
||||
System.out.println("RealFour stores " + dRealFour); //f
|
||||
System.out.println("RealFive stores " + dRealFive); //f
|
||||
System.out.println("** Number Three is type casted as an integer"); // direction g
|
||||
System.out.println("** Real Two is implicitly promoted as a double"); // direction h
|
||||
}
|
||||
}
|
||||
|
||||
/* Output:
|
||||
|
||||
E:\programs\Mod1\Project1>java Numbers
|
||||
NumberOne stores 3
|
||||
NumberTwo stores 765
|
||||
NumberThree stores 4
|
||||
NumberFour stores 17
|
||||
NumberFive stores -2
|
||||
RealOne stores 54.3
|
||||
RealTwo stores 85.0
|
||||
RealThree stores 67.56
|
||||
RealFour stores 2.0
|
||||
RealFive stores 3.3
|
||||
** Number Three is type casted as an integer
|
||||
** Real Two is implicitly promoted as a double
|
||||
|
||||
*/
|
||||
@@ -1,63 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Project: Project 1c *
|
||||
* Class Name: Numbers *
|
||||
* Author: Amrit Panesar -ASP ,o/ *
|
||||
* Last Edited: 08/09/2012 *
|
||||
* Hours: 0.25 Hours *
|
||||
* Purpose: To declare variables, constant variables, explore promotions *
|
||||
* explicit type casting, and display the results of these *
|
||||
* activities. *
|
||||
******************************************************************************/
|
||||
|
||||
public class Precedence // direction a
|
||||
{
|
||||
public static void main(String[] args) // main
|
||||
{
|
||||
int iAmFour = 4, iAmTwo = 2, iAmSeven = 7, iAmFourteen = 14, iAmEightteen = 18, iAmFive = 5, iAmOne = 1, iAmTwentyEight = 28, iAmTwenty = 20, iAmThree = 3; // direction a
|
||||
double iAmPointTwo = 0.2; // direction a
|
||||
System.out.println( iAmFour + " + " + iAmSeven + " * " + iAmFour + " = " + (iAmFour+iAmSeven*iAmFour) ); // comp 1
|
||||
System.out.println( iAmFour + " / " + iAmTwo + " * " + iAmFourteen + " = " + (iAmFour/iAmTwo*iAmFourteen) ); // comp 2
|
||||
System.out.println( iAmEightteen + " / " + iAmTwo + " + " + iAmFourteen + " / " + iAmTwo + " = " + (iAmEightteen/iAmTwo+iAmFourteen/iAmTwo) ); // comp 3
|
||||
System.out.println( iAmFour + " + " + iAmTwo + " / " + iAmFour + " - " + iAmTwo + " = " + (iAmFour+iAmTwo/iAmFour-iAmTwo) ); // comp 4
|
||||
System.out.println( iAmFive + " % " + iAmTwo + " * " + iAmFour + " / " + iAmOne + " + " + iAmFive + " = " + (iAmFive%iAmTwo*iAmFour/iAmOne+iAmFive) ); // comp 5
|
||||
System.out.println( iAmTwentyEight + " / " + iAmFive + " = " + (iAmTwentyEight/iAmFive) ); // comp 6
|
||||
System.out.println( iAmTwentyEight + " % " + iAmFive + " = " + (iAmTwentyEight%iAmFive) ); // comp 7
|
||||
System.out.println( iAmTwenty + " / ( " + iAmFour + " + " + iAmOne + " ) = " + (iAmTwenty/(iAmFour+iAmOne)) ); // comp 8
|
||||
System.out.println( "( " + iAmTwo + " + " + iAmThree + " ) * " + iAmFour + " = " + ((iAmTwo+iAmThree)*iAmFour) ); // comp 9
|
||||
System.out.println( "24 / " + iAmPointTwo + " = " + (24/iAmPointTwo) ); // comp 10
|
||||
System.out.println( "----------------------------------------------------------------------------------------" );
|
||||
System.out.println( "Order of Precedence:" ); // direction c
|
||||
System.out.println( "1) Parentheses." ); // c
|
||||
System.out.println( "2) Multiplication, Division, Modulo - Left to Right." ); // c
|
||||
System.out.println( "3) Addition, Subtraction - Left to Right." ); // c
|
||||
System.out.println( "4) Assignment - Right to Left." ); // c
|
||||
System.out.println( "Multiplicative Operators are assosciated from Left to Right" ); // direction d
|
||||
System.out.println( "Addative Operators are assosciated from Left to Right" ); // d
|
||||
System.out.println( "Assignment Operators are assosciated from Right to Left" ); // d
|
||||
}
|
||||
}
|
||||
|
||||
/* Output:
|
||||
|
||||
E:\programs\Mod1\Project1>java Precedence
|
||||
4 + 7 * 4 = 32
|
||||
4 / 2 * 14 = 28
|
||||
18 / 2 + 14 / 2 = 16
|
||||
4 + 2 / 4 - 2 = 2
|
||||
5 % 2 * 4 / 1 + 5 = 9
|
||||
28 / 5 = 5
|
||||
28 % 5 = 3
|
||||
20 / ( 4 + 1 ) = 4
|
||||
( 2 + 3 ) * 4 = 20
|
||||
24 / 0.2 = 120.0
|
||||
----------------------------------------------------------------------------------------
|
||||
Order of Precedence:
|
||||
1) Parentheses.
|
||||
2) Multiplication, Division, Modulo - Left to Right.
|
||||
3) Addition, Subtraction - Left to Right.
|
||||
4) Assignment - Right to Left.
|
||||
Multiplicative Operators are assosciated from Left to Right
|
||||
Addative Operators are assosciated from Left to Right
|
||||
Assignment Operators are assosciated from Right to Left
|
||||
|
||||
*/
|
||||
@@ -1,75 +0,0 @@
|
||||
/*********************************************
|
||||
* Program: Project 1a *
|
||||
* Author: Amrit Panesar -ASP ,o/ *
|
||||
* Last Edited: 08/07/2012 *
|
||||
* Hours: 0.20 Hours *
|
||||
* Purpose: create an application that *
|
||||
* will display two of the folowing patterns *
|
||||
* ----------------------------------------- *
|
||||
* A) a 6 pointed star *
|
||||
* B) a pine tree shape composed of pound *
|
||||
* symbols *
|
||||
* C) your initals using each inital to *
|
||||
* create a large version of that letter *
|
||||
*********************************************/
|
||||
|
||||
public class Project1a // direction I
|
||||
{
|
||||
public static void main(String[] args) // direction I
|
||||
{
|
||||
String star = "\t\t\t*\n\n\t\t * * *\n\n\t\t * * * * * *\n\n\t\t * * * * * \n"+
|
||||
"\n\t\t * * * * * *\n\n\t\t * * *\n\n\t\t\t*"; // direction A -> This is the star. It is centered.
|
||||
|
||||
String pine = "\t\t\t#\n\n\t\t # #\n\n\t\t # # #\n\n\t\t # # # #\n\n\t\t\t#"; // direction B -> Pine tree like figure. Centered as well
|
||||
|
||||
String init = "\t AAA SSSSS PPPPPP \n\t AAAAA SS PP PP \n\t AA"+
|
||||
" AA SSSSS PPPPPP \n\t AAAAAAA SS PP \n\t AA AA SSSSS PP "; // direction c -> ASP. Centered.
|
||||
|
||||
String line = "\n\n--------------------------------------------------------------------------------\n\n"; // Flush.
|
||||
System.out.print(star); // Print the star
|
||||
System.out.print(line); // flush
|
||||
System.out.print(pine); // Print the pine
|
||||
System.out.print(line); // flush
|
||||
System.out.print(init); // initals
|
||||
System.out.print("\n\n"); // don't need another flush.
|
||||
}
|
||||
}
|
||||
|
||||
/* Output:
|
||||
|
||||
E:\programs\Mod1\Project1>java Project1a
|
||||
*
|
||||
|
||||
* * *
|
||||
|
||||
* * * * * *
|
||||
|
||||
* * * * *
|
||||
|
||||
* * * * * *
|
||||
|
||||
* * *
|
||||
|
||||
*
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
#
|
||||
|
||||
# #
|
||||
|
||||
# # #
|
||||
|
||||
# # # #
|
||||
|
||||
#
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
AAA SSSSS PPPPPP
|
||||
AAAAA SS PP PP
|
||||
AA AA SSSSS PPPPPP
|
||||
AAAAAAA SS PP
|
||||
AA AA SSSSS PP
|
||||
|
||||
*/
|
||||
@@ -1,30 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Project: Project 1d *
|
||||
* Class Name: Strings *
|
||||
* Author: Amrit Panesar -ASP ,o/ *
|
||||
* Last Edited: 08/13/2012 *
|
||||
* Hours: 0.16 Hours *
|
||||
* Purpose: To declare variables, initalize, and display two strings *
|
||||
* Concarenate and display results *
|
||||
******************************************************************************/
|
||||
|
||||
public class Strings // direction 1
|
||||
{
|
||||
public static void main(String[] args) // main
|
||||
{
|
||||
String sStr1 = "String1", sStr2 = "String2", sStr3 = ""; // direction 2
|
||||
System.out.println(sStr1 + "\n" + sStr2);
|
||||
char cH0 = 'H', cE0 = 'E', cL0 = 'L', cL1 = 'L', cO0 = 'O', cSpc = ' ', cW0 = 'W', cO2 = 'O', cR0 ='R', cL3 = 'L', cD0 = 'D', cExlm = '!'; // direction 3
|
||||
sStr3 = "" + cH0 + cE0 + cL0 + cL1 + cO0 + cSpc + cW0 + cO2 + cR0 + cL3 + cD0 + cExlm + "";
|
||||
System.out.println(sStr3); // direction 3
|
||||
}
|
||||
}
|
||||
|
||||
/* Output:
|
||||
|
||||
E:\programs\Mod1\Project1>java Strings
|
||||
String1
|
||||
String2
|
||||
HELLO WORLD!
|
||||
|
||||
*/
|
||||
@@ -1,37 +0,0 @@
|
||||
/*********************************************
|
||||
* Program: Project 1a *
|
||||
* Author: Amrit Panesar -ASP ,o/ *
|
||||
* Last Edited: 08/08/2012 *
|
||||
* Hours: 0.30 Hours *
|
||||
* Purpose: create an application that *
|
||||
* will display two of the folowing patterns *
|
||||
* ----------------------------------------- *
|
||||
* A) a 6 pointed star *
|
||||
* B) a pine tree shape composed of pound *
|
||||
* symbols *
|
||||
* C) your initals using each inital to *
|
||||
* create a large version of that letter *
|
||||
*********************************************/
|
||||
|
||||
public class Project1aDub
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
String star = "\t\t\t*\t\t\t*\n\n\t\t * * *\t\t * * *\n\n\t\t * * * * * *\t\t * * * * * *\n\n\t\t"+
|
||||
" * * * * * \t\t * * * * * \n\n\t\t * * * * * *\t\t * * * * * *\n\n\t\t * * *\t\t "+
|
||||
" * * *\n\n\t\t\t*\t\t\t*"; // This is the star. It is centered.
|
||||
String pine = "\t\t\t#\t\t\t#\n\n\t\t # #\t\t # #\n\n\t\t # # #\t\t # # #\n\n\t\t # #"+
|
||||
" # #\t\t # # # #\n\n\t\t\t#\t\t\t#"; // Pine tree like figure. Centered as well
|
||||
String init = "\t AAA SSSSS PPPPPP \t AAA SSSSS PPPPPP \n\t AAAAA SS PP PP "+
|
||||
"\t AAAAA SS PP PP \n\t AA AA SSSSS PPPPPP \t AA AA SSSSS PPPPPP "+
|
||||
"\n\t AAAAAAA SS PP \t AAAAAAA SS PP \n\t AA AA SSSSS PP \t "+
|
||||
" AA AA SSSSS PP "; // ASP. Centered.
|
||||
String line = "\n\n--------------------------------------------------------------------------------\n\n"; // Flush.
|
||||
System.out.print(star); // Print the star
|
||||
System.out.print(line); // flush
|
||||
System.out.print(pine); // Print the pine
|
||||
System.out.print(line); // flush
|
||||
System.out.print(init); // initals
|
||||
System.out.print("\n\n"); // don't need another line.
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
/*********************************************
|
||||
* Program: Project 1a *
|
||||
* Author: Amrit Panesar -ASP ,o/ *
|
||||
* Last Edited: 08/08/2012 *
|
||||
* Hours: 0.30 Hours *
|
||||
* Purpose: create an application that *
|
||||
* will display two of the folowing patterns *
|
||||
* ----------------------------------------- *
|
||||
* A) a 6 pointed star *
|
||||
* B) a pine tree shape composed of pound *
|
||||
* symbols *
|
||||
* C) your initals using each inital to *
|
||||
* create a large version of that letter *
|
||||
*********************************************/
|
||||
|
||||
public class Project1aDub
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
String star = "\t\t\t*\t\t\t*\n\n\t\t * * *\t\t * * *\n\n\t\t * * * * * *\t\t * * * * * *\n\n\t\t"+
|
||||
" * * * * * \t\t * * * * * \n\n\t\t * * * * * *\t\t * * * * * *\n\n\t\t * * *\t\t "+
|
||||
" * * *\n\n\t\t\t*\t\t\t*"; // This is the star. It is centered.
|
||||
String pine = "\t\t\t#\t\t\t#\n\n\t\t # #\t\t # #\n\n\t\t # # #\t\t # # #\n\n\t\t # #"+
|
||||
" # #\t\t # # # #\n\n\t\t\t#\t\t\t#"; // Pine tree like figure. Centered as well
|
||||
String init = "\t AAA SSSSS PPPPPP \t AAA SSSSS PPPPPP \n\t AAAAA SS PP PP "+
|
||||
"\t AAAAA SS PP PP \n\t AA AA SSSSS PPPPPP \t AA AA SSSSS PPPPPP "+
|
||||
"\n\t AAAAAAA SS PP \t AAAAAAA SS PP \n\t AA AA SSSSS PP \t "+
|
||||
" AA AA SSSSS PP "; // ASP. Centered.
|
||||
String line = "\n\n--------------------------------------------------------------------------------\n\n"; // Flush.
|
||||
System.out.print(star); // Print the star
|
||||
System.out.print(line); // flush
|
||||
System.out.print(pine); // Print the pine
|
||||
System.out.print(line); // flush
|
||||
System.out.print(init); // initals
|
||||
System.out.print("\n\n"); // don't need another line.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
=================================================================================================================================
|
||||
|
||||
S:\programs\Mod1\Project1>java Project1aDub
|
||||
* *
|
||||
|
||||
* * * * * *
|
||||
|
||||
* * * * * * * * * * * *
|
||||
|
||||
* * * * * * * * * *
|
||||
|
||||
* * * * * * * * * * * *
|
||||
|
||||
* * * * * *
|
||||
|
||||
* *
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
# #
|
||||
|
||||
# # # #
|
||||
|
||||
# # # # # #
|
||||
|
||||
# # # # # # # #
|
||||
|
||||
# #
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
AAA SSSSS PPPPPP AAA SSSSS PPPPPP
|
||||
AAAAA SS PP PP AAAAA SS PP PP
|
||||
AA AA SSSSS PPPPPP AA AA SSSSS PPPPPP
|
||||
AAAAAAA SS PP AAAAAAA SS PP
|
||||
AA AA SSSSS PP AA AA SSSSS PP
|
||||
Loaded 100 of 480 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user