-
Notifications
You must be signed in to change notification settings - Fork 14
bjwealthy submitting his assignment 2 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
abeprosper
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you change your username? I don't seem to find your first assignment submission. Here is the link to your grade:
https://docs.google.com/document/d/1zkQ5kGRDBuugJdeWpLWsLurwbqUPi2k7XYIdHQ4TQ84/edit
FindRange.java
Outdated
| */ | ||
|
|
||
| import acm.program.*; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This program does not work. I think you mis understood the question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will work on it again, thanks
FindRange.java
Outdated
| int n1 = readInt("First value: "); | ||
|
|
||
| if(n1==0){ | ||
| println("No you cant enter s3ntinel first"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also what's with the 3 in place of e? s3ntinel?
| * This file is the starter file for the Hailstone problem. | ||
| */ | ||
|
|
||
| import acm.program.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your program does not print how many steps it takes to reach to value 1.
| * This file is the starter file for the ProgramHierarchy problem. | ||
| */ | ||
|
|
||
| import acm.graphics.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally you should avoid the use of constant numbers in your program. You have values like (130, 175, 210...etc) throughout your code and this is not a good idea because:
- Someone reading your code will be confused how you came up with them
- If requirements change your program will be really hard to update. For example imagine for this exercise the requirements changed and we decide that the value for HEIGHT (50) and WIDTH (150) should be changed to HEIGHT = 60 and WIDTH = 180
If this happens your program will fail to draw the right diagram. To make it work you will have to go back and start changing all the numbers throughout your program. It should be possible to come up with a solution that works without you doing further modification. The ability of a program to be able to adapt to changes like that is called scalability. So in this case your solution is not scalable enough.
| private static final int HEIGHT = 50; | ||
| private static final int WIDTH = 150; | ||
|
|
||
| public void run() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should breakdown your program into smaller understandable methods. So the run method should have looked like this
public void run() {
drawProgramBox();
drawConsoleLine();
drawConsoleBox();
drawGraphicsLine();
drawGraphicsBox();
drawDialogLine();
drawDialogBox();
}
| * to change accordingly. | ||
| */ | ||
|
|
||
| import acm.graphics.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose you didn't have enough time to code this. :(
|
|
||
| double c = Math.sqrt((a*a) + (b*b)); | ||
|
|
||
| println("The ansa is " +c); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The answer " instead of "The ansa"
| * This file is the starter file for the Target problem. | ||
| */ | ||
|
|
||
| import acm.graphics.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The solution does not draw the target correctly as described in the assignment.
| import java.awt.*; | ||
|
|
||
| public class Target extends GraphicsProgram { | ||
| public void run() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The radius and pixel values should have been constants similar to what the starter code for the pyramid question had brick width, brick height and number of bricks on the base as constants. So you should have had something like this:
private static final int PIXELS_PER_INCH = 72;
private static final double RADIUS_OUTER_CIRCLE = 1.0;
private static final double RADIUS_WHITE_CIRCLE = 0.65;
private static final double RADIUS_INNER_CIRCLE = 0.3;
Also again this solution is not scalable (If the assignment requirements changed to have different radiuses your program will not work) and I don't think it uses the right measurements provided by the question (specifically the radiuses: 1.0, 0.65 and 0.3)
bjwealthy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good day Mr Abraham. I hope your day is going on fine. Thanks for the review of the assignments.
I found out that you have not been seeing my assignments because i have not been doing a PULL REQUEST. I was just informed by a colleague and I did just that now.
I will be grateful if, amidst your busy schedule, you can help me find time and review them.
Thanks.
FindRange.java
Outdated
| */ | ||
|
|
||
| import acm.program.*; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will work on it again, thanks
No description provided.