Share
Explore BrainMass

Java / C# programming help

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.

Attachments

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,
cpp,
ei,
pTax,
fTax,
netSalary;
}s[50];

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 = ...

$2.19