Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA!! Please help me fix the code. public class PersonApp { private String name; private int age; private double income; public PersonApp() { name =

JAVA!! Please help me fix the code.

public class PersonApp { private String name; private int age; private double income;

public PersonApp() { name = " "; age = 0; income = 0.0; } public PersonApp(String n, int a, double i) { name = n; age = a; income = i; } public String getName() { return name; } public int getAge() { return age; } public double getIncome() { return income; } public void setName(String n) { name = n; } public void setAge(int a) { age = a; } public void setIncome(double i) { income = i; } public boolean equals(Object anotherPerson) { return(name.equalsIgnoreCase((PersonApp)anotherPerson.name()) && age == ((PersonApp)anotherPerson.age() && Math.abs(income - ((PersonApp)anotherPerson.income()) < 0.01); } }

public class TestPersonApp { public static void main(String[] args) { PersonApp person = new PersonApp("m",23,0); System.out.println("Name: " + person.getName()); System.out.println("Age: " + person.getAge()); System.out.println("Income: " + person.getIncome()); } }

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

Step: 3

blur-text-image

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

Managing Your Information How To Design And Create A Textual Database On Your Microcomputer

Authors: Tenopir, Carol, Lundeen, Gerald

1st Edition

1555700233, 9781555700232

More Books

Students also viewed these Databases questions

Question

Define policy making?

Answered: 1 week ago

Question

Define co-ordination?

Answered: 1 week ago

Question

What are the role of supervisors ?

Answered: 1 week ago

Question

=+j Describe the various support services delivered by IHR.

Answered: 1 week ago

Question

=+j Explain IHRMs role in global HR research.

Answered: 1 week ago