Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the application class and define: a method that finds and returns the employee who earns the lowest salary, a method that prints all employees

image text in transcribed

Write the application class and define:

  1. a method that finds and returns the employee who earns the lowest salary,
  2. a method that prints all employees in the array
  3. a method that returns the average salary
  4. the main method that creates an array of Employee, then test a), b), c)

import java.util.Scanner; public class Employee public int id; public String name; public double salary; public void Input() { System.out.println("Enter name: "); name = new Scanner(System.in).nextLine(); System.out.println("Enter ID: "); id = Integer.parseInt(new Scanner(System.in).nextLine()); System.out.println("Enter Salary: "); salary - Double.parseDouble(new Scanner(System.in).nextLine()); } public void Output() { System.out.printf("Name: $155, ID: %255, Grade: %3$s ", name, id, salary); 3 public String toString() { return String.format("Name: %15, ID: $2$, Grade: %3$s", name, id, salary); } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Luc Perkins, Eric Redmond, Jim Wilson

2nd Edition

1680502530, 978-1680502534

More Books

Students also viewed these Databases questions

Question

Give three examples of simulation techniques.

Answered: 1 week ago

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago