Your cell phone provider bills you for minutes consumed per month. The billing rate per minute varies by time of day. The cell phone company rounds usage to the nearest N where N is dependent upon the time of day. Write a C# method based upon the following signature that calculates the amount owed for consumption at any point during the day.

public static double CalculateDollarsOwed(int minutesUsed, int roundingFactor, double billingRatePerMinute)

Sample input and output:

minutesUsed
roundingFactor
billingRatePerMinute
dollarsOwed
0
5
$0.10
$0.00
1
5
$0.10
$0.00
2
5
$0.10
$0.00
3
5
$0.10
$0.50
4
5
$0.10
$0.50
5
5
$0.10
$0.50
6
5
$0.10
$0.50
7
5
$0.10
$0.50
8
5
$0.10
$1.00
9
5
$0.10
$1.00
10
5
$0.10
$1.00
11
5
$0.10
$1.00
12
5
$0.10
$1.00
13
5
$0.10
$1.50

Recommended Answers

All 2 Replies

I'm sorry (not really), but the best way to get your butt ignored is to copy and paste your homework like that. It implies that you think we're obligated to do everything for you, which we aren't. That's very presumptuous and incredibly rude.

I'm sorry (not really), but the best way to get your butt ignored is to copy and paste your homework like that. It implies that you think we're obligated to do everything for you, which we aren't. That's very presumptuous and incredibly rude.

I concur.

I think it's rude enough that I'm going to close the thread. Please read the notices posted at the top of the forum regarding asking homework questions. Refine your question to conform to those guidelines, and repost.

Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.