amyceres's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Active Members
Active Posts:
67 (0.27 per day)
Joined:
11-October 12
Profile Views:
139
Last Active:
User is offline Dec 18 2012 06:17 PM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   amyceres has not set their status

Posts I've Made

  1. In Topic: Problem with Departments and Professors...

    Posted 18 Dec 2012

    View Postjimblumberg, on 18 December 2012 - 11:13 AM, said:

    Why? Can't you just change the return type from void to float then return the sum?

    Jim

    Yup I did ...
  2. In Topic: Problem with Departments and Professors...

    Posted 18 Dec 2012

    I going to have to do a separate function for this...I think
  3. In Topic: Problem with Departments and Professors...

    Posted 18 Dec 2012

    void Department::Display_Total_Salary()
    {
    	float sum=0;
    	if (isEmpty())
    		cout<<"The list is empty\n";
    	while (curr)
    	{
    		node *curr=List.head;
                    sum=sum+curr->salary;
    		curr=curr->next;
    	}
    	return sum;
    }
    
    



    else if(in==5)
    {
    cout<<"Total Salary of all departments listed would be "<<One.Display_Total_Salary()+Two.Display_Total_Salary()+Three.Display_Total_Salary()<<endl;
    }
    
    


    I think this should work....hopefully it's correct me if I am wrong...
  4. In Topic: Problem with Departments and Professors...

    Posted 18 Dec 2012

    How about this? where would I put this?

    double totalsalary()
      {
        double sum=0;
        while(curr)
        node*curr =List.head;
        sum=sum+curr->salary;
        curr=curr->next;
      }
      return sum;
    
    
    


    I was thinking of replacing the void Department::Display_Total_Salary()

    with

    void Department::totalSalary(double)


    else if(in==5)
    {
    cout<<"Total Salary of all departments listed would be "<<One.totalSalary()+Two.totalSalary()+Three.totalSalary()<<endl;
    }
    
  5. In Topic: Problem with Departments and Professors...

    Posted 18 Dec 2012

    View Postjimblumberg, on 18 December 2012 - 07:53 AM, said:

    This would be much easier if you were using a vector, or an array of your Department class.

    Please explain what you are trying to accomplish with this line:
                   One+Two+Three.Display_Total_Salary();
    


    Jim



    I am trying to add the departments' employees' salaries together...vs. having to ask which department you want to see the salary for.
    In the menu I had for in==5
    cout<<"5. Display Total Salary for All Employees\n";
    

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Click here to e-mail me

Friends

amyceres hasn't added any friends yet.

Comments

amyceres has no profile comments yet. Why not say hello?