-
Notifications
You must be signed in to change notification settings - Fork 14
Assignment 2 (Programming Methodology)- Omigie Osayamen #1
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.
Excellent work.
Here is a link to your grade:
https://docs.google.com/document/d/135T1QhHI-6Ca1ChDPghvfOKwK9a68Lg2o0vUA9qzf9U/edit?usp=sharing
| * This file is the starter file for the FindRange 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.
Great solution. However you missed one edge case:
If the user enters the sentinel on the very first input line, then no values have been
entered, and your program should display a message to that effect.
So if for example the user enters 0 the program should report:
No values has been entered.
Your program instead reports:
Smallest: 0
Largest: 0
| */ | ||
|
|
||
| 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.
Excellent solution.
| public class Hailstone extends ConsoleProgram { | ||
| public void run() { | ||
| /* You fill this in */ | ||
| println("This program finds the largest and smallest numbers"); |
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 assume you copied this from the Find Range problem because it is not true that this program finds the largest and smallest numbers.
| import acm.graphics.*; | ||
| import acm.program.*; | ||
| import java.awt.*; | ||
|
|
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.
Excellent solution.
|
|
||
| private GRect createLabelledBox(String content, int x, int y) { | ||
| GLabel label = new GLabel(content); | ||
| // label.setFont("Times-72"); |
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.
Commented out code should be deleted.
| import java.awt.*; | ||
|
|
||
|
|
||
| public class Pyramid extends GraphicsProgram { |
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.
Excellent solution.
|
|
||
| import acm.program.*; | ||
|
|
||
| public class PythagoreanTheorem extends ConsoleProgram { |
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.
Excellent solution.
| import java.awt.*; | ||
|
|
||
|
|
||
| public class Target extends GraphicsProgram { |
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.
Program works well...just a few coding techniques need to be changed.
| public void run() { | ||
| /* You fill this in. */ | ||
|
|
||
| double radius_1 = 72; |
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 should have been declared as constants outside of the run method, also you should have named them outer_radius, middle_radius and inner_radius, that way someone knows which radius corresponds to which circl. So something like
private static final double OUTER_RADIUS= 72;
private static final double MIDDLE_RADIUS = OUTER_RADIUS * 0.65;
private static final double INNER_RADIUS = OUTER_RADIUS * 0.3;
Assignment completed