Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Plaase answer the question in PHYTON !!! Tasks GMU-Mobile, a new cell phone init

ID: 3750482 • Letter: P

Question

Plaase answer the question in PHYTON !!!

Tasks GMU-Mobile, a new cell phone initiative by GMU, is offering three new cell phone plans to its students starting 2019. Your task is to help your friends decide which cell phone plan to purchase based on their monthly usage. Refer to the table below to see a description of the monthly plans. Plan Cost Per Month (S) S15 S20 S25 Free Calls (minutes Texts 100 175 250 Free Price for additional Price for additional calls per minute (S) text (S) 1.50 1.25 Basic Standard Premium 1000 1500 2000 0.75 0.5 0.25

Explanation / Answer

import operator

def cost_efficient_plan(age,major,is_in_military,gpa,num_minutes,num_text):

costPerMonth_Basic=15;

costPerMonth_Standard=20;

costPerMonth_Premium=25;

freeCall_Basic=100;

freeCall_Standard=175;

freeCall_Premium=250;

freeTexts_Basic=1000;

freeTexts_Standard=1500;

freeTexts_Premium=2000;

addCall_Basic=1.5;

addCall_Standard=1.25;

addCall_Premium=1;

addText_Basic=0.75;

addText_Standard=0.5;

addText_Premium=0.25;

TotalCost_Basic=0.0;

TotalCost_Standard=0.0;

TotalCost_Premium=0.0;

callDiff_Basic=0;

callDiff_Standard=0;

callDiff_Premium=0;

textDiff_Basic=0;

textDiff_Standard=0;

textDiff_Premium=0;

if(num_minutes>freeCall_Basic):

callDiff_Basic=num_minutes-freeCall_Basic;

if(num_text>freeTexts_Basic):

textDiff_Basic=num_text-freeTexts_Basic;

if(num_minutes>freeCall_Standard):

callDiff_Standard=num_minutes-freeCall_Standard;

if(num_text>freeTexts_Standard):

textDiff_Standard=num_text-freeTexts_Standard;

if(num_minutes>freeCall_Premium):

callDiff_Premium=num_minutes-freeCall_Premium;

if(num_text>freeTexts_Premium):

textDiff_Premium=num_text-freeTexts_Premium;

TotalCost_Basic=costPerMonth_Basic+callDiff_Basic*addCall_Basic+textDiff_Basic*addText_Basic;

TotalCost_Standard=costPerMonth_Standard+callDiff_Standard*addCall_Standard+textDiff_Standard*addText_Standard;

TotalCost_Premium=costPerMonth_Premium+callDiff_Premium*addCall_Premium+textDiff_Premium*addText_Premium;

dict = {'Premium': TotalCost_Premium, 'Standard': TotalCost_Standard, 'Basic': TotalCost_Basic};

cheapestPlan=min(dict.iteritems(), key=operator.itemgetter(1))[0];

return cheapestPlan;