Professional Documents
Culture Documents
Actividad 9 Grupo1
Actividad 9 Grupo1
El Proyecto en JAVA deben tener como nombre de (Employee Class). Design an Employee class
archivo, un nombre compuesto por: Act9 + Solamente with the following constructors:
un nombre y un apellido de cada uno de los integrantes
del grupo. • A constructor that accepts the following values
Ejemplo: as arguments and assigns them to the appropriate
Act9_AngiePerezCarlosArrietaAndreaHuertas.zip fields: employee’s name, employee’s ID
number, department, and position.
1. Grupo 3 (TORRES TORRES, KAREN ALEJANDRA) • A constructor that accepts the following values
as arguments and assigns them to the appropriate
(Geometry Calculator). Design a Geometry fields: employee’s name and ID number. The
class with the following methods: department and position fields should be
assigned an empty string (" ").
• A static method that accepts the radii of an • A no-arg constructor that assigns empty strings
ellipse and returns the area of the ellipse. Use (" ") to the name, department, and position
the following formula: fields, and 0 to the idNumber field.
Where 𝝅 is Math.PI, r is the circle’s radius (Larger Than n). In a class, write a method that
accepts two arguments: an array and a number n.
Area of a rectangle: 𝐴𝑟𝑒𝑎 = 𝑊𝑖𝑑𝑡ℎ 𝑥 𝐿𝑒𝑛𝑔𝑡ℎ Assume that the array contains integers. The method
Area of a cylinder: 𝐴𝑟𝑒𝑎 = 𝜋𝑟 2 ℎ should display all of the numbers in the array that are
greater than the number n.
Where 𝝅 is Math.PI, r is the radius of the cylinder’s
base, and h is the cylinder’s height. Demonstrate the class in a complete program that
Because the three methods are to be overloaded, they calls the method.
should each have the same name, but different
parameter lists. Demonstrate the class in a complete 9. Grupo 6 (LONDONO CARDENAS, JEFFERSON DAVID;
program. RIVERA QUINTERO, CAMILO; TAVERA QUIROZ,
EMERSON STIVER)
6. Grupo 9 (CAICEDO TORO, RICHARD SANTIAGO)
(Payroll Class). Write a Payroll class that uses
(Temperature Conversions). Implement the the following arrays as fields:
following static methods:
- employeeId. An array of seven integers to
a) Method celsius returns the Celsius equivalent hold employee identification numbers. The array
of a Fahrenheit temperature, using the calculation should be initialized with the following numbers:
celsius = 5.0 / 9.0 * ( fahrenheit - 32 );
5658845 4520125 7895122 8777541
8451277 1302850 7580489
Demonstrate the class in a program that allows the
- hours. An array of seven integers to hold the user to enter each student’s name and his or her four
number of hours worked by each employee. test scores. It should then display each student’s
- payRate. An array of seven doubles to hold average test score and letter grade.
each employee’s hourly pay rate.
- wages. An array of seven doubles to hold each Input validation: Do not accept test scores less than
employee’s gross wages. zero or greater than 100.
The class should relate the data in each array through 11. Grupo 8 (PINEDA QUIROGA, JUAN SEBASTIAN)
the subscripts. For example, the number in element 0
of the hours array should be the number of hours (ArrayOperations Class). Write a class name
worked by the employee whose identification number ArrayOperations with the following static
is stored in element 0 of the employeeId array. methods:
That same employee’s pay rate should be stored in - getTotal. This method should accept a one-
element 0 of the payRate array. dimensional array as its argument and return the
total of the values in the array.
In addition to the appropriate accessor (get) and - getAverage. This method should accept a one-
mutator (set) methods, the class should have a method dimensional array as its argument and return the
that accepts an employee’s identification number as average of the values in the array.
an argument and returns the gross pay for that - getHighest. This method should accept a one-
employee. dimensional array as its argument and return the
highest value in the array.
Demonstrate the class in a complete program that - getLowest. This method should accept a one-
displays each employee number and asks the user to dimensional array as its argument and return the
enter that employee’s hours and pay rate. It should lowest value in the array.
then display each employee’s identification number
and gross wages. Demonstrate the class in a complete program with test
data stored in arrays of various data types.
Input Validation: Do not accept negative values for
hours or numbers less than 6.00 for pay rate.