Question
Make an : Is for kids boolean method in eitem class Append the object details in items for kids list (if the object id for
Make an : Is for kids boolean method in eitem class
Append the object details in items for kids list (if the object id for kids then kids list will append else items will append)
Note: dont use min age in the if statement use is for kids method
the other code:
private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: }
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { String name= jTextField4.getText(); double price= Double.parseDouble(jTextField5.getText()); int minUserAge= Integer.parseInt(jComboBox1.getSelectedItem().toString()); boolean batt=jCheckBox1.isSelected(); Eitem item= new Eitem(name, minUserAge, price, batt); jTextArea1.append(item.toString()+" "); if (item.isForKids()){ }
From the previous exercise, add a new boolean method "isForKids" in class "EItem" that return true if the minUserAgeStep 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