Archives from S:\ Drive
Good to keep around methinks
This commit is contained in:
1 parent
eadaf70b9e
commit
6dd63cc439
606 files changed
+50212
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,70 @@
|
||||
// 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
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");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
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.
@@ -0,0 +1,93 @@
|
||||
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
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/*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));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
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
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
/******************************************************************************
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
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.
@@ -0,0 +1,83 @@
|
||||
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.
@@ -0,0 +1,7 @@
|
||||
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
|
||||
|
@@ -0,0 +1,74 @@
|
||||
<?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
@@ -0,0 +1,32 @@
|
||||
========================
|
||||
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.
|
||||
@@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,8 @@
|
||||
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
|
||||
@@ -0,0 +1,2 @@
|
||||
compile.on.save=true
|
||||
user.properties.file=C:\\Users\\Amrit\\AppData\\Roaming\\NetBeans\\7.2.1\\build.properties
|
||||
@@ -0,0 +1,4 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,71 @@
|
||||
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
|
||||
@@ -0,0 +1,15 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,120 @@
|
||||
/******************************************************************************
|
||||
* 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
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
|
||||
|
@@ -0,0 +1,118 @@
|
||||
/******************************************************************************
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
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
|
||||
|
@@ -0,0 +1,74 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,32 @@
|
||||
========================
|
||||
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.
|
||||
@@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,8 @@
|
||||
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
|
||||
@@ -0,0 +1,2 @@
|
||||
compile.on.save=true
|
||||
user.properties.file=C:\\Users\\Amrit\\AppData\\Roaming\\NetBeans\\7.2.1\\build.properties
|
||||
@@ -0,0 +1,4 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,71 @@
|
||||
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
|
||||
@@ -0,0 +1,15 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
/******************************************************************************
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
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
|
||||
@@ -0,0 +1,16 @@
|
||||
#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;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class GradeBook
|
||||
{
|
||||
string courseName;
|
||||
|
||||
public:
|
||||
void setcourseName(string c);
|
||||
string getcourseName();
|
||||
|
||||
void displayMessage();
|
||||
};
|
||||
@@ -0,0 +1,192 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,11 @@
|
||||
#include "GradeBook.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
GradeBook gb;
|
||||
|
||||
gb.setcourseName("COM 203");
|
||||
gb.displayMessage();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
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
|
||||
@@ -0,0 +1,19 @@
|
||||
#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;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#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();
|
||||
};
|
||||
@@ -0,0 +1,192 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,11 @@
|
||||
#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();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
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
|
||||
@@ -0,0 +1,73 @@
|
||||
#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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#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();
|
||||
};
|
||||
@@ -0,0 +1,192 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,10 @@
|
||||
#include "Player.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
Player gus;
|
||||
gus.setName("Gus");
|
||||
gus.run();
|
||||
|
||||
cin.get();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
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
|
||||
@@ -0,0 +1,21 @@
|
||||
#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();
|
||||
};
|
||||
@@ -0,0 +1,192 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,28 @@
|
||||
#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;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#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.
Reference in new issue
Block a user