• Post Reply Bookmark Topic Watch Topic
  • New Topic

Could someone please explain what my instructor is saying?  RSS feed

 
Mack Grill
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recently turned in a project that allowed a user to enter in a certain number of salespeople along with their sales and was a little confused on how I didn't create the project correctly. My instructor told me this:

" The idea was to make this MORE modular.

Before EVERYTHING was in SalesReport. Project 2 asked that you break up SalesReport, by creating Main.java where SalesReport would be instantiated.

But it looks like you've thrown those out, and kept the original SalesReport. Here's how it should shake out:

Main.java has the main() method. This is where you instantiate SalesReport.

SalesComputations will contain the methods need to calculate our stuff.

SalesReport will CALL SalesCoputation methods to generate it's reports. "


I will add the instructiosn at the bottom but for now here are the 2 classes I was working with:

SalesComputations:





SalesReport:





Also, here are the other 2 classes that he was referring to with project 2:

SalesReport and Main Class:




And finally the instructions for the project:


 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mack Grill wrote: I recently turned in a project...

Mack,

1. That is FAR too much code. If you want a fast response, pare it down to only the things that deal with your problem specifically.

2. Please DontWriteLongLines (←click). I've tried to break yours up this time, but please read the link carefully.

Winston
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your instructor notes ...

Here's how it should shake out:

Main.java has the main() method. This is where you instantiate SalesReport.

SalesComputations will contain the methods need to calculate our stuff.

SalesReport will CALL SalesCoputation methods to generate it's reports. "


seems pretty clear to me. The processing code is supposed to be in SalesComputations. And SalesReport is supposed to call SalesComputation to do the processing.... while you do seem to have a SalesComputation class, it is not being used by the SalesReport class. Instead, you SalesReport class seems to have a separate copy of the methods to do the processing.

Never mind. It does look like one class does call the other, but very tightly integrated. Perhaps, it would be a good idea to simply have a discussion with your instructor?

Henry
 
tom davies
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
He told you this "Project 2 asked that you break up SalesReport, by creating Main.java where SalesReport would be instantiated."
As far as i can see he wanted you to create a new class named main.java where you would instantiate SalesReport.
By the looks of it you have it in SalesReport.java still. I assume he wanted Salescomputation.java SalesReport.java and Main.java, but you still have your main method in the SalesReport.java which is the same as your first project.
I am only guessing though, your lecturer will be the one with the answers so go and ask him.
 
Mack Grill
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

but I do have some methods in the SalesReport class that is using methods from SalesComputations.

These 2 for example:




So, what should I do since I am making calls to the SalesComputations class?
 
Tony Docherty
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like your 2 classes fulfill the general requirements (other than they suggested keeping the main() method in Main.java) but are you sure these are the classes you actually submitted as your tutors comments don't seem to stack up with the classes shown here.
 
Mack Grill
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I submitted the salescomputations and salesreport class when i turned in the project but i did not include project 2's classes which were salesreport and main class
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Instructor wrote:Project 2 asked that you break up SalesReport, by creating Main.java where SalesReport would be instantiated.

But it looks like you've thrown those out, and kept the original SalesReport. Here's how it should shake out:

Main.java has the main() method. This is where you instantiate SalesReport.


The Directions wrote:The content of the Main class can stay as it is, but put it in the salesIO package.


Mack Grill wrote:I submitted the salescomputations and salesreport class when i turned in the project but i did not include project 2's classes which were salesreport and main class



Clearly the expectation was that Main was part of this project. It was even supposed to change according to the directions. It also looks like you are expected to build on top of previous projects, not ignore them once they are done. So your problem was that you didn't submit the Main class, meaning there was no proof you followed the directions for the assignment.
 
Mack Grill
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Clearly the expectation was that Main was part of this project. It was even supposed to change according to the directions. It also looks like you are expected to build on top of previous projects, not ignore them once they are done. So your problem was that you didn't submit the Main class, meaning there was no proof you followed the directions for the assignment.


so what do I need to move over to the Main class?
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mack Grill wrote:but I do have some methods in the SalesReport class

Mack,

I've asked you once: PLEASE DontWriteLongLines (READ THE LINK).

Until you correct your post, you will get no help from me.

Winston
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mack Grill wrote:
Clearly the expectation was that Main was part of this project. It was even supposed to change according to the directions. It also looks like you are expected to build on top of previous projects, not ignore them once they are done. So your problem was that you didn't submit the Main class, meaning there was no proof you followed the directions for the assignment.


so what do I need to move over to the Main class?



While this is a somewhat interesting discussion, you should know that we are speculating right? Before you start *tweaking* your code, shouldn't you get clarity from your instructor on the exact issue?

Henry
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!