
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
Please help me write the new code using Phython

Transcribed Image Text:Document1 - Microsoft Word (Product Activation Failed)
References Mailings Review View
Home
Insert
Page Layout
NYAN
A
4 A
KA
5 Date & Time
Cover Blank Page Table Picture Clip Shapes SmartArt Chart Screenshot Hyperlink Bookmark Cross-reference Header Footer Page
W Page Page Break
=
Quick WordArt Drop
Parts
Cap
Text
Box
Art
Number
Object
*
Pages
Tables
Illustrations
Header & Footer
Text
Links
···1·1·2·1·3·1·4·1·5·1·6·1·7·1·8·1·9·|·10·|·11· |· 12 · |· 13 · |·14· |·15· |· ·|·17· |· 18.
▶ · 2 · 1 · 1 · 1
PYTHON PROGRAMMING QUESTION
File Edit Format Run Options Window Help
#balance_table.py
#Print table of account balances earning interest.
def balance (p, r, t):
"""Return new balance using compound annual interest."""
return p* (1 + x) **t
def main ():
print ("Calculates compound interest over time.")
principal float (input ("Principal: "))
rate float (input ("Interest rate (as a decimal): "))
years = int(input ("Number of years: "))
for years in range (years + 1) :
print (year, balance (principal, rate, year))
main ()
Using the example given above,
Write a program to print a table of values of n, logn, n², and 2n for
n = 10, 20,...,200. You do not need any functions other than main().
" .....
03:52 PM
2022-06-21
W
10.1.9.1.8.1,7,1,6,1,5,1,4,1,3,1,2,1,1,1,11日
File
Page: 1 of 1 Words: 8
Signature Line
圓美食 酒 美
BE
ΠΩ
Equation Symbol
Symbols
90%
90%
?
E
0+
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps with 2 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
- exponent = math.exp(-(math.pow(x-mean,2)/(2*math.pow(stdev,2)))) return (1 / (math.sqrt(2*math.pi) * stdev)) * exponent use laplace smoothing to remove the zero division error. Want a code in python The below code won't work as later when I use it create zero division error So laplace smoothing has to be added to the formula def calculateProbability(x, mean, stdev): try: exponent = math.exp(-(math.pow(x - mean, 2) / (2 * math.pow(stdev, 2)))) except ZeroDivisionError: exponent = 0 #or whatever print (stdev,"||",exponent) print (2 * math.pow(stdev, 2)) return (1 / (math.sqrt(2 * math.pi) * stdev)) * exponentarrow_forwardQuestion N Write a Python program to generate a pair of RSA keys (public and private) and demonstrate their usage for encryption and decryption. Hint: Use the cryptography library in Python to generate RSA key pairs and perform encryption/decryption operations Full explain this question and text typing work only We should answer our question within 2 hours takes more time then we will reduce Rating Dont ignore this linearrow_forwardHello. I'm using nested loops in my python code. My code has to be the same as the output provided to us but I'm not sure how to fix the columns or the first row, which should be horizontal, not vertical. I also need to fix the column numbers as they both need to start at 2arrow_forward
- Please use the python programming and no 'range' only while loops.arrow_forwardPlease help me with the listed revisions for the code below. Thank you. from math import pi, sin def m_trapz(f, a, b, n=100): res = (f(a)+f(b))/2 h = (b-a)/n for k in range(1, n): res = res+f(a+h*k) da = (f(a+h)-f(a))/h db = (f(b)-f(b-h))/h return res*h - (db-da)*(h**2)/12 def f(x): return sin(x) a = 0 b = pi/2 exact = 1 print('n\tI\tError') for n in [10, 100, 1000, 10000]: I = m_trapz(f, a, b, n) print('%d\t%.4f\t%.2e' % (n, I, I-exact))arrow_forwardThe perm(n,k=None) function of the python math library (import math) returns the number of ways to choose k items from n items without repetition and with order. Select which are true. (HINT: You expect you to do a little research on this. I do not expect you to know the answer. Consult https://docs.python.org/3/library/math.html#special-functions or help(math.trunc) ). Raises TypeError if either of the arguments are not integers. Raises ValueError if either of the arguments are negative. If k is not specified or is None, then k defaults to n and the function returns n!. Evaluates to n! / (n - k)! when k n.arrow_forward
- please code in python Use a single comprehension to make a list of the square numbers below 100 that give a remainder of 1 when divided by 3.arrow_forwardWhere are 4 lines in this code that need to be fixed and how would I fix them?arrow_forwardcan you write the code using python using ellipse and rect to draw circle and rect? more entry level?arrow_forward
- Write a code in python. Create a Trie Structure with 15 words. Using KMP algorithm to find the first index of the pattern ATCGGATCG in the following string: ATCGGATCATCGGATCGATCGGATCGCGATCGGATCGGGATCGGATCGCATGGGGATCGGATCGarrow_forwardPython Turtle, the clearstamp(face_up_lis) not working for some reason. please helparrow_forwardCode a Python List that displays the name of the months with 31 days only.arrow_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