I need help with this assignmentany assistance is appreciate

I need help with this assignment.....any assistance is appreciated. My biggest problem is getting the TestAccount to run accurately, but I need help coding the rest of it also.....

It is time to complete your sales tracker application. Your marketing department would like the current dollar amount of goods sold this year to be calculated. Total of the goods sold is the combined total of supplies, services, and paper sold, for all sales accounts. This information will be used to promote the success of the company.

Your application needs to be modified to allow all sales personnel to enter their sales data.

For each sales personnel in the company, complete the following:

F1: Accept a sales person’s entry for the dollar amount of office supplies sold, books sold, and apparel sold.

The sum of these three categories will be the total of their supplies sold.

F2: Accept a sales person’s entry for the number of hours of service hours sold and rate per hour.

F3: Accept a sales person’s entry for the number of pounds of paper sold and the price per pound.

Displays the total current sales to date in all 3 categories for the sales person: supplies, books, and paper.

Modify the application to display the total aggregate sales for all sales personnel combined.

Example: Total sales for 2010: $12,500,552

Your application will use the Accounts inheritance hierarchy designed previously to compute the total of goods sold.

There are three types of sales accounts that track sales for your company:

Supplies

Services

Paper.

Each has their own formula for computing the current sales:

Supplies = office supplies sold dollar amount + books sold dollar amount + apparel sold dollar amount

Services = number of hours * rate per hour

Paper = number of pounds * price per pound

Update your design document with these modifications

Intermediate-level Java programming should be demonstrated in your application:

There should be implemented constructors for each class.

The toString() method should be overridden to provide readable string representation of each object.

Getters and setters need to be implemented to enforce data hiding.

Code should be fully commented.

Program flow should be logical.

Behavior should be encapsulated into methods avoiding all encompassing large main() methods.

Projects should be developed in NetBeans and zipped prior to submission.

Code should compile and run free of exceptions, indicating that debugging tools were used to eliminate any run time errors.

Thanks in advance.

Shawna

Solution

solution

package com.mt.classes;

public interface Sales {

   public int getSalesAmount();

}

package com.mt.classes;

import java.util.Scanner;

public class SuppliesSales implements Sales {
   // initialization
   private int officeSuppliesSoldAmount;
   private int booksSoldAmount;
   private int apparelSoldAmount;
   private int suppliesTotalSales;

   /**
   * @return the suppliesTotalSales
   */
   public int getSuppliesTotalSales() {
       return suppliesTotalSales;
   }

   Scanner scanner = null;

   /**
   * @return the officeSuppliesSoldAmount
   */
   public int getOfficeSuppliesSoldAmount() {
       return officeSuppliesSoldAmount;
   }

   /**
   * @param officeSuppliesSoldAmount
   * the officeSuppliesSoldAmount to set
   */
   public void setOfficeSuppliesSoldAmount(int officeSuppliesSoldAmount) {
       this.officeSuppliesSoldAmount = officeSuppliesSoldAmount;
   }

   /**
   * @return the booksSoldAmount
   */
   public int getbooksSoldAmount() {
       return booksSoldAmount;
   }

   /**
   * @param booksSoldAmount
   * the booksSoldAmount to set
   */
   public void setbooksSoldAmount(int booksSoldAmount) {
       this.booksSoldAmount = booksSoldAmount;
   }

   /**
   * @return the apparelSoldAmount
   */
   public int getApparelSoldAmount() {
       return apparelSoldAmount;
   }

   /**
   * @param apparelSoldAmount
   * the apparelSoldAmount to set
   */
   public void setApparelSoldAmount(int apparelSoldAmount) {
       this.apparelSoldAmount = apparelSoldAmount;
   }

   @Override
   public int getSalesAmount() {

       suppliesTotalSales = officeSuppliesSoldAmount + booksSoldAmount
               + apparelSoldAmount;

       return suppliesTotalSales;
   }

   public SuppliesSales(int officeSuppliesSoldAmount, int booksSoldAmount,
           int apparelSoldAmount) {
       this.officeSuppliesSoldAmount = officeSuppliesSoldAmount;
       this.booksSoldAmount = booksSoldAmount;
       this.apparelSoldAmount = apparelSoldAmount;
   }

   /*
   * (non-Javadoc)
   *
   * @see java.lang.Object#toString()
   */
   @Override
   public String toString() {
       return \"SuppliesSales [officeSuppliesSoldAmount=\"
               + officeSuppliesSoldAmount + \", booksSoldAmount=\"
               + booksSoldAmount + \", apparelSoldAmount=\" + apparelSoldAmount
               + \"]\";
   }

}

package com.mt.classes;

import java.util.Scanner;

public class ServicesSales implements Sales {

   int noofhourssold;
   int rateperhour;

   int totalServicesSales;

   /*
   * (non-Javadoc)
   *
   * @see java.lang.Object#toString()
   */
   @Override
   public String toString() {
       return \"ServicesSales [noofhourssold=\" + noofhourssold
               + \", rateperhour=\" + rateperhour + \"]\";
   }

   public ServicesSales(int noofhourssold, int rateperhour) {
       this.noofhourssold = noofhourssold;
       this.rateperhour = rateperhour;
   }

   public ServicesSales() {
   }

   @Override
   public int getSalesAmount() {

       int totalServicesSales = noofhourssold * rateperhour;

       return totalServicesSales;
   }

}

package com.mt.classes;

import java.util.Scanner;

public class PaperSales implements Sales {

   private int noofpounds;
   private int rateperpound;

   /**
   * @return the noofpounds
   *
   */
   public int getNoofpounds() {
       return noofpounds;
   }

   /**
   * @param noofpounds
   * the noofpounds to set
   */
   public void setNoofpounds(int noofpounds) {
       this.noofpounds = noofpounds;
   }

   /**
   * @return the rateperpound
   */
   public int getRateperpound() {
       return rateperpound;
   }

   /**
   * @param rateperpound
   * the rateperpound to set
   */
   public void setRateperpound(int rateperpound) {
       this.rateperpound = rateperpound;
   }

   public PaperSales() {
   }

   @Override
   public int getSalesAmount() {

       int totalbooksSoldAmount = noofpounds * rateperpound;

       return totalbooksSoldAmount;
   }

   /*
   * (non-Javadoc)
   *
   * @see java.lang.Object#toString()
   */
   @Override
   public String toString() {
       return \"PaperSales [noofpounds=\" + noofpounds + \", rateperpound=\"
               + rateperpound + \"]\";
   }

   public PaperSales(int noofpounds, int rateperpound) {
       this.noofpounds = noofpounds;
       this.rateperpound = rateperpound;
   }

}

package com.mt.classes;

import java.text.NumberFormat;
import java.util.Scanner;

public class Test {

   public static void main(String[] args) {

       Scanner scanner = new Scanner(System.in);
       // servicesales
       System.out.println(\"enter no of hours sold in only positive no\");
       int noofhourssold = scanner.nextInt();
       System.out.println(\"enter rate per hour in dollars $\");

       int rateperhour = scanner.nextInt();
       ServicesSales serviceSales = new ServicesSales(noofhourssold,
               rateperhour);
       int totalServiceSales = serviceSales.getSalesAmount();
       System.out.println(\"totalservicesales\"
               + NumberFormat.getCurrencyInstance().format(totalServiceSales));

       // office supplies sold amount
       System.out.println(\"please enter officeSuppliesSoldAmount $\");
       int officeSuppliesSoldAmount = scanner.nextInt();
       System.out.println(\"please enter booksSoldAmount $\");
       int booksSoldAmount = scanner.nextInt();
       System.out.println(\"please enter apparelSoldAmount in dollars $\");
       int apparelSoldAmount = scanner.nextInt();
       SuppliesSales suppliesSales = new SuppliesSales(
               officeSuppliesSoldAmount, booksSoldAmount, apparelSoldAmount);
       int totalSuppliesSales = suppliesSales.getSalesAmount();
       System.out
               .println(\"totalSuppliesSales\"
                       + NumberFormat.getCurrencyInstance().format(
                               totalSuppliesSales));

       // paper sales
       System.out.println(\"enter no of pounds sold in positive\");
       int noofpounds = scanner.nextInt();
       System.out.println(\"enter rateperpound in positive\");
       int rateperpound = scanner.nextInt();

       PaperSales paperSales = new PaperSales(noofpounds, rateperpound);

       int totalPaperSales = paperSales.getSalesAmount();
       System.out.println(\"totalPaperSales\"
               + NumberFormat.getCurrencyInstance().format(totalPaperSales));

       int totalSales = totalServiceSales + totalSuppliesSales
               + totalPaperSales;

       System.out.println(\"totalSales\"
               + NumberFormat.getCurrencyInstance().format(totalSales));

   }

}

output

enter no of hours sold in only positive no
25
enter rate per hour in dollars $
36
totalservicesales$900.00
please enter officeSuppliesSoldAmount $
25000
please enter booksSoldAmount $
36000
please enter apparelSoldAmount in dollars $
600
totalSuppliesSales$61,600.00
enter no of pounds sold in positive
35
enter rateperpound in positive
6200
totalPaperSales$217,000.00
totalSales$279,500.00

I need help with this assignment.....any assistance is appreciated. My biggest problem is getting the TestAccount to run accurately, but I need help coding the
I need help with this assignment.....any assistance is appreciated. My biggest problem is getting the TestAccount to run accurately, but I need help coding the
I need help with this assignment.....any assistance is appreciated. My biggest problem is getting the TestAccount to run accurately, but I need help coding the
I need help with this assignment.....any assistance is appreciated. My biggest problem is getting the TestAccount to run accurately, but I need help coding the
I need help with this assignment.....any assistance is appreciated. My biggest problem is getting the TestAccount to run accurately, but I need help coding the
I need help with this assignment.....any assistance is appreciated. My biggest problem is getting the TestAccount to run accurately, but I need help coding the

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site