---++ Tenth Programming Lab, ITSC 121, Spring 2020 ---+++Overview Write the following programs. One define the objects and one tests it ---++++Program Description: Fans (edited problem 9.8) Design a class names <b>Fan</b> to represent a fan. The class contains: * Three constants named <b>SLOW, MEDIUM,</b> and <b>FAST</b> with the values <b>1, 2,</b> and <b>3</b> to denote the fan speed * A private <b>int</b> data field named <b>speed</b> that specifies the speed of the fan (the default is <b>SLOW</b>) * A private <b>boolean<b> data field named <b>on</b> that specifies whether the fan is on (the default is <b>false</b>) * A private <b>double</b> data field name <b>radius</b> that specifies the radius of the fan (the default is <b>5</b>) * A string data field named <b>color</b> that specifies the color of the fan (the default is <b>blue</b>) * The accessor and mutator methods for all four data fields. * A no-argument constructor that creates a default fan. * A method named <b>toString() the returns a string description for the fan. If the fan is on, the method returns the fan speed, color, and radius in one combined string. If the fan is not on, the method returns the fan color and radius along with the string "fan is off" in one combined string. * A method named <b>equals</b> that has one Fan as an argument and returns true if two fans are the same (same color and radius) and false otherwise. Write a test program that creates two <b>FAN</b> objects. Assign maximum speed, radius <b>10</b>, color <b>yellow</b>, and turn it on to the first object. Assign medium speed, radius <b>5</5>, color </b>blue</b>, and turn it off to the second object. Display the objects by invoking their <b>toString()</b> method. Also display if they are equal. ---+++Reminders 1. Include proper comments for all 1. Use proper formatting, etc. 1. Test with more than one set of data where it is appropriate 1. Get the correct data outputted on the program before worrying about formatting ---+++Submissions 1. Create a software development report that includes the following for the program: * A problem summary (the big picture) for each program * A list of requirements for each program. (Things that this particular implementation of a solution must do) * A list of steps each of your programs do * A testing report for each program: What exact input you used and what output you got. * How long it took to write it, and how much time was on it each day! * Who you got help from (if you got help) * Changes (if any) you would make if you had more time and/or skill * At least two things you learned while writing the program(s) 1. Create a <b>zip</b> folder with your software development report(s) and your java file(s) and submit that to canvas. 1. Due date can be found on canvas
This topic: CenterForComputing
>
WebHome
>
Syllabi
>
ITSC121S2020Syllabus
>
ITSC121S2020Lab10
Topic revision: r1 - 2021-10-19 - cathybareiss
Copyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback