Question
MUST write a method showGrid(graphic, month, year) that produces output, see example above. You also keep showGrid(month, year) in this Class as an optional overload
MUST write a method showGrid(graphic, month, year) that produces output, see example above.
You also keep showGrid(month, year) in this Class as an optional overload of the method.
int month is a parameter, must be 1-12 for the twelve months of the year
int year is a year of the Gregorian calendar (today's European and American standard)
MUST use a method daysInMonth, Exercise #4, page 309, Chapter 4.
showGrid works for any month (1-12), and any year (1900-2100) including leap years.
Program Submission Requirements
Suggestion: Use your logic from the last Assignment, just replace (and remove) the System.out calls with appropriate draw calls from Chapter 3g material.
Don't Miss This ---->>>> Overloaded Methods: Two or more methods can have exactly the same name (example: .substring) yet have a different parameter list, this goes for constructors too In this case, we make another showGrid method, but add a Graphic g parameter, so it's obvious which version is used for any particular call to the method name, the parameter list must match (Chapter 3, page 152).
I was having trouble getting the DrawingPanel panel = new DrawingPanel(700, 700); I keep getting the error drawing panel cannot be resolved to a type
6 ALWAYS: Name, date, course 7 *WHY: Assignment #1 8 and whatever else might be relevant 9 10 11 public class DayGrid f 12 public static void main(String[] args) 13 14 15 16 17 18 19 20 21 22 public static void showGrid(Graphics g, int month, int year) 23 int month-8; 1/ August in human world int year 2017; DrawingPanel pnew DrawingPanel (400,200); Graphics g p.getGraphics(); showGrid(g, month, year); // Assignment #2 //showGrid(month, year); // Assignment #1 // method to display month as a grid Drawing Panel File View Help Sun Mon Tue Wed Thu Fr Sat 10 11 12 13 | 14 | 15 | 16 | 17 | 18 | 19 20 21 22 23 24 2526 27 28 29 30 31 x=385, y=176), r-255 g-255 b-255 43Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started