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
Concept explainers
Question
getting the answer to round up to 2 decimal places
anwer comes out as
- The solutions are -1.1458980337503153 and -7.85410196624968
But it should be The solutions are -1.15 and -7.85
heres the code
import sys
def main():
if len(sys.argv) == 4:
a = float(sys.argv[1])
b = float(sys.argv[2])
c = float(sys.argv[3])
d = (b ** 2) - (4 * a * c)
if d < 0 or a == 0:
print("There are no roots")
else:
root1 = (-b + d ** 0.5) / (2 * a)
root2 = (-b - d ** 0.5) / (2 * a)
print("The solutions are", root1, "and", root2)
else:
print("Please provide 3 numbers as command line arguments")
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
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
- Hello I am really really struggling with this problem because i don't know how to do this problem or how to answer this question can you please help me answering this problem. I added the text below. question that I need help with: 1.48 Let Σ = {0,1} and let D = {w|w contains an equal number of occurrences of the substrings 01 and 10}. Thus 101 ∈ D because 101 contains a single 01 and a single 10, but 1010 6∈ D because 1010 contains two 10s and one 01. Show that D is a regular language.arrow_forwardHello, I have an assignment in the python program. Professor gives me a text like this: January.txt 217283921200.5619.18,29.15,78.75,212.10100,20,410.29 The first line is an account number, the second line is the beginning balance, the third line is withdrawn and the last line is deposits. How can I separate every single line to read them. Can I use the loop function? Below is the assignment direction. Thank you very much ___________________________________________________________ Complete the following program: a) Read in and store the data from the file called “January.txt”. This file includes the customer’s account number, beginning balance, withdrawals, and deposits. (In that order) Note: Make sure you look at the file before you begin the project! b) Prompt the user for his/her name and age. c) Convert the customer’s name to a username that consists of the first letter of the first name, the first 5 digits of last name, and the customer’s age.(All letters should be lowercase)…arrow_forwardin Java This assignment introduces bitwise-manipulation operators (&, |, <<, >>, >>>, ^, and ~),which are not discussed elsewhere in the book. The bitwise-manipulation operators performsimultaneous bit manipulations and enable programs to process large quantities of binaryinformation efficiently. This project is here because the solution uses a conditional operator.The binary & and | operators can implement bitwise “and” and “or” operations oncorresponding bits in a pair of 32-bit int operands. This bit-manipulation capability enablesJava to efficiently process large quantities of raw binary information. We use this capability toencrypt information sent over the Internet and to process graphical images. Suppose you havea 32-bit pattern of 1’s and 0’s in an integer called mask. You can use mask to either set to 1or reset to 0 any subset of the bits in another integer called data:• data |= mask;1 drives to 1 all bits in data that correspond to 1 bits in…arrow_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