Question

// Enter your name as a comment for program identification // Program assignment testEmployeeAB.cpp // Enter...

// Enter your name as a comment for program identification

// Program assignment testEmployeeAB.cpp

// Enter your class section, and time

/* The program testEmployeeAB.cpp tests the class Employee.

The class Date is included so

that the Employee class can use the Date data type. */

/* Data is entered to create an employee data file. */

/* A payroll report and equal employment opportunity report

showing ethnicity data is displayed. */

//header files

/* use the correct preprocessor directives for

input/output */

#include <iostream>

#include <iomanip>

#include <string>

#include "Employee.h"

#include "Date.h"

using namespace std;

/* The function instruct describes the use

and purpose of the program. */

void instruct();

// main function

int main()

{

// declare variables

/* an Employee object hourly to test the

default constructor and an Employee

object suit to test the constructor

with a parameter */

instruct();

Employee hourly;

Employee suit(25);

// call the member function pay with the object hourly

_________._____();

// call the member function eeo with the object hourly

__________.___();

// call the member function pay with the object suit

____.____();

// call the member function eeo with the object suit

_____._____();

return 0;

}

void instruct()

{

cout << "The program testEmployee.cpp is a driver program to

"

"test the class Employee.\n\n";

}

/*

The program testEmployee.cpp is a driver program to test the class Employee.

Enter first name and last name separated by a space: Juanita Gonzalez

Please enter starting date mm dd yyyy for Juanita Gonzalez: 11 2 2004

Please enter your ethnicity: (C)aucasian, (A)frican American,

(N)ative American, (H)ispanic, A(s)ian, (O)ther: H

Enter first name and last name separated by a space: Gordon Chang

Please enter starting date mm dd yyyy for Gordon Chang: 9 2 1984

Please enter your ethnicity: (C)aucasian, (A)frican American,

(N)ative American, (H)ispanic, A(s)ian, (O)ther: s

How many hours did Juanita Gonzalez work this week? 42

Weekly pay for Juanita Gonzalez is $311.75

The employee ethnicity is Hispanic.

How many hours did Gordon Chang work this week? 54

Weekly pay for Gordon Chang is $1525.00

The employee ethnicity is Asian.*/

I need this code fixed in C++ Thanks!

0 0
Add a comment Improve this question Transcribed image text
Answer #1

HERE, YOU CAN CHECK THE CODE:

#include <iostream>
#include <iomanip>
#include <string>
#include "Employee.h"
#include "Date.h"
using namespacestd;

/* The function instruct describes the use
   and purpose of the program. */
void instruct();

// main function
int main()
{
   // declare variables
   /* an Employee object hourly to test the
      default constructor and an Employee
      object suit to test the constructor
      with a parameter */

   instruct();

   Employee hourly;
   Employee suit(25);

   // call the member function pay with the object hourly
   hourly.pay();
   // call the member function eeo with the object hourly
  hourly.eeo();
   // call the member function pay with the object suit
  suit.pay();
   // call the member function eeo with the object suit
  suit.eeo();

   return0;
}

void instruct()
{
   cout << "The program testEmployee.cpp is a driver program to "
          "test the class Employee.\n\n";
}

In the code, i had filled the comments where you asked to call functions. if any thing else you wanted comment me.

THANK YOU. PLEASE GIVE ME A LIKE. IT WILL HELP ME A LOT.

Add a comment
Know the answer?
Add Answer to:
// Enter your name as a comment for program identification // Program assignment testEmployeeAB.cpp // Enter...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • // Enter your name as a comment for program identification // Program assignment TripCost.cpp // Enter...

    // Enter your name as a comment for program identification // Program assignment TripCost.cpp // Enter your class section, and time /* The program TripCost.cpp uses pointers to calculate    the cost of a trip depending on the cost of a gallon    of gas, the number of miles, and the number of miles    per gallon a car gets. */ /* The cost of gas, the number of miles, and number of    miles per gallon is entered. */...

  • 2. Enter, compile, and run Program 11.1. he same name as the ave a return type...

    2. Enter, compile, and run Program 11.1. he same name as the ave a return type nction as a member Chapter 11 Program 11.1 of this function the parameters include <iostream ing namespace std. *onging to the declaration section class Complex private: 1 double realPart; I notice the colon after the keyword pri eters, real ssigns the he func- ouble imaginary Part; maginaryPart. // function prototypes data // data member the key as also public: 11 again, notice the colon...

  • Write a C++ program Write a class named Employee that has the following member variables: name...

    Write a C++ program Write a class named Employee that has the following member variables: name A string that holds the employee name idNumber An int to hold employee id number department A string to hold the name of the department position A string to hold the job position The class will have three constructors: 1. A constructor that accepts all the internal data such as: Employee susan("Susan Meyers", 47899, "Accounting", "Vice President"); 2. A constructor that accepts some of...

  • employee.h ---------- #include <stdio.h> #include <iostream> #include <fstream> class Employee { private: int employeeNum; std::string name;...

    employee.h ---------- #include <stdio.h> #include <iostream> #include <fstream> class Employee { private: int employeeNum; std::string name; std::string address; std::string phoneNum; double hrWage, hrWorked; public: Employee(int en, std::string n, std::string a, std::string pn, double hw, double hwo); std::string getName(); void setName(std::string n); int getENum(); std::string getAdd(); void setAdd(std::string a); std::string getPhone(); void setPhone(std::string p); double getWage(); void setWage(double w); double getHours(); void setHours(double h); double calcPay(double a, double b); static Employee read(std::ifstream& in); void write(std::ofstream& out); }; employee.cpp ---------- //employee.cpp #include...

  • My Java code from last assignment: Previous Java code: public static void main(String args[]) { //...

    My Java code from last assignment: Previous Java code: public static void main(String args[]) { // While loop set-up boolean flag = true; while (flag) { Scanner sc = new Scanner(System.in); // Ask user to enter employee number System.out.print("Enter employee number: "); int employee_number = sc.nextInt(); // Ask user to enter last name System.out.print("Enter employee last name: "); String last_name = sc.next(); // Ask user to enter number of hours worked System.out.print("Enter number of hours worked: "); int hours_worked =...

  • The rest of question 4: object. Make sure that the implementation of class Employee2 includes all...

    The rest of question 4: object. Make sure that the implementation of class Employee2 includes all necessary revisions to all members functions that appeared in class Employee implementation. Heres a link for the class Employee: http://www.cs117.ghriga.com/blog/2017/10/07/practice-4/ de the program and determine its output if the user enters-2 B) Trace the program and determine its output if the u C) Trace the program and determine its output if the ts D) Trace the program and determine its output if the user...

  • ASAP Please. Python Program Description Create an object-oriented program that allows you to enter data for...

    ASAP Please. Python Program Description Create an object-oriented program that allows you to enter data for employees. Specifications Create an abstract Employee class that provides private attributes for the first name, last name, email address, and social security number. This class should provide functions that set and return the employee’s first name, last name, email address, and social security number. This class has a function: get_net_income which returns 0. Create a Manager class that inherits the Employee class. This class...

  • My Java code from last assignment: Previous Java code: public static void main(String args[]) { //...

    My Java code from last assignment: Previous Java code: public static void main(String args[]) { // While loop set-up boolean flag = true; while (flag) { Scanner sc = new Scanner(System.in); // Ask user to enter employee number System.out.print("Enter employee number: "); int employee_number = sc.nextInt(); // Ask user to enter last name System.out.print("Enter employee last name: "); String last_name = sc.next(); // Ask user to enter number of hours worked System.out.print("Enter number of hours worked: "); int hours_worked =...

  • Please help with this assignment. Thanks. 1. Write a C++ program containing a class Invoice and...

    Please help with this assignment. Thanks. 1. Write a C++ program containing a class Invoice and a driver program called invoiceDriver.cpp. The class Invoice is used in a hardware store to represent an invoice for an item sold at the store. An invoice class should include the following: A part number of type string A part description of type string A quantity of the item being purchased of type int A price per item of type int A class constructor...

  • Comment your code. At the top of the program include your name, a brief description of...

    Comment your code. At the top of the program include your name, a brief description of the program and what it does and the due date. The program must be written in Java and submitted via D2L. The code matches the class diagram given above. The code uses Inheritance. In the following, you are given code for two classes: Coin and TestCoin. You study these classes first and try to understand the meaning of every line. You can cut and...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT