Work on lab 4
This commit is contained in:
parent
a1c6a05bea
commit
7bf6031fd4
BIN
Lab4_1/PDFs/Worksheet Lab 4-1-1.docx
Normal file
BIN
Lab4_1/PDFs/Worksheet Lab 4-1-1.docx
Normal file
Binary file not shown.
BIN
Lab4_1/PDFs/lab4-1.pdf
Normal file
BIN
Lab4_1/PDFs/lab4-1.pdf
Normal file
Binary file not shown.
BIN
Lab4_1/PDFs/worksheet lab4-1.pdf
Normal file
BIN
Lab4_1/PDFs/worksheet lab4-1.pdf
Normal file
Binary file not shown.
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package com.calebfontenot.lab4_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class Debug1 {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
int i = 1;
|
||||
int j = i * i * i;
|
||||
System.out.println( j );
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package com.calebfontenot.lab4_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class Debug2 {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
|
||||
int i = 9;
|
||||
int j = (int)((5.0 / 6) * (i * 4));
|
||||
System.out.println(j);
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package com.calebfontenot.lab4_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class Debug3 {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
System.out.println((long)2147483647 + 1);
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package com.calebfontenot.lab4_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class Debug5 {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
System.out.println("1 + 2 is "+ (1 + 2));
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package com.calebfontenot.lab4_calebfontenot;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class payroll {
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// Create Scanner
|
||||
Scanner input = new Scanner(System.in);
|
||||
|
||||
// Define vars
|
||||
String employeeName;
|
||||
double hoursWorked;
|
||||
double hourlyPayRate;
|
||||
double taxWithholdingRate;
|
||||
|
||||
// Prompt for input
|
||||
System.out.print("Enter employee's name: ");
|
||||
employeeName = input.next();
|
||||
System.out.print("Enter the number of hours worked in a week: ");
|
||||
hoursWorked = input.nextDouble();
|
||||
System.out.print("Enter the hourly pay rate: ");
|
||||
hourlyPayRate = input.nextDouble();
|
||||
System.out.println("Enter the federal tax witholding rate: ");
|
||||
taxWithholdingRate = input.nextDouble();
|
||||
|
||||
// Calculate
|
||||
|
||||
|
||||
|
||||
// Print output
|
||||
System.out.println("Employee Name: "+employeeName);
|
||||
System.out.println("Hours Worked: "+hoursWorked);
|
||||
System.out.println("Pay Rate:"+ hourlyPayRate);
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user