Question
import java.util.Scanner; import javax.swing.*; public class p2 { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner keyboard=new
import java.util.Scanner; import javax.swing.*;
public class p2 { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner keyboard=new Scanner(System.in); Employee[] employee=new Employee[100]; double avg; double sum= 0.0; int count; String c = JOptionPane.showInputDialog(null, "Enter the number of records: "); count= Integer.parseInt(c); String name,ssn; double salary; for(int i=0;i class Person { String name; Person() { name = "No name yet"; } public Person(String initialName) { name = initialName; } public void setName(String newName) { name = newName; } public String getName() { return name; } public void writeOutput() { JOptionPane.showMessageDialog(null, "Name: " + name); } public boolean hasSameName(Person otherPerson) { return this.name.equalsIgnoreCase(otherPerson.name); } } class Employee extends Person{ String SSN; double salary; Employee(){ super(); SSN=""; salary=0.0; } public Employee(String nam,String sn,double sal){ super(nam); setSSN(sn); salary=sal; } public void setSSN(String sn){ int count=0; for(int i=0;i class SSNLengthException extends Exception{ public SSNLengthException(){ JOptionPane.showMessageDialog(null, "Not valid length"); } public SSNLengthException(String ms){ super(ms); } } class SSNCharacterException extends Exception{ public SSNCharacterException(){ JOptionPane.showMessageDialog(null, "Not digit"); } public SSNCharacterException(String ms){ super(ms); } } I have the program output every thing in dialog box, but i didnt want it to be output Name, SSN, SALARY,Below or Above average on a seperate dialog box for each. i been playing around and i cant get them all to output in one dialog box like Below or above average Name SSN Salary
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started