FRQ Type 2: Class Design

class design

Part of: Exam Workshop: FRQ Strategies

What This FRQ Asks The class design FRQ gives you a written description of a class and asks you to write the whole thing: private instance variables, a constructor, and one or two methods. The rubric is generous here because there are many small pieces, each worth a point. Private fields, a constructor that stores its parameters, correct method headers, and correct method bodies each score. Build It Part by Part Work top to bottom so you do not forget a piece. Declare the fields the description mentions, write a constructor that copies each parameter into a field, then write each method the prompt lists. Every instance variable is private, the constructor stores both parameters, and each method returns the right computed value. That is four or five rubric points in a short, calm block of code. Common Point Losses The two mistakes that cost the most here are making fields public and forgetting to store a constructor parameter. If the constructor leaves a field unset, that field stays at its default and every method that uses it returns the wrong answer. Read your constructor once to confirm every field mentioned in the description gets assigned. Also match method names and return ty

Challenge: Design a Rectangle Class