001package headfirst.command.party; 002 003public class Stereo { 004 String location; 005 006 public Stereo(String location) { 007 this.location = location; 008 } 009 010 public void on() { 011 System.out.println(location + " stereo is on"); 012 } 013 014 public void off() { 015 System.out.println(location + " stereo is off"); 016 } 017 018 public void setCD() { 019 System.out.println(location + " stereo is set for CD input"); 020 } 021 022 public void setDVD() { 023 System.out.println(location + " stereo is set for DVD input"); 024 } 025 026 public void setRadio() { 027 System.out.println(location + " stereo is set for Radio"); 028 } 029 030 public void setVolume(int volume) { 031 // code to set the volume 032 // valid range: 1-11 (after all 11 is better than 10, right?) 033 System.out.println(location + " Stereo volume set to " + volume); 034 } 035}