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:="">"enter:> cin>> last_name; cout<"enter: the="" employee's="" monthly="" salary:="">"enter:> cin >> monthly_sal;cout<"salary before="" the="" raise="" was="" 0"="">"salary><>cout<"yearly salary="" after="" the="" raise="" is="" 0"="">"yearly><> return 0;}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
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
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here