CS1150 (Fall 2012, Section 1): Programming Assignment 4

Classes and Methods


  1. Use this picture as a guide for the methods to implement (the one that says "constant" should be a constant, not a method) a class to represent a throttle (such as you might see in an airplane or ship), declaring and using whatever class member data is necessary to support the functionality. NOTE: Most methods should be a single line of code (only a few have multiple lines, for simple error checking — for instance, a throttle with a max value of 50 should not be able to be increased to any value higher than 50).
  2. Write a main method in a separate class (name it whatever you'd like) to create one or more throttles and demonstrate the use of all of its methods.


Print all source code (example output of your program is not necessary).