SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 314 Weeks Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 12 Dec 2017 My Price 10.00

produce screen capture of the output as explained

I have done all the work but cannot produce screen capture of the output as explained by Project1 instructions. Can you help? Attachment labeled Project1 are the instructions. Submission requirements Deliverables include all Java files (.java) and a single word (or PDF) document. The Java files should be named appropriately for your applications. The word (or PDF) document should include screen captures showing the successful compiling and running of each of the test cases. Each screen capture should be properly labeled clearly indicated what the screen capture represents. The test cases table should be included in your wopublic class Executive extends Employee {

    private int stockPrice;

    public Executive(String name, int monthlySalary , int stockPrice) {
        super(name, monthlySalary);
        this.stockPrice = stockPrice;
    }

    @Override
    public int annualSalary() {
        int bonus = 30000;
        if (stockPrice > 50) {
            return super.annualSalary() + bonus;
        } else {
            return super.annualSalary();
        }
    }

    @Override
    public String toString() {
        return super.toString() + " stockPrice=" + stockPrice;
    }
   
   
   
   
}
rd or PDF document and properly labeled as well.import java.io.File;
import java.util.Scanner;

public class MainDriver {

    public static void main(String[] args) {

        Employee[] employee2014 = new Employee[10];
        Employee[] employee2015 = new Employee[10];
        int index2014 =0;
        int index2015 =0;

        try {
            File file = new File("data.txt");

            Scanner input = new Scanner(file);

            while (input.hasNextLine()) {
                String line = input.nextLine();
                String [] strSplit = line.split(" ");
                Employee e =null;
                if("Employee".equals(strSplit[1])) {
                    e = new Employee(strSplit[2], Integer.valueOf(strSplit[3]));
                } else if("Salesman".equals(strSplit[1])) {
                    e = new Salesman(strSplit[2], Integer.valueOf(strSplit[3]) , Integer.valueOf(strSplit[4]));
                } else if("Executive".equals(strSplit[1])) {
                    e = new Executive(strSplit[2], Integer.valueOf(strSplit[3]) , Integer.valueOf(strSplit[4]));
                }
                if("2014".equals(strSplit[0])) {
                    employee2014[index2014++] = e;
                } else {
                    employee2015[index2015++] = e;
                }
            }
            input.close();
            
            //2014 report
            int totalSalary = 0;
            for(int i=0 ; i < index2014 ; i++) {
                System.out.println(employee2014[i].toString());
                int annualSalary = employee2014[i].annualSalary();
                System.out.println("Annual Salary :" + annualSalary);
                totalSalary = totalSalary + annualSalary;
            }
            
            System.out.println("The average Salary for Employees in 2014 is : " + totalSalary/(index2014));
            System.out.println();
            
            //2015 report
            totalSalary = 0;
            for(int i=0 ; i < index2015 ; i++) {
                System.out.println(employee2015[i].toString());
                int annualSalary = employee2015[i].annualSalary();
                System.out.println("Annual Salary :" + annualSalary);
                totalSalary = totalSalary + annualSalary;
            }
            
            System.out.println("The average Salary for Employees in 2015 is : " + totalSalary/(index2015));
        } catch (Exception ex) {
            ex.printStackTrace();
        }

    }

}public class Salesman extends Employee {

    private int annualSales;

    public Salesman(String name, int monthlySalary , int annualSales) {
        super(name, monthlySalary);
        this.annualSales = annualSales;
    }

    @Override
    public int annualSalary() {
        int commision = annualSales * 2 / 100;

        if (commision > 20000) {
            return super.annualSalary() + 20000;
        } else {
            return super.annualSalary() + commision;
        }
    }

    @Override
    public String toString() {
        return super.toString() + " annualSales=" + annualSales;
    }

}


Attachments:

Answers

(5)
Status NEW Posted 12 Dec 2017 07:12 AM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)