Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Implement a function priceTShirt in Python that computes and returns the price of a T-shirt.
- The function accepts two arguments: a) the size of the T-shirt, one of 'S','M','L' and b) a str containing a slogan to be written on the shirt.
- The shirts have a base price of 12 dollars for small shirts, 15 dollars for medium and 18 dollars for large.
- The cost of the slogan depends on the amount of ink used to print the characters:
each lower case letter costs 25 cents,
each upper case letter costs 30 cents,
each punctuation mark, anyone of marks appearing in .,!'"?: cost 20 cents,
whitespace, either a space or newline character, cost 0 cents (no ink!).
you may assume the slogan has no characters other than those mentioned above
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- A pedometer treats walking 2,000 steps as walking 1 miles. Define a function name StepsToMiles that takes an integer as a parameter, representing the numbers of steps, and returns a float that represents the number of miles walked. Then, write a main program that reads the number of steps as an input, calls function StepsToMiles() with the inputs as an argument, and outputs the miles walked.arrow_forwardA County collects property taxes on the assessment value of the property, which is 60 percent of the property's actual value. For example if an acre of land is valued $10,000.00 its assessment value is $6000. The property tax is 72 cents for each $100.00 of the assessment value. The tax for the assessed at $6000 will be $43.20. Write a PYTHON program using FUNCTIONS that asks for the actual value of a piece of property and displays the assessment value and property taxarrow_forwardDefine a function drawCircle. This function should expect a Turtleobject, the coordinates of the circle’s center point, and the circle’s radius as arguments. The function should draw the specified circle. The algorithm should draw the circle’s circumference by turning 3 degrees and moving a given distance 120 times. Calculate the distance moved with the formula 2.0 × π × radius ÷ 120.0. Define a function main that will draw a circle with the following parameters when the program is run: X = 50 Y = 75 Radius = 100arrow_forward
- Given the function of def happyBirthday(name, age = 10): print("Happy Birthday", name, "I hear your", age, "today") What is the output with a function call of: happyBirthday(age = 7, "Sarah") Happy Birthday Sarah I hear your 10 today Happy Birthday Sarah I hear your 7 today Happy Birthday 7 I hear your Sarah today Error Message Parameters are __________ Variables defined in a function header. Variables or constants used in a function call. Both variable defined in a function header, and a local variable for the function Local variables to a function. from graphics import * def drawDoor(x1, y1, x2, y2): '''draws a door with opposite corners at x1, y1 and x2, y2''' door = Rectangle(Point(x1, y1), Point(x2, y2)) door.setFill('red') door.draw(win) knob = Circle(Point(x2 - 10, (y1 + y2)//2), 3) knob.setFill('yellow') knob.draw(win) True or False: the function call is…arrow_forwardwrite a python code:arrow_forwardUSE PYTHON TANK YOUarrow_forward
- ***python only *** Write a function that takes two parameters, a and b, both are strings taken from "SCISSORS", "PAPER", or "ROCK, and returns True if a wins over b according to the rules of theScissors-Paper-Rock game; False, otherwise. For example, when a is "SCISSORS" and b is "PAPER", the function should return True.arrow_forwardWrite a function in Python called calc_length that takes two arguments, the length of the string L and the temperature T. This function should compute the new length of the string, taking into account the thermal expansion of the string relative to 20 degress (C). That new length should be returned from the function when it is called.arrow_forwardpython: Create a function called myemail that takes two arguments: a first name and a last name, and returns a Blue Ridge email address in lower case. The email is made by taking the first letter of the first name and the first 5 letters of the last name and adding 01 and @my.blueridgectc.edu to the end. For example, the function call: myemail('Amelia','Earhart') should return aearha01@my.blueridgectc.eduarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education