Electronics - { manufacturer = eManufacturer; price =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************************** // Electronics.java Author: Lewis/Loftus // // Represents a generic electronic device. //******************************************************************** / abstract public class Electronics { protected String manufacturer; protected double price; protected double weight; p //---------------------------------------------------------------- // Sets up a device with the specified information. //---------------------------------------------------------------- public Electronics (String eManufacturer, double ePrice, double eWeight)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { manufacturer = eManufacturer; price = ePrice; weight = eWeight; } //----------------------------------------------------------------// Returns a string including the basic device information. //----------------------------------------------------------------public String toString() { String result = "Manufacturer: " + manufacturer + "\n"; S result += "Price: $" + price + "\n"; result += "Weight: " + weight + " pounds"; r return result; } }...
View Full Document

This note was uploaded on 05/17/2011 for the course COP 3530 taught by Professor Davis during the Spring '08 term at University of Florida.

Ask a homework question - tutors are online