Computer Science, asked by parishaw121, 9 months ago


2. A person is paid 350 for each day he works and fined 30 for each day he
remains absent. Write a program to calculate and display his monthly income,
if he is present for 25 days and remains absent for 5 days.

Answers

Answered by ıtʑFᴇᴇʟɓᴇãᴛ
4

Let the number of days he is absent be x

so the number of days he is present is 30-x

For the days he is present, he earns 150rs per day

so he earns 150*(30-x)

For the days he is absent, he is fined 50rs per day

so he had to pay a fine of 50*x

So the money remaining with him at the end of the month is 150*(30-x) -50*x

and it is given as 2100

so equating,

4500-150x-50x=2100

2400=20x

implies x is 12.

so he is absent for 12 days

Similar questions