Explore BrainMass

Explore BrainMass

    Java / C# Programming Help

    Not what you're looking for? Search our solutions OR ask your own Custom question.

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    I have no idea in doing the following:

    Create new salary object based on the gross salary
    Store new salary object in array
    Check if the new gross salary is the new minimum and update accordingly
    Check if the new gross salary is the new maximum and update accordingly

    Please see the attachemnts for details.

    © BrainMass Inc. brainmass.com November 24, 2022, 11:52 am ad1c9bdddf


    Solution Preview

    when you create Salary class, try to create a struct in the header file which contains all information. for example,

    struct salary
    {float grossSalary,

    you can have it outside class declaration almost like global.

    Then in payroll class where you invoke the main function, the C++ code may be like the following

    #include <iostream.h>
    #include "Salary.h"
    #include <math.h>

    // Main( ) provides the entry point for the program. It does not
    // accept any command-line arguments nor does it return a value to
    // the calling program.

    void Main( )
    cout << " Welcome to the Salary calculator program " << endl << endl;
    int num;
    Salary sal;
    float min =100000000.0;
    float max =-1000000.0;
    float grossSalary = ...

    Solution Summary

    The new salary object based on the gross salary is created. The new minimum and updated accordingly is found.