Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in java. This week we will be trying out a different activity. You will be working as a group to learn the

image text in transcribed

Write a program in java.

This week we will be trying out a different activity. You will be working as a group to learn the basics of using Standard Draw. Standard Draw is a small library that allows you to help draw graphics in Java. We will then extend the exercise into thinking about how an Object Oriented design approach can help us manage the problems that arise. You can find examples of using Std Draw on Moodle called StdDraw Basic and Graphics Examples (more complex) 1. First, I would like your group to work out how to draw a house using StdDraw. You will need to set up the canvas, work out the coordinate system, and draw several shapes. I have included an example house for you to use. 2. Once you have the house drawn, I want you to design a new object of type House. A House object will contain the following: Variables: int anchorx, int anchory // these will be the "base position" or current position of the House. All other elements will be calculated relative to the anchor point. methods: a. A constructor that accepts no arguments and just creates a house with default settings (of your choosing). b. A draw() method which actually draws the house to the window, with the anchor point at the current position. C. a setPosition method which sets the starting position of the house (the anchor position) This week we will be trying out a different activity. You will be working as a group to learn the basics of using Standard Draw. Standard Draw is a small library that allows you to help draw graphics in Java. We will then extend the exercise into thinking about how an Object Oriented design approach can help us manage the problems that arise. You can find examples of using Std Draw on Moodle called StdDraw Basic and Graphics Examples (more complex) 1. First, I would like your group to work out how to draw a house using StdDraw. You will need to set up the canvas, work out the coordinate system, and draw several shapes. I have included an example house for you to use. 2. Once you have the house drawn, I want you to design a new object of type House. A House object will contain the following: Variables: int anchorx, int anchory // these will be the "base position" or current position of the House. All other elements will be calculated relative to the anchor point. methods: a. A constructor that accepts no arguments and just creates a house with default settings (of your choosing). b. A draw() method which actually draws the house to the window, with the anchor point at the current position. C. a setPosition method which sets the starting position of the house (the anchor position)

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

Professional Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

More Books

Students also viewed these Databases questions

Question

explain any five business uses for excel in computer science

Answered: 1 week ago