Selecting algorithm | Matlab Examples

Matlab Tutorials | Examples

Practice 2:

A cell phone company offers three different price packages to its clients. In all of the
packages there is a fixed monthly fee; in addition, telephone calls are priced
according to per minute calling rate of that package. Package prices are as follows:
order of Package A, Package B, Package C
Monthly fixed rate 1.50 TL, 5.00 TL, 10.00 TL
Same operator calls 0.35 TL/min, 0.35 TL/min, 0.10 TL/min
Land line calls 0.40 TL/min, 0.35 TL/min, 0.20 TL/min
Other operator calls 0.60 TL/min, 0.35 TL/min, 0.30 TL/min

Write a MATLAB program that will do the following:

  1. Get the package type (“A”, “a”, “B”, “b”, “C”, or “c”).
  2. Readthenumberofminutestheclienthascalledsameoperatornumbers,land line numbers, and other operator numbers.
  3. If any of the durations is negative, display a warning and stop.
  4. Calculate and display the client’s bills



Bellow code shows the how to pick best phone sector with given using inputs


Leave a Reply

Your email address will not be published. Required fields are marked *