Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python! please help! im not sure where to start though i know i will have to use if else statements but i dont know which

Python! please help! im not sure where to start though i know i will have to use if else statements but i dont know which portion of the statements to start with. thank you in advance!

image text in transcribedimage text in transcribed

Plan Basic Standard Premium Cost Per Month (S) $15 $20 $25 Free Calls minutes) 100 175 250 Free Texts 1000 1500 2000 Price for additionalPrice for additional calls per minute (S) text (S) 1.50 1.25 0.75 0.5 0.25 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", 50, 100) calculate_cost("basic", 103, 700) calculate_cost("standard", 102, 699) calculate_cost("standard", 180, 1000) calculate_cost("premium", 180, 1600)+25.0 15.0 19.5 20.0 26.25

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

Inference Control In Statistical Databases From Theory To Practice Lncs 2316

Authors: Josep Domingo-Ferrer

2002nd Edition

3540436146, 978-3540436140

More Books

Students also viewed these Databases questions