Questions
Hi, i'm creating a c++ program with a linked list of Employees, i'm running into issues...

Hi, i'm creating a c++ program with a linked list of Employees, i'm running into issues as far as displaying programmers only portion and the average salary of all the employees. Please make any changes or comments !

Employee.h file:

#ifndef EMPLOYEE_H

#define EMPLOYEE_H

#include

using namespace std;

enum Role {programmer, manager, director};

struct Employee

{

std::string firstName;

std::string lastName;

int SSN;

std::string department;

double salary;

Role role;

};

#endif

#ifndef NODE_H

#define NODE_H

Node.h file:

#include "Employee.h"

typedef Employee EMP;

struct Node

{

EMP e;

Node * next;

Node();

Node(EMP);

Node(EMP,Node* next);

};

Node::Node()

{

next=NULL;

}

Node::Node(EMP e_data)

{

e=e_data;

}

Node::Node(EMP e_data, Node* next)

{

e=e_data;

this->next= next;

}

#endif

Main cpp file:

#include <iostream>

#include <cstdlib>

#include <ctime>

#include "Employee.h"

#include "Node.h"

using namespace std;

void setSalary (Employee& emp)

{

emp.salary= 45000+rand() %20000; // generates salary for employee

}

void setRoles(Employee& emp)

{

emp.role = static_cast(rand()%3); // gives employee job title

}

void setSSN (Employee& emp)

{

// int y = x;

emp.SSN =rand()%499999999+400000000; // sets employee SSN

}

void setFirst( Employee& emp, string* name)

{

int y = rand()%5;

emp.firstName = name[y]; //gives random first name

}

void setLast(Employee& emp, string* name)

{

int y = rand()%5;

emp.lastName = name[y]; // gives random last name

}

void setDepartment(Employee& emp, string * dep)

{

int y = rand()%3;

emp.department= dep[y]; //gives employee random department

}

int main()

{

srand(time(NULL)); // random number generator

double avgSalary; // initialize Average Salary

Node* head= NULL; // starting node

Node* prev= NULL; // node next to the last one

Employee e; // object instance

// array of names, roles(job titles), and departments

string roleType [3] = {"programmer", "manager", "director"};

string firstName[5] = {"John", "James", "Joe", "Jessica", "Juno" };

string lastName[5] = {"Smith", "Williams", "Jackson", "Jones", "Johnson" };

string department[5]= {"Accounting", "IT", "Sales" };

// Create linked list of employees

for (int i = 0; i<10; i++)

{

Employee e;

// function calls (roles, salary ...etc)

setFirst(e, firstName);

setLast(e, lastName);

setSSN(e);

setSalary(e);

setRoles(e);

setDepartment(e, department);

// creates nodes for employees

Node*temp = new Node(e);

if (i ==0)

{

head=temp;

prev= temp;

}

else

{

prev->next= temp;

prev = temp; // links the nodes together

}

}

// Display information of all Employees

cout<<"======== Employee Data======="<

prev = head; // starting at the first node

while(prev !=NULL)

{

cout<<(prev->e).firstName<< " ";

cout<<(prev->e).lastName<< " ";

cout<<(prev->e).SSN<< " ";

cout<<(prev->e).salary<< " ";

cout<<(prev->e).department<< " ";

cout

prev= prev->next;

}

cout<<" \n \n";

//

cout<<"======== Programmer Only Data======="<

prev = head; // starts at beginning of linked list

while(prev !=NULL)

{

if (prev->e.role == 0) // checks to see if role is 0 or programmer

cout<<(prev->e).firstName<< " ";

cout<<(prev->e).lastName<< " ";

cout<<(prev->e).SSN<< " ";

cout<<(prev->e).salary<< " ";

cout<<(prev->e).department<< " ";

cout

prev= prev->next; // moves on to next node

// else {

// break;

// }

}

//Computes Average Salary

prev = head; // starts at the first node

while ( prev !=NULL)

{

avgSalary += (prev->e).salary;

prev = prev->next;

}

// Display Average Salary

cout<< "Average Salary: "<< (avgSalary)/5 << "\n";

// Deallocate memory

Node* temp = head;

Node* tail;

while (temp !=NULL)

{

tail=temp->next;

delete temp;

temp = tail;

}

head=NULL;

if (head == NULL )

{

cout<<" List Deleted \n";

}

}

In: Computer Science

The sales manager also understands the importance of giving the right sales incentives to the salesforce...

The sales manager also understands the importance of giving the right sales incentives to the salesforce to have a smooth relaunch of SuperCook in the market. Therefore, the sales manager understands the pivotal role of sales budget in encouraging and controlling the salesforce. In the light of these facts, suggest best approaches to set up sales quotas or sales targets for the salespeople for the relaunched brand and how these are used as meterstick when measuring achievement.   

Few British knew about Dr Oetker a German and European leading food manufacturer who entered the UK market with a frozen pizza named "Pizza Ristorante". So, who is Dr Oetker?
Dr Oetker was a pharmacist from Biefeild in Germany who established the Oetker Group in 1891. Nowadays, the company is one of the largest family businesses in Germany with revenue of 3.5 billion euro per annum. The key ingredient of the company's success is quality; whether in management or product.
Quality of the best recipe:
Oetker management rose the curtain of Pizza Ristorante in Britain, in 2020 and astonishingly was the first investment for a huge and well-reputed food and beverage company from Germany. The promise has been to offer an authentic pizza taste even if it is frozen. In no months, Pizza Ristorante became a popular product across the UK as research pointed out that 76% of consumers give Pizza Ristorante preferences over its competitors' pizzas. Till recent years, the brand made a tremendous journey of success and well established in the UK market.
Recipe of Success:
Dr Oetker is an experienced company when it comes to introducing products in new markets, and food and beverage market, including its frozen pizza brand, a leader in the 23 European countries. Similarly, Ristorante frozen pizza enjoys success in the UK market. Due to its philosophy in quality, Pizza Ristorante is made from high-quality ingredients to satisfy customers who are interested in buying frozen pizzas. Moreover, before entering a market, the company thoroughly study the specific market needs and the nature of its competitors. Therefore, the company through its marketing research found that the dominate taste of the pizza was a thin and crispy segment, accordingly, the company decided to possibly add value by offering high quality and with competitive price of frozen pizza. The goal was to encourage consumers to revisit the frozen pizza category by tasting samples of an authentic pizzeria pizza of Ristorante Pizza.
Onwards and upwards.
As a result of Ristorante brand success, Dr Oetker launched several new products in the UK market; yoghurt, dessert brands 'Onken' is now established and doing well. Dr Oetker's new venture was acquiring SuperCook range of baking and cake decorating products. For now, both companies are in the phase of merging and re-introducing SuperCook with new packaging and promotional material.
Once again, Dr Oetker is a well-established company in the area of baking products back in Germany and EU with a long history of providing baking products. After major success in the frozen pizza segment in the UK, Dr Oekter may go ahead investing more resources in its newly developed product (SuperCook) and again Dr Oetker is aiming to become number one in baking product segment too by using its recipe of success, the one used when launching Ristorante Pizza. However, British baking products are popular for their traditional taste, thus, many UK bakers do not like to have a new thing in their baking process. Moreover, they are suspicious of the innovation in the baking material though this brand has been there in the UK for a long time.
Another task to be taken into consideration is to persuade the UK retailer and super grocery shops to spare shelves for SuperCook (after re-launching product this task may not be easy as it is seen). In other words, SuperCook needs the super grocery continuous support and to allocate shelf space as they used to do before Dr Oetker acquires the business.
The crucial part of the success of re-launch is recruiting a well-trained new salesforce

In: Economics

The sales manager also understands the importance of giving the right sales incentives to the salesforce...

The sales manager also understands the importance of giving the right sales incentives to the salesforce to have a smooth relaunch of SuperCook in the market. Therefore, the sales manager understands the pivotal role of sales budget in encouraging and controlling the salesforce. In the light of these facts, suggest best approaches to set up sales quotas or sales targets for the salespeople for the relaunched brand and how these are used as meterstick when measuring achievement.   

Few British knew about Dr Oetker a German and European leading food manufacturer who entered the UK market with a frozen pizza named "Pizza Ristorante". So, who is Dr Oetker?
Dr Oetker was a pharmacist from Biefeild in Germany who established the Oetker Group in 1891. Nowadays, the company is one of the largest family businesses in Germany with revenue of 3.5 billion euro per annum. The key ingredient of the company's success is quality; whether in management or product.
Quality of the best recipe:
Oetker management rose the curtain of Pizza Ristorante in Britain, in 2020 and astonishingly was the first investment for a huge and well-reputed food and beverage company from Germany. The promise has been to offer an authentic pizza taste even if it is frozen. In no months, Pizza Ristorante became a popular product across the UK as research pointed out that 76% of consumers give Pizza Ristorante preferences over its competitors' pizzas. Till recent years, the brand made a tremendous journey of success and well established in the UK market.
Recipe of Success:
Dr Oetker is an experienced company when it comes to introducing products in new markets, and food and beverage market, including its frozen pizza brand, a leader in the 23 European countries. Similarly, Ristorante frozen pizza enjoys success in the UK market. Due to its philosophy in quality, Pizza Ristorante is made from high-quality ingredients to satisfy customers who are interested in buying frozen pizzas. Moreover, before entering a market, the company thoroughly study the specific market needs and the nature of its competitors. Therefore, the company through its marketing research found that the dominate taste of the pizza was a thin and crispy segment, accordingly, the company decided to possibly add value by offering high quality and with competitive price of frozen pizza. The goal was to encourage consumers to revisit the frozen pizza category by tasting samples of an authentic pizzeria pizza of Ristorante Pizza.
Onwards and upwards.
As a result of Ristorante brand success, Dr Oetker launched several new products in the UK market; yoghurt, dessert brands 'Onken' is now established and doing well. Dr Oetker's new venture was acquiring SuperCook range of baking and cake decorating products. For now, both companies are in the phase of merging and re-introducing SuperCook with new packaging and promotional material.
Once again, Dr Oetker is a well-established company in the area of baking products back in Germany and EU with a long history of providing baking products. After major success in the frozen pizza segment in the UK, Dr Oekter may go ahead investing more resources in its newly developed product (SuperCook) and again Dr Oetker is aiming to become number one in baking product segment too by using its recipe of success, the one used when launching Ristorante Pizza. However, British baking products are popular for their traditional taste, thus, many UK bakers do not like to have a new thing in their baking process. Moreover, they are suspicious of the innovation in the baking material though this brand has been there in the UK for a long time.
Another task to be taken into consideration is to persuade the UK retailer and super grocery shops to spare shelves for SuperCook (after re-launching product this task may not be easy as it is seen). In other words, SuperCook needs the super grocery continuous support and to allocate shelf space as they used to do before Dr Oetker acquires the business.
The crucial part of the success of re-launch is recruiting a well-trained new salesforce

In: Economics

Suppose that the U.S. government decides to charge cola producers a tax. Before the tax, 50...

Suppose that the U.S. government decides to charge cola producers a tax. Before the tax, 50 million cases of cola were sold every month at a price of $7 per case. After the tax, 44 million cases of cola are sold every month; consumers pay $10 per case, and producers receive $4 per case (after paying the tax).

In: Economics

Determine the pH during the titration of 24.3 mL of 0.310 M formic acid (Ka =...

Determine the pH during the titration of 24.3 mL of 0.310 M formic acid (Ka = 1.8×10-4) by 0.442 M NaOH at the following points. (a) Before the addition of any NaOH (b) After the addition of 4.20 mL of NaOH (c) At the half-equivalence point (the titration midpoint) (d) At the equivalence point (e) After the addition of 25.6 mL of NaOH

In: Chemistry

Determine the pH during the titration of 65.9 mL of 0.410 M hypochlorous acid (Ka =...

Determine the pH during the titration of 65.9 mL of 0.410 M hypochlorous acid (Ka = 3.5×10-8) by 0.410 M NaOHat the following points.

(a) Before the addition of any NaOH-?

(b) After the addition of 16.0 mL of NaOH-?

(c) At the half-equivalence point (the titration midpoint) -?

(d) At the equivalence point -?

(e) After the addition of 98.9 mL of NaOH-?

In: Chemistry

1) 20.00 mL of a 0.3000 M lactic acid solution is titrated with 0.1500 M NaOH....

1) 20.00 mL of a 0.3000 M lactic acid solution is titrated with 0.1500 M NaOH.

a. What is the pH of the initial solution (before any base is added)?

b. What is the pH of the solution after 20.00 mL of the base solution has been added?

c. What is the pH of the solution after 40.00 mL of the base solution has been added?

In: Chemistry

Determine the pH during the titration of 22.7 mL of 0.406 M hydrocyanic acid (Ka =...

Determine the pH during the titration of 22.7 mL of 0.406 M hydrocyanic acid (Ka = 4.0×10-10) by 0.492 M KOH at the following points.

(a) Before the addition of any KOH

(b) After the addition of 4.60 mL of KOH

(c) At the half-equivalence point (the titration midpoint)

(d) At the equivalence point

(e) After the addition of 28.1 mL of KOH

In: Chemistry

Determine the pH during the titration of 24.3 mL of 0.310 M formic acid (Ka =...

Determine the pH during the titration of 24.3 mL of 0.310 M formic acid (Ka = 1.8×10-4) by 0.442 M NaOH at the following points.

(a) Before the addition of any NaOH



(b) After the addition of 4.20 mL of NaOH

(c) At the half-equivalence point (the titration midpoint)

(d) At the equivalence point

(e) After the addition of 25.6 mL of NaOH

In: Chemistry

Michaels Corporation expects earnings before interest and taxes to be $ 53,000 for this period. Assuming...

Michaels Corporation expects earnings before interest and taxes to be $ 53,000 for this period. Assuming an ordinary tax rate of 40 %​, compute the​ firm's earnings after taxes and earnings available for common stockholders​ (earnings after taxes and preferred stock​ dividends, if​ any) under the following​ conditions: a. The firm pays $ 11,900 in interest. b. The firm pays $ 11,900 in preferred stock dividends.

In: Finance