The One-Stop Software Outsourcing Solution  

Login

Custom Software Buyers
Request new bids
My Account
 
My General Info
 
My bid requests
  My escrow account
 
Help for Buyers
 

Custom Software Coders

Newest open work
Browse all work
Search all work
My Account
 
My General Info
 
My bids
  My credit account
 
Help for Coders
 

Affiliates

My account
 
My pipeline
 
My credit account
 
Help for Affiliates
 
Newest Open Bid Requests.
Image Submission/Gall ery
By kemikalz on 5/11
Max Bid: $100


VB 6 to VB .NET Conversion
By ddd5119 on 5/11
Max Bid: $30


Access to Visual Basic
By Jeff on 5/11
Max Bid: Open to fair suggestions


Extensive affiliate program
By zebcom on 5/11
Max Bid: Open to fair suggestions


HNC Parkash Project
By CarlaWhyte on 5/11
Max Bid: Open to fair suggestions


Flash logo
By Geir on 5/11
Max Bid: Open to fair suggestions


VB.net code needed to add Active Directory User in ...
By rsanderson on 5/11
Max Bid: $25


Java VR
By Geir on 5/11
Max Bid: Open to fair suggestions


3 ASP pages Needed
By Jhome EL on 5/11
Max Bid: $30


Click here to put this ticker on your own site

Open Work Categories
Database 
Documentation 
Graphics / Art 
   3d Animation 
   Art Misc. 
Language Specific 
   ASP 
   C# 
   C++ / C 
   Cold Fusion 
   Delphi 
   Java 
   Perl 
   PHP 
   XML/XSL 
   Visual Basic 
   Visual Basic .Net 
   Other 
Misc 
   Security 
MultiMedia 
Network 
   Network Design 
   Network Implementation 
Platforms 
   Windows 
     Exchange 
     Other 
   Internet Browser 
   UNIX 
   Hand Held/PDA Programming 
Requirements 
Testing / Quality Assurance 
Web 
   Flash 
   Page Design 
 
Other
 
Other Sites

Download the free Rent A Coder IE toolbar!
 
Show Bid Request

An Object-Oriented Program
Bid Request Id: 4600
Bookmark
Posted by: walla (8 ratings)
(Software buyer rating 10)
Posted: 11/6/2001 1:25:49 PM EST
Bidding Closes: 11/7/2001 9:28:50 PM EST
Viewed: 254 times
Phase:
100% of work completed and accepted. Coder has been paid.
Max Accepted Bid: Bidding is closed
Project Type: Personal Project / Homework Help
Bidding Type: Open Auction
Categories: Language Specific, C++ / C
Enter chat room for this bid request
(0 active users)

Description:
Create a class, Phone, that has three types of private data:

Deliverables:
1) A phone number, made up of three integers:
area_code (3 digits), prefix (3 digits), last_four (4 digits).

In other words, if the number for a phone object was to be (650)949-7777, then area_code=650, prefix=949, and last_four=7777.

2) Two per/minute rates (doubles): one local and one long distance:
local_rate: basic charge for local calls, per minute.
ld_rate: basic charge for long distance calls, per minute.

These rates will be modified under certain conditions listed below.

3) Values (doubles) that constantly change:
local_minutes: the number of local minutes that this phonehas used since last bill.
ld_minutes: the number of long distance minutes that this phone has used since last bill.
total_charges: the accumulated charges since the last bill.

Public member functions:
void Phone::Init(long ac, long pfx, long last4
This method will set the phone number to the arguments passed in and all the remaining private members to 0.
This could be done by a constructor, althought we have not officially had them yet, so we can use an ordinary member function for this assignment.
-----
void Phone::SetCharges( double local_rt, double ld_rt )
This method will set the local_rate and ld_rate according to the values passed in. If either argument is negative, it prints an error and does not change the private members.
-----
void Phone::MakeCall( Phone callee, long duration_in_secs )
The most complex of the member functions, this method will compute the charges for a single call to callee that lasts duration_in_secs seconds.
The algorithm for this function is as follows:

The object that is used to call this function is the call-er. The first parameter is the call-ee, that is, the number that the caller is calling.

If the area code of the callee and the object doing doing the calling (the call-ER) are the same, the local_rate applies.
If the area code of the callee and the object doing doing the calling (the call-ER) are different, the ld_rate applies.

Further adjustments to the rate must then be made:
For local calls, if the prefix of the callee differs from the prefix of the caller by more than 200 then the local_rate should be doubled.
e.g., (650) 949-7384 and (650)949-5250 would be local_rate, while (650) 949-7384 and (650)748-5610 would be 2*local_rate.

For long distance calls, if the area code of the callee differs from the area code of the caller by more than 200 then the ld_rate should be doubled.
e.g., (650) 949-7384 and (464)850-5250 would be ld_rate, while 650) 949-7384 and (408)555-5610 would be 2*ld_rate.

Once the rate for the call is determined, the charge for that one call should be calculated and added to the accumulated total_charges for that month.
-----
void
Phone::PrintBillAndReset();
This should report the summary of charges for the month by printing the total charges and the number of local and long-distance minutes used. It should also clear out these three values in preparation for a new month of billing.

Test this out by creating several (3 - 5) Phone objects and having them call each other. They should be in various area codes and prefixes (although at least 2 should be local to each other). Print out the phone bill for these Phones, then make a call or two more, and print again to confirm that the old charges were erased when the first bill was printed.

Here is an example of the start (but not completion!) of a main that tests this class:

-----------------
Phone me, mom, dad, flynn, tenya;

me.Init(415, 435, 9792);
mom.Init(415, 940, 6654);
dad.Init(561, 324, 7693);
flynn.Init(561, 320, 1208);
tenya.Init(969, 234, 1221);

me.SetCharges(.03, .10);
mom.SetCharges(.03, .10);
dad.SetCharges(.03, .10);
flynn.SetCharges(.04, .8);
tenya.SetCharges(.02, .15);

me.MakeCall( mom, 300);
dad.MakeCall( mom, 240);
me.MakeCall( dad, 121);
// the main() function continues to go on and test ...

// ... the test would consist of printing bills ...

me.PrintBillAndReset();
mom.PrintBillAndReset();
dad.PrintBillAndReset();
// etc ...

// and checking that the output matches your program.

---------------------


Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements. We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation. If you notice a violation, you can report it to: abuse@rentacoder.com.
 
Bidding/Comments:
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests.

See all rejected bids (and all comments)
Name Bid Amount Date Coder Rating
This bid was accepted by the buyer!
Sammy Leong
(75 ratings)
in Scarborough, Ontario
Canada
$25 11/6/2001 6:35:26 PM EST  10
(Excellent)
   
How's $25 sound to you? :)
Please let me know the deadline.
 
 
 
 
  See 2 private reply(ies)
to/from Sammy Leong.
 




Quick Search
 

 Advanced Search
Newest Open Work

 

 
Rent A Coder upholds the rigorous business practices required to be both a BBB member and Square Trade vendor.
  • All customer issues addressed within 2 days
  • Openly disclosed pricing and return policies
  • Participation in mediation at buyer request
  • Superior selling track record
This site is verified through it's parent company, Exhedra Solutions, Inc.
 

Rent A Coder Top Coders.


Anuj Gakhar
Rated a 9.96 on 43 jobs 
felichko
Rated a 10 on 13 jobs 
psycode
Rated a 9.88 on 19 jobs 
Sammy Leong
Rated a 10 on 76 jobs 
Sreeny
Rated a 9.95 on 24 jobs 
Michael Sharp
Rated a 9.95 on 73 jobs 
Theo Kandilioti s
Rated a 10 on 19 jobs 
Chuck Hall
Rated a 10 on 20 jobs 
Appwalk Technologi es Canada
Rated a 10 on 12 jobs 
NovaSoftek
Rated a 10 on 3 jobs 

See all top coders...

What makes a top coder?
 
Other
Rent A Coder is PayPal verified through it's parent company, Exhedra Solutions, Inc.

Created in partnership with:

 
In memory of the victims and the courageous rescuers of 9/11/2001


Affiliate Sites


About Us | Kudos | Feedback    Affiliates | Advertise    Privacy | Legal

Copyright © 2001, Exhedra Solutions, Inc. All rights reserved.
By using this site you agree to its Terms and Conditions.
"Rent A Coder" (tm) and "Safe Project Escrow" is a trademark of Exhedra Solutions, Inc.