Init
This commit is contained in:
@@ -0,0 +1,33 @@
|
|||||||
|
public class EmployeeEarnings {
|
||||||
|
EmployeeEarnings() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void top() {
|
||||||
|
System.out.printf("%50s %n%n","MWPSB Employee Earnings");
|
||||||
|
System.out.printf("%-20s %-20s %-20s %-20s %n %n","Employee","Hourly Rate","Hours per week","Gross Monthly Salary");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void data() {
|
||||||
|
String name1 = "Akane Tsunemori";
|
||||||
|
String name2 = "Shinya Kogami";
|
||||||
|
String name3 = "Shusei Kagari";
|
||||||
|
|
||||||
|
double rate1 = 31.5;
|
||||||
|
double rate2 = 18.25;
|
||||||
|
double rate3 = 22;
|
||||||
|
|
||||||
|
int hours1 = 45;
|
||||||
|
int hours2 = 24;
|
||||||
|
int hours3 = 37;
|
||||||
|
|
||||||
|
System.out.printf("%-20s $%-20.2f%-20d $%-20.2f %n", name1, rate1, hours1, rate1*hours1*4);
|
||||||
|
System.out.printf("%-20s $%-20.2f%-20d $%-20.2f %n", name2, rate2, hours2, rate2*hours2*4);
|
||||||
|
System.out.printf("%-20s $%-20.2f%-20d $%-20.2f %n", name3, rate3, hours3, rate3*hours3*4);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
EmployeeEarnings chart = new EmployeeEarnings();
|
||||||
|
chart.top();
|
||||||
|
chart.data();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
public class VariablesAssignmentB {
|
||||||
|
VariablesAssignmentB() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Title() {
|
||||||
|
System.out.println("Name Program");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void name1(String first, String last) {
|
||||||
|
System.out.printf("%s %s %n",first.toLowerCase(), last.toUpperCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void name2(String lastName) {
|
||||||
|
for (int i = 0; i < lastName.length(); i++) {
|
||||||
|
System.out.println(lastName.charAt(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String firstName = "Ian";
|
||||||
|
String lastName = "An";
|
||||||
|
|
||||||
|
VariablesAssignmentB x = new VariablesAssignmentB();
|
||||||
|
x.Title();
|
||||||
|
x.name1(firstName, lastName);
|
||||||
|
x.name2(lastName);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user