Question: student.java class student { private String firstName; private String lastName; private int age; student(String informedFirstName, String informedLastName, int informedAge){ firstName = informedFirstName; lastName = informedLastName;


student.java
class student { private String firstName; private String lastName; private int age; student(String informedFirstName, String informedLastName, int informedAge){ firstName = informedFirstName; lastName = informedLastName; age = informedAge; }
student() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } String getName(){ return firstName+ " "+ lastName+" "+ age; } String getLastName(){ return lastName; }
String getFirstName(){ return firstName; }
String getFullName(){ return firstName+ " "+ lastName; }
String getLastNameFirst(){ return lastName+ " "+ firstName; }
String whatsUp(){ double myRandomNumber = Math.random(); double randomNumberTruncated = myRandomNumber*10; int myRandomNumberToInt = (int) randomNumberTruncated; String answer = " "; switch(myRandomNumberToInt){ case 1: answer = "is writing java"; break; case 2: answer = "searching the web"; break; case 3: answer = "Listening to endless lecture"; break; case 4: answer = "playing cards"; break; case 5: answer = "drinking beer"; break; case 6: answer = "eating peruvian food"; break; case 7: answer = "is talking on the phone"; break; case 8: answer = "is drawing"; break; case 9: answer = "is listening to music"; break; case 10: answer = "is sleeping"; break; } return answer; }
we only use import java.awt.*; and import javax.swing.*;
Deliverables app.java (initial application) MyJFrame.java (external JFrame) A Java class for the control panel, that will contain the 2 new panels, using a layout. A Java class for the Panel that will display the student's name A Java class for the Panel that will display "what's up 20 times, using a layout. . student.java (a working version from previous labs, no changes needed). All the student's information should be extracted from the student object. Contents The objective is to organize the graphical components on the screen. You might use this NetBeans project to start your lab. You will need 2 panels inside myJPanel. Creating and adding panels is very similar to creating and adding other graphical components such as buttons. It should look like this: My First Frame NAME = Fred Fonseca Age=44 doing Java searching the web doing Java List to endless lecture doing Java searching the we doing Java the web Listening to endless lecture doing Jawa searching the web the web doing Java searching the web searching the web doing Java searching the web Listening to endless lecture doing Java searching the wetb
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
