Starting Out with Python (4th Edition)
4th Edition
ISBN: 9780134444321
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 2.9, Problem 29CP
Write a Python statement that defines a named constant for a 10 percent discount.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
In Python.
Write a code to calculate profit or loss.
Type your question here Write c++ program to find the value of the amount In(Y) if you know that In(Y + X) = (Y +X - 1) - (Y +X – 1)^2/2+(Y+X_1)^3/2+(Y+X_1)^4/2
Use python please. Include bounds and risk.
You are the manager of a £100 million portfolio, and you have 6 investment options:
- First Mortgages: return 9% and risk score 3- Second Mortgages: return 12% and risk score 6- Personal Loans: return 15% and risk score 8- Commercial Loans: return 8% and risk score 2- Government Securities: return 6% and risk score 1- Saving Account: return 3% and risk score 0
The current regulation requires that the amount allocated in second mortgages and personal loans (combined) should not exceed the amount allocated in first mortages.
Given this information:
a) Ignoring the risk involved in the different investment options, what is the profit maximizing allocation of resources? What are the expected profits?
b) Now, you have to consider the risk associated with the investments. The average risk of your portfolio cannot exceed
5. What is the profit maximizing allocation of resources? What are the expected profits?
The average risk is computed as…
Chapter 2 Solutions
Starting Out with Python (4th Edition)
Ch. 2.1 - Who is a programmers customer?Ch. 2.1 - What is a software requirement?Ch. 2.1 - What is an algorithm?Ch. 2.1 - What is pseudocode?Ch. 2.1 - Prob. 5CPCh. 2.1 - Prob. 6CPCh. 2.3 - Write a statement that displays your name.Ch. 2.3 - Write a statement that displays the following...Ch. 2.3 - Write a statement that displays the following...Ch. 2.5 - Prob. 10CP
Ch. 2.5 - Which of the following are illegal variable names...Ch. 2.5 - Prob. 12CPCh. 2.5 - Is the following assignment statement valid or...Ch. 2.5 - Prob. 14CPCh. 2.5 - Look at the following assignment statements:...Ch. 2.5 - What will be displayed by the following program?...Ch. 2.6 - You need the user of a program to enter a...Ch. 2.6 - Prob. 18CPCh. 2.7 - Prob. 19CPCh. 2.7 - Prob. 20CPCh. 2.7 - Prob. 21CPCh. 2.8 - How do you suppress the print functions ending...Ch. 2.8 - How can you change the character that is...Ch. 2.8 - Prob. 24CPCh. 2.8 - Prob. 25CPCh. 2.8 - What does the statement print (format (65.4321,...Ch. 2.8 - What does the statement print (format (987654.129,...Ch. 2.9 - What are three advantages of using named...Ch. 2.9 - Write a Python statement that defines a named...Ch. 2.10 - Prob. 30CPCh. 2.10 - Prob. 31CPCh. 2.10 - Prob. 32CPCh. 2.10 - Prob. 33CPCh. 2.10 - Prob. 34CPCh. 2.10 - Prob. 35CPCh. 2.10 - Prob. 36CPCh. 2.10 - Prob. 37CPCh. 2.10 - Prob. 38CPCh. 2.10 - Prob. 39CPCh. 2.10 - Prob. 40CPCh. 2.10 - Prob. 41CPCh. 2.10 - Prob. 42CPCh. 2.10 - Prob. 43CPCh. 2.10 - Prob. 44CPCh. 2.10 - Prob. 45CPCh. 2 - A ______ error does not prevent the program from...Ch. 2 - Prob. 2MCCh. 2 - A(n) __________ is a set of well-defined logical...Ch. 2 - An Informal language that has no syntax rules and...Ch. 2 - A _______ is a diagram that graphically depicts...Ch. 2 - A ______ is a sequence of characters. a. char...Ch. 2 - Prob. 7MCCh. 2 - Prob. 8MCCh. 2 - A string literal in Python must be enclosed in...Ch. 2 - Prob. 10MCCh. 2 - A(n) __________ makes a variable reference a value...Ch. 2 - This symbol marks the beginning of a comment in...Ch. 2 - Which of the following statements will cause an...Ch. 2 - In the expression 12 + 7, the values on the right...Ch. 2 - This operator performs integer division. a. // b....Ch. 2 - This is an operator that raises a number to a...Ch. 2 - This operator performs division, but instead of...Ch. 2 - Prob. 18MCCh. 2 - Which built-in function can be used to read input...Ch. 2 - Prob. 20MCCh. 2 - A magic number is _______. a. a number that is...Ch. 2 - A _______ is a name that represents a value that...Ch. 2 - Programmers must be careful not to make syntax...Ch. 2 - In a math expression, multiplication and division...Ch. 2 - Variable names can have spaces in them.Ch. 2 - In Python, the first character of a variable name...Ch. 2 - If you print a variable that has not been assigned...Ch. 2 - What does a professional programmer usually do...Ch. 2 - What is pseudocode?Ch. 2 - Computer programs typically perform what three...Ch. 2 - If a math expression adds a float to an int, what...Ch. 2 - What is the difference between floating-point...Ch. 2 - What is a magic number? Why are magic numbers...Ch. 2 - Assume a program uses the named constant PI to...Ch. 2 - Write Python code that prompts the user to enter...Ch. 2 - Write Python code that prompts the user to enter...Ch. 2 - Write assignment statements that perform the...Ch. 2 - Assume the variables result, w, x, y, and z are...Ch. 2 - Write a Python statement that assigns the sum of...Ch. 2 - Write a Python statement that subtracts the...Ch. 2 - Write a Python statement that multiplies the...Ch. 2 - Prob. 8AWCh. 2 - What would the following display? num = 99 num = 5...Ch. 2 - Assume the variable sales references a float...Ch. 2 - Assume the following statement has been executed:...Ch. 2 - What will the following statement display?...Ch. 2 - Write a turtle graphics statement that draws a...Ch. 2 - Write the turtle graphics statements to draw a...Ch. 2 - Write the turtle graphics statements to draw a...Ch. 2 - Personal Information Write a program that displays...Ch. 2 - Sales Prediction A company has determined that its...Ch. 2 - Land Calculation One acre of land is equivalent to...Ch. 2 - Total Purchase A customer in a store is purchasing...Ch. 2 - Distance Traveled Assuming there are no accidents...Ch. 2 - Sales Tax Write a program that will ask the user...Ch. 2 - Miles-per-Gallon A car's miles-per-gallon (MPG)...Ch. 2 - Tip, Tax, and Total Write a program that...Ch. 2 - Celsius to Fahrenheit Temperature Converter Write...Ch. 2 - Ingredient Adjuster A cookie recipe calls for the...Ch. 2 - Male and Female Percentages Write a program that...Ch. 2 - Stock Transaction Program Last month, Joe...Ch. 2 - Planting Grapevines A vineyard owner is planting...Ch. 2 - Compound Interest When a bank account pays...Ch. 2 - Turtle Graphics Drawings Use the turtle graphics...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Describe the common components needed to create a Web-based application.
Modern Database Management
3.12 (Date Create a class called Date that includes three pieces Of information as data
members—a month (type ...
C++ How to Program (10th Edition)
Write a line of Java code that will give the name ANSWER to the int value 42. In other words, make answer a nam...
Absolute Java (6th Edition)
Look at the following class declarations and answer the questions that follow them: public class Shape { privat...
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Identify and briefly describe four types of requirements that may be defined for a computer- based system.
Software Engineering (10th Edition)
Speedcoding was invented to overcome two significant shortcomings of the computer hardware of the early 1950s. ...
Concepts Of Programming Languages
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
- Draw a flow chart. Choose one of the following. Write how to open that account.arrow_forwardCorrect the code segment below to improve its efficiency. if ((Balance >= 1000) && (Balance <= 3000)) { cout << "Your balance is between $1000 and $3000"; cout << "Your interested rate will be 3.5%"; } else { cout << "Your balance is larger than $3000."; cout << "Your interest rate will be 4.5%"; }arrow_forwardWrite a python code: Example2:Input:2018000assistant managerFunction Call:calculate_tax(20, 18000, 'assistant manager')Output:900.0 =================================== Example3:Input:2022000assistant managerFunction Call:calculate_tax(20, 22000, 'Assistant manager')Output:2200.0 =================================== Example4:Input:20122000presidentFunction Call:calculate_tax(20, 122000, 'president')Output:0arrow_forward
- print("Welcome To Use Python Service.")respond = input("Are you want to deal with a transaction ?(Y/N):").upper()while respond == "Y": holidaybonus = 0.03 extrabonus = 0.05 _pension = 0.04 print("Please fill in your personal information.") name = input("Username :") payment = eval(input("Monthly payment :")) public_holiday = input("Worked on public holiday(Y/N) :").upper() hours = eval(input("Total hours worked in a mouth :")) pension = input("Made payment of pension(Y/N) :").upper() if public_holiday == "Y": total_1 = (payment * holidaybonus) else: total_1 = 0 if hours >= 160: total_2 = (payment * extrabonus) else: total_2 = 0 if pension == "Y": total_3 = (payment * _pension) else: total_3 = 0 net_pay = payment + total_1 + total_2 - total_3 total_addition = payment + total_1 + total_2 total_deduction = total_3 print("-" * 60) print("PAYSLIP") print("Employer's name :…arrow_forwardin computer programming If x = 4, y = 6 and z = 2, then x == 4 is... true or false?arrow_forwardWrite a C++ program that asks the user to enter three degrees, then calculate and print their summation and average, if average >= 50 print success, otherwise print failure.arrow_forward
- Write a programming statement that declares a constant field for a 5.9 percent interest rate.arrow_forwardPython programming language Calculate the standard deduction. For this problem we are going to assume only two marital status positions. If you are single you get a $12,200 standard deduction. If you filed married you get a $24,400 standard deduction.arrow_forwardThe programming language is C++, write a program base on the given statement. Write a program that accepts an input grade in percentile formand output its grade equivalent based on the given range of percentileand grade equivalent table below: RANGE GRADE98-100 1.0095-97 1.2592-94 1.5089-91 1.75 85-88 2.0082-84 2.2580-81 2.5077-79 2.7575-76 3.00Below 75 OUT OF RANGEarrow_forward
- (d) Write a formula in cell I24 to compute the discount amount on the server. Discount Amount = Percent Discount * Rate per hour. Copy the formula to I25 to I41. (e) Write a formula in cell J24 to compute the rate per hour after the discount. Rate per hour after discount = Rate per hour - Discount Amount. Copy the formula from J25 to J41.arrow_forwardAmazon has three types of users: Admin, Registered, and Guest. All have different access to the website. An Admin user can edit the items, a registered user can purchase the item and a guest user can only view the items. Write a C ++ program to demonstrate this scenario.arrow_forwardPython interprets any non-zero value in the condition construct as True. a.True b.Falsearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
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
Control Structure in Data Structure - Data Structures - Computer Science Class 12; Author: Ekeeda;https://www.youtube.com/watch?v=9FTw2pXLhv4;License: Standard YouTube License, CC-BY