Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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. Free Calls minutes Free Texts 1000 1500 2000 Price for additional Price for additional calls per minute (S) text (S) 1.50 1.25 Plan Cost Per Month S15 S20 S25 100 Standard Premium 0.75 0.5 0.25 250 discount (age, major, is in military, gpa): First, we will check to see if a student gets a discount, given the student details. All the discounts are 20% of the overall monthly cost and are only for the basic plan. The Computer Science department is offering its students (exclusively for CS majors) the discount if their GPA is or above 3.5. Students in the military and senior citizens (age 65+), regardless of their major receive the discount. Discounts cannot be stacked (i.e., a student gets a maximum, of 20% discount). Assume age is a non-negative int, major is a string, is in military is a bool, and gpa is a float. The answer is returned as a bool. Note that the string "cs is not the same as "Computer Science". discount (34, "Biology, True, 3.5) discount (35, "Biology False, 3.5) discount (66, "Physics, False, 3.8) discount (21, "Computer Science, False, 3.6) discount (20, "cs", False, 3.7) True False True True False calculate cost(plan, num_minutes, num text): Given the plan type, number of minutes, and number of text messages, calculate the cost. The answer is returned as a float. Assume plan is a string, and num minutes and num text are non-negative ints. Assume that the parameter plan is always given a valid choice: "basic", "standard", or "premium calculate cost ("basic, 5e, 100) calculate cost("basic, 103, 708) calculate cost("standard", 102, 699)20.0 calculate cost("standard", 18, 1000)26.25 calculate_cost "premium 18e, 1688)25. 15.8 19.5 cost_efficient_plan(age, major, is_in military, gpa, num minutes, num text): Given the age, major, whether the student is in military, gpa, number of minutes, and number of text messages, determines which plan is the best. The answer is retuned as a string. You will find the other two functions discount and calculate_cost helpful in implementing this function. Tie-breaking: if the cost of any two plans are the same, choose the plan with more free minutes. Assume num minutes, num_text, and age are non-negative ints, major is a string, is_in_military is a bool, and gpa is a float. cost efficient plan (18, "Biology", False, 3.7, se, see) cost efficient plan (19, "Computer Science", False, 3.7, 1es, 100) "basic" cost efficient_plan (19, "Computer Science", False, 3.5, 11, 10 cost-efficient-plan( 25, "Mechanical Engg", True, 3.e, 178, 1500) cost efficient_plan(25, "Astronomy" False, 3.5, 260, 1se0) "basic" "standard" -"standard" +"premium

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions