• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 5 páginas
Examen

CSIS 212 – Week 2 Project

Document preview thumbnail
Vista previa 2 fuera de 5 páginas

CSIS 212 – Week 2 Project A //A -- Takes in a input of 3 employees, payrates, and hours worked. // Calulates the employee's pay with consideration of overtime. //CSIS 212-B01 //Citations ** //** Formatting decimal points -- package main; import .Scanner; public class App { public static void main(String[] args) throws Exception { Sln("Bradley Bentow - Assignment #2 n"); //Variable declaration Employee employee; Scanner input = null; int EmployeeIterator = 1; double hoursWorked; double employeePayRate; //Properly using a Try finally to prevent a memory leak of Scanner.

Vista previa del contenido

CSIS 212 – Week 2 Project
App.java
//App.java -- Takes in a input of 3 employees, payrates, and hours worked.
//Calulates the employee's pay with consideration of overtime.
//CSIS 212-B01
//Citations **
//** Formatting decimal points -- https://stackoverflow.com/questions/42334771/double-with-
exactly-two-decimal-digits-in-java-without-java-text-decimalfomat */
package main;
import java.util.Scanner;
public class App {
public static void main(String[] args) throws Exception {
System.out.println("Bradley Bentow - Assignment #2 \n");
//Variable declaration
Employee employee; Scanner input = null;
int EmployeeIterator = 1; double hoursWorked; double employeePayRate;
//Properly using a Try finally to prevent a memory leak of Scanner. try
{
//Instantiate Scanner before the while loop. input = new Scanner(System.in);
do {
//Take in the Employee's pay rate, store as a double System.out.print("Employee's hourly pay rate: "); employeePayRate = input.nextDouble();
//Take in the Employee's working hours, store as a double System.out.print("Hours the employee worked: "); hoursWorked = input.nextDouble();
//Instantiate a new Employee object and pass in the pay rate and hours worked,
//The class is abstracted and will automatically make the total pay available
//with employee.EmployeeTotal
employee = new Employee(hoursWorked, employeePayRate);
//Now that everything is completed, we can show the user the completed string with
//the wanted calculations.
System.out.printf("Pay for Employee %d is: $%.2f\n", EmployeeIterator, employee.EmployeeTotal);
//Add one to the iterator so the loop doesn't run forever. EmployeeIterator += 1;

Información del documento

Subido en
15 de marzo de 2024
Número de páginas
5
Escrito en
2023/2024
Tipo
Examen
Contiene
Preguntas y respuestas
$11.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
MedTestPro
3.6
(8)
Vendido
67
Seguidores
30
Artículos
4328
Última venta
1 semana hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes