Advertisement
akosiraff

Download SalesTracking

May 13th, 2015
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.93 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/salestracking/
  3. /***********************************************************************
  4. Program Name: ProgramName.java
  5. Programmer’s Name: Student Name
  6. Program Description: Describe here what this program will do
  7. ***********************************************************************/
  8. How to submit your assignment:
  9. The program must have the same name as the assignment title (SalesTracking.java).
  10. The Java source file (*.java) must include a corresponding class file (*.class) program as evidence of success.
  11. In addition to the program source code file and byte code file, put your program source code file and screen shots of your program output files into a Word document.
  12. You must use a zipped folder to send your weekly assignment to the Dropbox. Do not send subfolders within your zipped folder. Place all of the .java and .class file for the week into the one zipped folder. The zip folder should be named CIS355A_YourLastName_iLab_Week1, and this zip folder will contain all the weekly programming assignments.
  13. You must create a sales tracking program named SalesTracking.java. This program must track monthly sales as well as compute average yearly sales, total sales for the year, and which month had the highest sales and which month had the lowest sales.
  14. The program should prompt the user for the sales for each month starting with January. After all the monthly sales have been entered, your program should have methods that do the following.
  15. getSales(): This method prompts the users for the sale for each month. The return value for this method will be the amount that the user entered. This amount should be stored and returned into the corresponding location in the monthlySales array. For example, January sales should be stored in the first location, February sales should be stored in the second location, and so forth. This method should be enclosed in a loop to facilitate this process.
  16. computeTotalSales(monthlySales): This method receives the monthly sales array as an argument and returns the total sales of the year.
  17. computeAverageSales(monthlySales): This method receives the monthly sales array as an argument and returns the average sales for the year.
  18. computeHighestMonth(monthlySales): This method receives the monthly sales array as an argument. This method will search and compare the values of the monthly sales array for the highest value. Once the highest value has been determined, it will store the value in the value that corresponds with the index of that month. The method will return the index of the month with the highest value.
  19. computeLowestMonth(monthlySales): This method receives the monthly sales array as an argument. This method will search and compare the values of the monthly sales array for the lowest value. Once the lowest value has been determined, it will store the value in the value that corresponds with the index of that month. The method will return the index of the month with the lowest value.
  20. displaySaleInfo(totalSales, averageSales, highestMonth, highestSales, lowestMonth, lowestSales): This method will receive the total yearly sales, average monthly sale, the month with the highest sales, as well as the sales for that month and the month with the lowest sales. This method will display all of the data it received as arguments.
  21. All methods must be called from the main method. Sales amounts should be rounded to two decimal places. You should use parallel arrays. Your first array (monthArray) should be initialized with all of the months. This array should have 12 locations of course. Your other array should be named monthlySales. Like your monthArray, this array should be 12 locations and be populated with the getSales( ) method.
  22. Your monthArray should have the following values.
  23. monthArray
  24. JANUARY FEBRUARY MARCH ….. ….. ….. NOVEMBER DECEMBER
  25. You should demonstrate the use of loop and decision structures also.
  26. Download: http://solutionzip.com/downloads/salestracking/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement