Struggling with the code and very new to programming and C++

Create a flowchart and Pseudocode and create a C++ Program. Prompt the user for salary per year and calculate a Christmas bonus based on number of years worked. Between 1 to 5 years 1% of salary. More than 5 years 2% of salary.
Last edited on
Have you learnt nothing from your previous thread?
https://www.cplusplus.com/forum/beginner/273103/

> Due Tonight
http://www.catb.org/esr/faqs/smart-questions.html#urgent
Maybe you need some time management lessons.

You also need to start posting some actual effort to solve your own problems.
http://www.catb.org/esr/faqs/smart-questions.html#idm379

> Create a flowchart and Pseudocode and create a C++ Program.
You have 3 distinct tasks, have you done anything at all?
https://en.wikipedia.org/wiki/Flowchart#Common_symbols
You need 2 prompts and inputs - salary/per & years worked. Then you need if statements to see if the years worked is >=1 and <=5 for 1% bonus or > 5 for 2% bonus. Note that if worked less than 1 year, no bonus.
What would that look like in code? I'm so new at all this and have been struggling with this since last Wednesday. If anyone could please help me out I would greatly appreciate it.
Just focus on one part at a time.

Show us what you would do for just this part: "Prompt the user for salary per year".
i.e., tell the user to type in what their salary is (some number).
Can you do that?
Here is a tutorial on basic input/output: http://www.cplusplus.com/doc/tutorial/basic_io/
Read it and practice it.

1
2
3
4
5
6
7
#include <iostream>
#include <string>

int main()
{
    // your code here
}
Last edited on
Topic archived. No new replies allowed.