Help me correct my C++ code please! Pictures included. My current code with the error picture; #include using namespace std; class Employee { public: string first_name; string last_name; int...


Help me correct my C++ code please! Pictures included. My current code with the error picture;


#include

using namespace std;

class Employee
{
    public:
    string first_name;
    string last_name;
    int monthly_sal;
    Employee()
    {
        first_name="";
        last_name="";
        monthly_sal=0;

    }
    void setFirst_Name(string first_name)
    {
        this->first_name=first_name;
    }
    void setLast_Name(string last_name)
    {
        this->last_name=last_name;
    }
    void setSal(int monthly_sal)
    {
        if(monthly_sal<>
        this->monthly_sal=0;
        this->monthly_sal=monthly_sal;
    }
    string getFirst_Name()
    {
     return first_name;
    }
    string getLast_Name()
    {
        return last_name;
    }
    int get_salary()
    {
        return monthly_sal;
    }
    int get_yearly_salary()
    {
        return 12*monthly_sal;
    }
};

int main()
{
  Employee ob;
  string first_name,last_name;
  int monthly_sal;


  cout<"enter: the="" employee's="" first="" and="" last="" name:="">
               cin>> last_name;

  cout<"enter: the="" employee's="" monthly="" salary:="">
               cin >> monthly_sal;

cout<"salary before="" the="" raise="" was="" 0"=""><>
cout<"yearly salary="" after="" the="" raise="" is="" 0"=""><>
    return 0;
}


Problems Detected:<br>The contents of your standard output is incorrect.<br>Given the following was entered from the keyboard:<br>John Doed<br>|-23의<br>you displayed:<br>Enter: the employee's-first-and·last-name: Enter: the employee's monthly•salary: salary-before the•raise-was 0d<br>yearly salary•after•the-raise•is-0d<br>instead of:<br>Enter: the employee's first-and•last-name: Enter:•the employee's-monthly salary:-John Doe's•yearly-salary-before-the-raise was 0d<br>John-Doe's-yearly-salary-after•the-raise-is 0J<br>Failed 4 out of 4 test runs.<br>Failed Test Run #1<br>The contents of your standard output is incorrect.<br>Interactive Session - W v<br>Hide Invisibles<br>Highlight: None<br>Show Highlighted Only O<br>Expected Result:<br>Enter:John· Smithe<br>Your Code's Actual Result:<br>· the· employee's first·and -last-name: - Enter:100004<br>·the employee's monthly salary: John Smith's•yearly·salary.before the raise wa<br>John· Smith's.yearly salary·after the raise is:1320004<br>Enter:John- Smithe<br>-the employee's first·and - last name : · Enter:100004<br>-the employee 's monthly salary::salary·before the raise was:0e<br>yearly salary after the raise is:ed<br>

Extracted text: Problems Detected: The contents of your standard output is incorrect. Given the following was entered from the keyboard: John Doed |-23의 you displayed: Enter: the employee's-first-and·last-name: Enter: the employee's monthly•salary: salary-before the•raise-was 0d yearly salary•after•the-raise•is-0d instead of: Enter: the employee's first-and•last-name: Enter:•the employee's-monthly salary:-John Doe's•yearly-salary-before-the-raise was 0d John-Doe's-yearly-salary-after•the-raise-is 0J Failed 4 out of 4 test runs. Failed Test Run #1 The contents of your standard output is incorrect. Interactive Session - W v Hide Invisibles Highlight: None Show Highlighted Only O Expected Result: Enter:John· Smithe Your Code's Actual Result: · the· employee's first·and -last-name: - Enter:100004 ·the employee's monthly salary: John Smith's•yearly·salary.before the raise wa John· Smith's.yearly salary·after the raise is:1320004 Enter:John- Smithe -the employee's first·and - last name : · Enter:100004 -the employee 's monthly salary::salary·before the raise was:0e yearly salary after the raise is:ed

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here