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.
@@ -0,0 +1,55 @@
|
||||
/******************************************************************************
|
||||
* Project: Project 5a *
|
||||
* Class Name: Project5a *
|
||||
* Author: Amrit Panesar -ASP ,o/ *
|
||||
* Last Edited: 10/04/2012 *
|
||||
* Hours: 0.20 Hours *
|
||||
* Purpose: demonstrate proficiency in using Counted loops, proficiency in*
|
||||
* using Sentinel controlled loops, proficiency in using Flag *
|
||||
* controlled loops, proficiency in using EOF controlled loops, *
|
||||
* proficiency in using Forever loops, providing appropriate *
|
||||
* documentation for programs, the use of conventional *
|
||||
* identifiers for classes and variables, the ability to use *
|
||||
* simple program testing techniques to ensure the quality of *
|
||||
* their work product, the use of white space for ensuring *
|
||||
* readability of program code, correct formulation of boolean *
|
||||
* expressions to be used in the control of iterative structures *
|
||||
******************************************************************************/
|
||||
import java.util.*;
|
||||
import java.io.*;
|
||||
|
||||
public class Project5a
|
||||
{
|
||||
public static void main(String[] args) // main
|
||||
{
|
||||
String sSent = "";
|
||||
Scanner inFile = null;
|
||||
Scanner console = new Scanner (System.in); //console
|
||||
String temp = "";
|
||||
while (!sSent.equals("!q"))
|
||||
{
|
||||
System.out.println("Enter a name, type !q to quit");
|
||||
temp = console.nextLine();
|
||||
sSent = temp;
|
||||
System.out.println(temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* output:
|
||||
|
||||
E:\programs\Mod1\Project5>java Project5a
|
||||
Enter a name, type !q to quit
|
||||
Blah
|
||||
Blah
|
||||
Enter a name, type !q to quit
|
||||
hjsdalkf
|
||||
hjsdalkf
|
||||
Enter a name, type !q to quit
|
||||
Neo Anderson
|
||||
Neo Anderson
|
||||
Enter a name, type !q to quit
|
||||
!q
|
||||
!q
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,117 @@
|
||||
/******************************************************************************
|
||||
* Project: Project 5b *
|
||||
* Class Name: Project5b *
|
||||
* Author: Amrit Panesar -ASP ,o/ *
|
||||
* Last Edited: 10/04/2012 *
|
||||
* Hours: 0.20 Hours *
|
||||
* Purpose: demonstrate proficiency in using Counted loops, proficiency in*
|
||||
* using Sentinel controlled loops, proficiency in using Flag *
|
||||
* controlled loops, proficiency in using EOF controlled loops, *
|
||||
* proficiency in using Forever loops, providing appropriate *
|
||||
* documentation for programs, the use of conventional *
|
||||
* identifiers for classes and variables, the ability to use *
|
||||
* simple program testing techniques to ensure the quality of *
|
||||
* their work product, the use of white space for ensuring *
|
||||
* readability of program code, correct formulation of boolean *
|
||||
* expressions to be used in the control of iterative structures *
|
||||
******************************************************************************/
|
||||
import java.util.*;
|
||||
import java.io.*;
|
||||
|
||||
public class Project5b
|
||||
{
|
||||
public static void main(String[] args) // main
|
||||
{
|
||||
Scanner inFile = null;
|
||||
try
|
||||
{
|
||||
inFile = new Scanner(new FileReader("payrollData.txt"));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.exit(0);
|
||||
}
|
||||
for (int i=0;i<5;i++)
|
||||
{
|
||||
int iEmployee = inFile.nextInt();
|
||||
char cFiling = inFile.next().charAt(0);
|
||||
int iWHold = inFile.nextInt();
|
||||
char cClass = inFile.next().charAt(0);
|
||||
double dHours = inFile.nextDouble();
|
||||
double dPayR = inFile.nextDouble();
|
||||
double dSal = inFile.nextDouble();
|
||||
double dYTD = inFile.nextDouble();
|
||||
String sFOut = "";
|
||||
String sCout = "";
|
||||
|
||||
|
||||
if (cFiling == 's')
|
||||
{
|
||||
sFOut = "Single";
|
||||
}
|
||||
else if (cFiling == 'h' )
|
||||
{
|
||||
sFOut = "Head of Household";
|
||||
}
|
||||
else if (cFiling == 'm')
|
||||
{
|
||||
sFOut = "Married";
|
||||
}
|
||||
else
|
||||
{
|
||||
sFOut = "Illogical.";
|
||||
}
|
||||
|
||||
if (cClass == 'h')
|
||||
{
|
||||
sCout = "Hourly";
|
||||
}
|
||||
else if (cClass == 's')
|
||||
{
|
||||
sCout = "Salary";
|
||||
}
|
||||
else
|
||||
{
|
||||
sCout = "Illigocial.";
|
||||
}
|
||||
|
||||
String out = "Employee Number: "+ iEmployee + "\t" +
|
||||
"Filing as: "+ sFOut + "\t" +
|
||||
"Number of Withholdings: "+iWHold+ "\t"+
|
||||
"Pay Type: "+sCout + "\t";
|
||||
if (cClass == 'h')
|
||||
{
|
||||
out += "Hours Worked: "+ dHours +"\t"+
|
||||
"Pay Rate: " + dPayR + "\t";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
out += "Salary: " + dSal + "\t";
|
||||
}
|
||||
out += "Year To Date: " + dYTD + "\t";
|
||||
System.out.println(out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* output:
|
||||
|
||||
E:\programs\Mod1\Project5>java Project5b
|
||||
Employee Number: 1001 Filing as: Single Number of Withholdings: 11
|
||||
Pay Type: Hourly Hours Worked: 40.0 Pay Rate: 15.35 Year To Date: 12
|
||||
28.0
|
||||
Employee Number: 1002 Filing as: Single Number of Withholdings: 10
|
||||
Pay Type: Hourly Hours Worked: 38.0 Pay Rate: 15.0 Year To Date: 57
|
||||
0.0
|
||||
Employee Number: 1003 Filing as: Single Number of Withholdings: 9
|
||||
Pay Type: Hourly Hours Worked: 26.45 Pay Rate: 20.0 Year To Date: 10
|
||||
58.0
|
||||
Employee Number: 1004 Filing as: Single Number of Withholdings: 8
|
||||
Pay Type: Hourly Hours Worked: 20.0 Pay Rate: 39.15 Year To Date: 23
|
||||
49.0
|
||||
Employee Number: 1005 Filing as: Single Number of Withholdings: 7
|
||||
Pay Type: Hourly Hours Worked: 37.15 Pay Rate: 20.0 Year To Date: 14
|
||||
86.0
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,129 @@
|
||||
/******************************************************************************
|
||||
* Project: Project 5c *
|
||||
* Class Name: Project5c *
|
||||
* Author: Amrit Panesar -ASP ,o/ *
|
||||
* Last Edited: 10/04/2012 *
|
||||
* Hours: 0.20 Hours *
|
||||
* Purpose: demonstrate proficiency in using Counted loops, proficiency in*
|
||||
* using Sentinel controlled loops, proficiency in using Flag *
|
||||
* controlled loops, proficiency in using EOF controlled loops, *
|
||||
* proficiency in using Forever loops, providing appropriate *
|
||||
* documentation for programs, the use of conventional *
|
||||
* identifiers for classes and variables, the ability to use *
|
||||
* simple program testing techniques to ensure the quality of *
|
||||
* their work product, the use of white space for ensuring *
|
||||
* readability of program code, correct formulation of boolean *
|
||||
* expressions to be used in the control of iterative structures *
|
||||
******************************************************************************/
|
||||
import java.util.*;
|
||||
import java.io.*;
|
||||
|
||||
public class Project5c
|
||||
{
|
||||
public static void main(String[] args) // main
|
||||
{
|
||||
Scanner inFile = null;
|
||||
try
|
||||
{
|
||||
inFile = new Scanner(new FileReader("payrollData.txt"));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.exit(0);
|
||||
}
|
||||
while(inFile.hasNext())
|
||||
{
|
||||
int iEmployee = inFile.nextInt();
|
||||
char cFiling = inFile.next().charAt(0);
|
||||
int iWHold = inFile.nextInt();
|
||||
char cClass = inFile.next().charAt(0);
|
||||
double dHours = inFile.nextDouble();
|
||||
double dPayR = inFile.nextDouble();
|
||||
double dSal = inFile.nextDouble();
|
||||
double dYTD = inFile.nextDouble();
|
||||
String sFOut = "";
|
||||
String sCout = "";
|
||||
|
||||
|
||||
if (cFiling == 's')
|
||||
{
|
||||
sFOut = "Single";
|
||||
}
|
||||
else if (cFiling == 'h' )
|
||||
{
|
||||
sFOut = "Head of Household";
|
||||
}
|
||||
else if (cFiling == 'm')
|
||||
{
|
||||
sFOut = "Married";
|
||||
}
|
||||
else
|
||||
{
|
||||
sFOut = "Illogical.";
|
||||
}
|
||||
|
||||
if (cClass == 'h')
|
||||
{
|
||||
sCout = "Hourly";
|
||||
}
|
||||
else if (cClass == 's')
|
||||
{
|
||||
sCout = "Salary";
|
||||
}
|
||||
else
|
||||
{
|
||||
sCout = "Illigocial.";
|
||||
}
|
||||
|
||||
String out = "Employee Number: "+ iEmployee + "\t" +
|
||||
"Filing as: "+ sFOut + "\t" +
|
||||
"Number of Withholdings: "+iWHold+ "\t"+
|
||||
"Pay Type: "+sCout + "\t";
|
||||
if (cClass == 'h')
|
||||
{
|
||||
out += "Hours Worked: "+ dHours +"\t"+
|
||||
"Pay Rate: " + dPayR + "\t";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
out += "Salary: " + dSal + "\t";
|
||||
}
|
||||
out += "Year To Date: " + dYTD + "\t";
|
||||
System.out.println(out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* output:
|
||||
|
||||
E:\programs\Mod1\Project5>java Project5c
|
||||
Employee Number: 1001 Filing as: Single Number of Withholdings: 11
|
||||
Pay Type: Hourly Hours Worked: 40.0 Pay Rate: 15.35 Year To Date: 12
|
||||
28.0
|
||||
Employee Number: 1002 Filing as: Single Number of Withholdings: 10
|
||||
Pay Type: Hourly Hours Worked: 38.0 Pay Rate: 15.0 Year To Date: 57
|
||||
0.0
|
||||
Employee Number: 1003 Filing as: Single Number of Withholdings: 9
|
||||
Pay Type: Hourly Hours Worked: 26.45 Pay Rate: 20.0 Year To Date: 10
|
||||
58.0
|
||||
Employee Number: 1004 Filing as: Single Number of Withholdings: 8
|
||||
Pay Type: Hourly Hours Worked: 20.0 Pay Rate: 39.15 Year To Date: 23
|
||||
49.0
|
||||
Employee Number: 1005 Filing as: Single Number of Withholdings: 7
|
||||
Pay Type: Hourly Hours Worked: 37.15 Pay Rate: 20.0 Year To Date: 14
|
||||
86.0
|
||||
Employee Number: 1006 Filing as: Single Number of Withholdings: 6
|
||||
Pay Type: Hourly Hours Worked: 55.35 Pay Rate: 20.0 Year To Date: 55
|
||||
35.0
|
||||
Employee Number: 1007 Filing as: Single Number of Withholdings: 5
|
||||
Pay Type: Hourly Hours Worked: 53.3 Pay Rate: 20.0 Year To Date: 10
|
||||
66.0
|
||||
Employee Number: 1008 Filing as: Single Number of Withholdings: 4
|
||||
Pay Type: Salary Salary: 1430.0 Year To Date: 14300.0
|
||||
Employee Number: 1009 Filing as: Single Number of Withholdings: 3
|
||||
Pay Type: Salary Salary: 1389.0 Year To Date: 13890.0
|
||||
Employee Number: 1010 Filing as: Single Number of Withholdings: 2
|
||||
Pay Type: Salary Salary: 1777.0 Year To Date: 15993.0
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,78 @@
|
||||
/******************************************************************************
|
||||
* Project: Project 5d *
|
||||
* Class Name: Project5d *
|
||||
* Author: Amrit Panesar -ASP ,o/ *
|
||||
* Last Edited: 10/04/2012 *
|
||||
* Hours: 0.20 Hours *
|
||||
* Purpose: demonstrate proficiency in using Counted loops, proficiency in*
|
||||
* using Sentinel controlled loops, proficiency in using Flag *
|
||||
* controlled loops, proficiency in using EOF controlled loops, *
|
||||
* proficiency in using Forever loops, providing appropriate *
|
||||
* documentation for programs, the use of conventional *
|
||||
* identifiers for classes and variables, the ability to use *
|
||||
* simple program testing techniques to ensure the quality of *
|
||||
* their work product, the use of white space for ensuring *
|
||||
* readability of program code, correct formulation of boolean *
|
||||
* expressions to be used in the control of iterative structures *
|
||||
******************************************************************************/
|
||||
import java.util.*;
|
||||
import java.io.*;
|
||||
|
||||
public class Project5d
|
||||
{
|
||||
public static void main(String[] args) // main
|
||||
{
|
||||
boolean bSent = true;
|
||||
Scanner console = new Scanner (System.in); //console
|
||||
while (bSent)
|
||||
{
|
||||
System.out.println("Please enter either 'M', 'H', 'S', or 'E' "
|
||||
+ "to find out more about that filing type, or enter"
|
||||
+ " any other character to quit.");
|
||||
System.out.print(":");
|
||||
switch (console.next().toLowerCase().charAt(0))
|
||||
{
|
||||
case 'm':
|
||||
System.out.println("Married");
|
||||
break;
|
||||
case 'h':
|
||||
System.out.println("Head of Household");
|
||||
break;
|
||||
case 's':
|
||||
System.out.println("Single");
|
||||
break;
|
||||
case 'e':
|
||||
System.out.println("Exempt");
|
||||
break;
|
||||
default:
|
||||
bSent = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* output:
|
||||
|
||||
E:\programs\Mod1\Project5>java Project5d
|
||||
Please enter either 'M', 'H', 'S', or 'E' to find out more about that filing typ
|
||||
e, or enter any other character to quit.
|
||||
:m
|
||||
Married
|
||||
Please enter either 'M', 'H', 'S', or 'E' to find out more about that filing typ
|
||||
e, or enter any other character to quit.
|
||||
:h
|
||||
Head of Household
|
||||
Please enter either 'M', 'H', 'S', or 'E' to find out more about that filing typ
|
||||
e, or enter any other character to quit.
|
||||
:s
|
||||
Single
|
||||
Please enter either 'M', 'H', 'S', or 'E' to find out more about that filing typ
|
||||
e, or enter any other character to quit.
|
||||
:e
|
||||
Exempt
|
||||
Please enter either 'M', 'H', 'S', or 'E' to find out more about that filing typ
|
||||
e, or enter any other character to quit.
|
||||
:q
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,77 @@
|
||||
/******************************************************************************
|
||||
* Project: Project 5e *
|
||||
* Class Name: Project5e *
|
||||
* Author: Amrit Panesar -ASP ,o/ *
|
||||
* Last Edited: 10/04/2012 *
|
||||
* Hours: 0.20 Hours *
|
||||
* Purpose: demonstrate proficiency in using Counted loops, proficiency in*
|
||||
* using Sentinel controlled loops, proficiency in using Flag *
|
||||
* controlled loops, proficiency in using EOF controlled loops, *
|
||||
* proficiency in using Forever loops, providing appropriate *
|
||||
* documentation for programs, the use of conventional *
|
||||
* identifiers for classes and variables, the ability to use *
|
||||
* simple program testing techniques to ensure the quality of *
|
||||
* their work product, the use of white space for ensuring *
|
||||
* readability of program code, correct formulation of boolean *
|
||||
* expressions to be used in the control of iterative structures *
|
||||
******************************************************************************/
|
||||
import java.util.*;
|
||||
import java.io.*;
|
||||
|
||||
public class Project5e
|
||||
{
|
||||
public static void main(String[] args) // main
|
||||
{
|
||||
Scanner console = new Scanner (System.in); //console
|
||||
out:
|
||||
while (true)
|
||||
{
|
||||
System.out.println("Please enter either 'M', 'H', 'S', or 'E' "
|
||||
+ "to find out more about that filing type, or enter"
|
||||
+ " any other character to quit.");
|
||||
System.out.print(":");
|
||||
switch (console.next().toLowerCase().charAt(0))
|
||||
{
|
||||
case 'm':
|
||||
System.out.println("Married");
|
||||
break;
|
||||
case 'h':
|
||||
System.out.println("Head of Household");
|
||||
break;
|
||||
case 's':
|
||||
System.out.println("Single");
|
||||
break;
|
||||
case 'e':
|
||||
System.out.println("Exempt");
|
||||
break;
|
||||
default:
|
||||
break out;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*output:
|
||||
|
||||
E:\programs\Mod1\Project5>java Project5e
|
||||
Please enter either 'M', 'H', 'S', or 'E' to find out more about that filing typ
|
||||
e, or enter any other character to quit.
|
||||
:m
|
||||
Married
|
||||
Please enter either 'M', 'H', 'S', or 'E' to find out more about that filing typ
|
||||
e, or enter any other character to quit.
|
||||
:h
|
||||
Head of Household
|
||||
Please enter either 'M', 'H', 'S', or 'E' to find out more about that filing typ
|
||||
e, or enter any other character to quit.
|
||||
:s
|
||||
Single
|
||||
Please enter either 'M', 'H', 'S', or 'E' to find out more about that filing typ
|
||||
e, or enter any other character to quit.
|
||||
:e
|
||||
Exempt
|
||||
Please enter either 'M', 'H', 'S', or 'E' to find out more about that filing typ
|
||||
e, or enter any other character to quit.
|
||||
:q
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,10 @@
|
||||
1001 s 11 h 40 15.35 0 1228
|
||||
1002 s 10 h 38 15 0 570
|
||||
1003 s 9 h 26.45 20 0 1058
|
||||
1004 s 8 h 20 39.15 0 2349
|
||||
1005 s 7 h 37.15 20 0 1486
|
||||
1006 s 6 h 55.35 20 0 5535
|
||||
1007 s 5 h 53.3 20 0 1066
|
||||
1008 s 4 s 0 0 1430 14300
|
||||
1009 s 3 s 0 0 1389 13890
|
||||
1010 s 2 s 0 0 1777 15993
|
||||
Reference in new issue
Block a user