If-else-if statements and Logical Operators--Analysis

I NEED HELP!!!


Consider the following program:

// This program illustrates the use of logical operators
// PLACE YOUR NAME HERE

#include <iostream>

using namespace std;

int main()
{
char employmentStatus;
float performanceScore, salaryRaise;

cout << "What’s your employment status?" << endl;
cout << "Enter 1 (full-time), 2 (part-time), or 3 (temporary)"
<< endl << endl;

cin >> employmentStatus;

cout << "Now enter your performance score" << endl;

cin >> performanceScore;

// Enter your code here

cout << "Your salary raise is: $" << salaryRaise<<endl;

system("pause");
return 0;
}

In the remaining exercises you’re to complete the above program to achieve the following results:

• full-time employees get $500.00 raise plus 4% of their current salary if their performance score is 8 or above and 2.5% if their performance score is below 8 but greater or equal to 6
• part-time employees with performance score of 8 or above get a raise equal to 3% of their current salary while those with a performance score below 8 but greater or equal to 6 get a 1.5% raise.
• no raises are given in any other cases.

Exercise 1. Based on the above specifications, list all the possible cases of employee status and performance score. Generate a test data set (list test data points with expected outcome for each)


if you are not going to bother, just drop the class.
make an attempt at it first then post your attempt and questions
Show us what you have done so far and we'll tell you what is wrong with it even if it's ridiculous, we won't judge you we're just here to help ^_^

And we'll point you in the right path if you didn't find it but we need to know what you had come up with so we can correct you.
its not even a code question to start. And this is a GREAT question, one of the few I have seen from students lately that taught something meaningful.

LIST the possible cases from the requirements. This is CRUCIAL to know how to do in real, get paid for it as a job programming. No programming required at all.

Once you have the above, make up a set of values (here, employee type (full or part) and performance score value ) that fall in each of the listed categories. No code needed here either.

Can you do this? Excel/spreadsheet might help you do this, but its not required.
looks like

employee status | perf score | output | example perfscore
full time | >= 8 | 500+ 1.04*current_pay | 10

… fill in more rows like this (this answers both needs, full time / 10 is an example input, and the rest of it is what the rule is)


Last edited on
Topic archived. No new replies allowed.