• my assignment is to find the commission of each monthly sales,how can i get the right answer?
monthly sales is 0-19,999(4%)/ 20,000-29,999(5%) /30,000-39,999(6%) / 40,000-49,999(7%)
50,000-above(9%)
using if/else statement

then,,how can I make a flow chart related on this problem.?

can you plese lead me to the right answer?

Try stating it in words:

if sales are less than 20000, commission is 4%

otherwise, if sales are less than 40000, commission is 6%

otherwise, if sales are less than 50000, commission is 7%

otherwise, commission is 9%

With this, you can create a flowchart with 3 decision shapes.

Remember, when you have range problems like this, as long as you use if...else if structure, you don't have to test for low to high values for each range, just whichever limit you're looking at for each new block.

Jain, we don't do your homework for you. Please make an attempt to solve the problem, and then post your code here. Then we can help you. Your post is not clear to us - or me at least.

if you going to run the code you have typing,this is the output you will be seen..
..
sample output
monthly sale=15250
commission=610

next output ;
monthly sale=-5
commission=invalid output

last output;
monthly sale=45280
commision=170

the code is example like this..
#include (iostream)
using namespace std;

int sale;
double commission;
int result;

cout<<"enter monthly sales"<<endl;
cin>>monthly sales;

then...<.help me!!!>`

Edited 2 Years Ago by anie saminiano: for me to clarify what i been post,,,

i dont understand what are the 15 reputation points in order to unlock the full website? what does it mean...who can tell me,,please!

Where is your 'int main()' function ?

Every C or C++ program needs one.

#include <iostream> // use <  > brackets

using namespace std;

int main()
{
    // your code goes here ...

    double monthly_sales, commission;

    bool more = true;
    do // main loop where you input & output ... 
    {

        cout << "Enter monthly sales: " << flush;
        cin >> monthly_sales;
        while( cin.get() != '\n' ); // eat '\n' etc.

        // your code goes here to calculate and
        // output results ...

        cout << "More (y/n) ? " << flush;
        int reply = cin.get();
        if( reply != '\n' ) while( cin.get() != '\n' ) ; // flush cin stream ...
        more = (reply != 'n' && reply != 'N' ); // defaults to yes (more) ...

    }
    while( more );

    return 0;
}
This article has been dead for over six months. Start a new discussion instead.