Drill

ProblemsJava › events

What does this meeting cost

mediumeventsMathJava

Finance wants every meeting priced: length × attendees × hourly rate, rounded down.

meetingCost(minutes: int, attendees: int, ratePerHour: int) → int

Java needs a compiler and Drill does not host one yet, so this page is the reference rather than an exercise: the problem, worked examples, and the solution in full. To type it out, the same problem runs in Python.

Solve it in Python →

Where you start

int meetingCost(int minutes, int attendees, int ratePerHour) {
    
}

Worked examples

CallResult
meetingCost(30, 5, 100)250
meetingCost(60, 3, 80)240
meetingCost(45, 4, 60)180
meetingCost(0, 5, 100)0

Hint

Multiply first, then integer-divide by 60.

Reference solution in Java
int meetingCost(int minutes, int attendees, int ratePerHour) {
    return (minutes * attendees * ratePerHour) / 60;
}

The same problem in another language

More events problems in Java