also dis one pls

Write your question here.

a regular employee earns $32,500 nnualy . write a program that determines and display what the amount of his gross pay will be for each pay peroid if he is paid twice a month (24 pay checks for year) and if he is paid by weekly (26 checks for year).


where's your attempt?
why is weekly only 26?
Am i understanding it wrong or is it meant to be 52?
?__?
@DyavolskiMost I think they mean bi-weekly vs twice a month. They said by weekly but it was probably a typo.

@OP Please post any code/questions you have. We do not know what you need help with.

Especially since you left this from the template
Write your question here.
At least put in 1% effort when posting please.
Last edited on
1
2
3
4
5
6
7
8
9
int main()
{
int a=32500;
int b=24;
int c=26;

std::cout << "Gross pay for twice a month is " << a/b << std::endl;
std::cout << "Gross pay for biweekly is " << a/c << std::endl;
}
... Providing homework answers without them attempting the problem is frowned upon.

Anyways...you have integer division so the results are going to be close but not perfect.
Sorry
more like
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* Write your question here.

a regular employee earns $32,500 nnualy . write a program that determines and display what the amount of his gross pay will be for each pay peroid if he is paid twice a month (24 pay checks for year) and if he is paid by weekly (26 checks for year).
*/

#include <iostream>
using namespace std;

double twiceMonthly(int revenue){
    double monthlyCheck = (revenue / 24.0);
    return monthlyCheck;
}

double biWeekly(int revenue){
    double biWeeklyCheck = (revenue / 26.0);
    return biWeeklyCheck;
}

int main(){

    // a regular employee earns $32,500 annualy.
    int revenue = 32500;
    cout << "Total annaul revenue: $" << revenue << endl;

    // display amount of gross pay of twice monthly (24 pay checks) & bi weekly (26 checks)
    cout << "Gross pay at twice a month rate: $" << twiceMonthly(revenue) << endl;
    cout << "Gross pay at by weekyl rate: $" << biWeekly(revenue) << endl;
    return 0;
}
Topic archived. No new replies allowed.