Question
A minimum of 4 data fields of at least 3 different data types. In other words you cannot make all of the data field’s int's or Strings or doubles etc. Mix them up.
At least 3 methods must be used to process your data! You decide what your methods will do to manipulate the data in your newly designed class.
Also you must include a toString method () Yes, this makes a total of 4 total methods in your new program.
Solution Preview
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
public class MakeVideoGame extends Frameimplements ActionListener {
// all input fields
private TextField NameField;
private TextField PriceField;
private TextField QuantityField;
// all control buttons
private Button enter; // send record to file
private Button done; // quit program
// Application other pieces
private DataOutputStream output;
// Constructor -- initialize the Frame
public MakeVideoGame() throws HeadlessException {
super( "Make VideoGame Bills" );
try {
// read output file name
output = new DataOutputStream(
new FileOutputStream( JOptionPane.showInputDialog("Enter the name of output file") ) );
}
catch ( FileNotFoundException e ) {
System.err.println( "File not opened properly\n" +
e.toString() );
System.exit( 1 );
}...