i need someone to do this program for me
and before saying that i have to do my homework alone
i had midterms all week and in about in hour or so and i forgot about this assignment and i just dont have time so plz help here it is ( its due in two hours )

class Point:
1. Has 2 private fields x and y of type int. 2. Has 2 constructors: a default constructor that sets the coordinates to (0, 0), and a
constructor that takes two parameters to set (x, y). 3. Has five methods:
moveUp(int units): moves the point up an amount equal to units. moveDown(int units): moves the point down an amount equal to units. moveLeft(int units): moves the point left an amount equal to units. moveRight(int units): moves the point right an amount equal to units. printPoint(): prints a description of the point as (x,y)

class Rectangle:
1. Has 5 private fields: width, height, area, circumference all of type int, and center of type Point.
2. Has 2 constructors: a default constructor that sets the center to the point (0, 0), and the width and height to 1. The second constructor takes 3 parameters to set the width, height, and the center. Both constructors calculate the area and circumference.
3. Has 4 methods: setWidth(int w): sets the width of the rectangle to w. setHeight(int h): sets the height if the rectangle to h.
move(int direction, int unit): moves the rectangle in a direction passed as a parameter, an amount equal to unit. direction is an int that could have one of four values (0, 1, 2, 3) where 0 means up, 1 means right, 2 means down, and 3 means left.
printRectangle(): prints a description of every rectangle including its width, height, center, area, and circumference.

class TestRectangle:
1. It has one method which is the main() method. In the main, program the following scenario:
Notes:
Instantiate a rectangle using the default constructor Print its details Change its width to 2 Move it right 3 units
Print its details again Instantiate a second rectangle with width 3, height 5, and center (1, 4). Print its details Move it up 2 units Change its height to 2 Print its details again


thanks(student)( programing)

jbennet commented: do your own homework -3

Recommended Answers

All 11 Replies

i need someone to do this program for me
and before saying that i have to do my homework alone
i had midterms all week and in about in hour or so and i forgot about this assignment and i just dont have time so plz help here it is ( its due in two hours )

well ... I'm sorry, but I won't help you with this, for several reasons:
I don't doubt you when you say you had midterms, and my heart surely goes out to you for that (hated exams and all of that myself too) but I do doubt you didn't know about this assignment before those midterms. good time-management is important too, not just the coding itself.

first you say you don't have time for it, then you say that it's due in two hours ...
I've looked over your assignment, and I think two hours is way more than you need to complete this job, in fact, I think it wouldn't even have taken that much more time than to create this thread.

why don't you start writing it, and ask questions if you're stuck? it's better to hand in an incomplete solution that you wrote, than to provide a glorious piece of code that gets you top grades, but that you can't explain when your teacher asks for it.
the assignment is very basic, and if there's nothing in there you can do on your own in under two hours, maybe failing this test is for the best, even though I understand that getting a good grade looks way better.

I do hope to see any code of yours here in a few minutes, but if not, I won't start writing it.

well atleast tell me how to write this that my mine issue here

default constructor that sets the coordinates to (0, 0), and a
constructor that takes two parameters to set (x, y).

s 2 constructors: a default constructor that sets the center to the point (0, 0), and the width and height to 1. The second constructor takes 3 parameters to set the width, height, and the center. Both constructors calculate the area and circumference.

the rest i can do im just having issues writing a default constructor

thanks..

Its already there, default constructor. Do you know what is default constructor? If you do not them you better to go read your course notes

the reason im so lost is because i've missed that class and there is nothing in the book about it im been siting at the computer for over an hour trying to write this. I made time for this but im lost

well, this link might help you out. but since it can not be easier explained than is explained in your assignment ...

A default constructor is just: classname() as opposed to any other ones i.e. classname(params...)

This stuff is like lesson 1 of programming. It will be in your book.
You can do this assignment in 10 minutes.

Try hard. If you can do this, you are probably on the wrong course

Didn't you mean:

Try hard. If you can't do this, you are probably on the wrong course

?

if not, I think a lot of us took on the wrong job :)

I meant to say can't

's what I thought :)

I guess we can close this Thread. his assignment was due hours ago

Marked solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.