Begginer totally stuck in a pseudocode nightmare

I have done very well so far in my class, but this question has me stumped. let me give you the basics. i am a supervisor in a manufacturing company, and i want to know which employees have increased their production this year over last year, so they can get a bonus. I designed the pseudo code for this as part A, not sure if right , but i did.
part B wanted me to pseudocde the same thing with this information
1000 units or fewer bonus is 25 bucks
1001-3000 (50 bucks)
3001-6000 (100 bucks)
6001 or higher (200 bucks)
i did this, again, not sure if right but i did it.
Thirdly and the one i am totally stumped on......wants me to modify question B to reflect these new facts.
( 30% of employees have greater production this year than last year)
(60% of employees produce over 6000 units/yr, 20% produce 3001-6000, 15% produce 1001-3000, and only 5% fewer than 1001.
I have no idea how to pseudocode out percentages..please anyone help me or give me a link or something..... thanks , im not looking for my homework answers, just a little insight to help me get over the hump
Last edited on
To get a percentage just divide the number you have got by the total number you have got, then times by 100.

Obviously the answer of a divided by b needs to be of type double otherwise it will leave you with a value of 0 and anything times 0 is 0!
thanks for that, i really appreciate it, but i know math, i dont know how to write it out in pseudo code....
Sorry if that came across wrong ^^

Could you please post the code you have got so I can see what you're trying to do better.
This is probally totally wrong, its what i came up with for the part B.... as you can tell im new and not getting a good hang yet...

Start
String name
Num ITEMSSOLD1 = 1000
NUM ITEMSSOLD2 = 1001-3000
NUM ITEMSSOLD3 = 3001-6000
NUM ITEMSSOLD4 = 6001
Get name, employee
If employee < = ITEMSSOLD1 then
Bonus = 25
Else
If employee = ITEMSSOLD2 then
Bonus = 50
Else
If employee = ITEMSOLD3 then
Bonus = 100
If employee >= ITEMSSOLD4 then
Bonus = 200
End if
End if
End if
Wheres the c++ code?
By the way, psuedo code is supposed to be written in a natural language at the highest level. You should not be mentioning variable declarations. This is not psuedo code at all.
Translation: write it in COBOL.
Just to get you going, ...


Start
String name
Num ITEMSSOLD1 = 1000
NUM ITEMSSOLD2 = 1001-3000
NUM ITEMSSOLD3 = 3001-6000
NUM ITEMSSOLD4 = 6001


Translates to:
1
2
3
4
5
6
7
8
9
10
11
12
#include <string>

int main()
{
    std::string name;
    int itemssold1 = 1000;
    int itemssold2 = 1001 - 3000;
    int itemssold3 = 3001 - 6000;
    int itemssold4 = 6001;

    return 0;
}

Topic archived. No new replies allowed.