Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CS110: Programming Assignment #3, Cooperating Classes, Due 3/30/2018 Topics: classes, programs using multiple classes, stdDraw (graphics) This program uses a publicly available drawing library created

image text in transcribed
image text in transcribed
CS110: Programming Assignment #3, Cooperating Classes, Due 3/30/2018 Topics: classes, programs using multiple classes, stdDraw (graphics) This program uses a publicly available drawing library created by Robert Sedgewick and Kevin Wayne to simplify the process of drawing graphic objects to the computer screen. Documentation for the class can be found at: https:/lintrocs.cs.princeton.edu/iava/stdlib/javadoc/StdDraw.html The class can be down loaded at: https://introcs.cs.princeton.edu/java/stdlib/StdDraw.java la an ed rs.arincsion duiaaitdliStabras.lava To begin download and place Stddraw.java in your project directory. NOTE: To make class Color available at the top of each class you must import: import java.awt. Part 1. (20 points) Write a class Cirete java similar to store information about a circle that has the attributes: . two double data members to store the x and y coordinates of the center of the circle - radius: double variable to store the radius of the circle. e color - the color of the circle, using one of the predefined constants in the StdDraw package, the data type of this datamember must be Color. The class should have a constructor that takes as parameters the two coordinates ,radius, and color of the circle. public Circle (double inputx, double inputY, double radius, Color color ) The class should also have the following methods: public void draw0 - for drawing the circle. (Uses the method StdDraw.filledCircle) public void setColor(Color newColor)- method that changes the color of the circle. public void setRadius( double rad)- method receives a new value for the radius of the circle

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions