Homework

Homework Questions? Ask a Tutor for Answers ASAP

Ask an Expert,
Get an Answer ASAP!

Homework
This answer was rated:

Help my homework please!!!Im using Python 2.7.3Write

Help my homework please!!! I'm...

Help my homework please!!! I'm using Python 2.7.3 Write a program to solve Ax^2 + Bx + C = 0 where A, B, and C can be any real number and x can be complex (x = a + bi). Note: A, B, and/or C can be zero so you must consider ALL possibilities for the coefficients. General Instructions: In all that follows replace 999 with your assigned classid and $ represents the Unix command prompt. create a directory named mp1id999 and cd into it and create four files: main.py, quadroots.py, abc.txt (to test your program), and README. Your program will consist of two modules (i.e. two .py files). - The module main.py will contain the main() function for your program and possibly a few helper functions if needed. - The module quadroots.py will contain the functions roots1(), roots2(), ... , roots6() and possibly a few helper functions if needed. The function main() will contain four variables named a,b,c and d for the 3 three coefficients and the discriminant. You must open two files: abc.txt for reading only and output.txt for writing only. Each row of abc.txt will contain 3 real numbers for the coefficients a, b and c. The files should be closed with close() before terminating the program. In reading abc.txt, assume that each number in the file can begin/end with any kind of whitespace like tabs, spaces and newline characters. In addition assume that there might be lines of white space at the end of the file. You should test for these so they do not crash your program. Input and process each set of coefficients in the file. -There are six different cases that that need to be considered. Three for a equal to zero and three for a not zero. Use an if-elif structure to determine the case and call one of 6 functions named roots1(), roots2(), ... , roots6() with no return value. - The variables a, b, c, d should be passed to each of the functions along with the output file stream that you opened. - The functions, roots1(), through roots6(), should be called to calculate the roots and print the results to the file named roots999.txt. The output should be similar to the sample output below. - In addition, include a heading at the top of the output file. The 1 of 4heading should be very simple with a border around it. Use a function call to print your heading. It should have the following form: Your Name UID MCS260, Spring 2013 mp1id999 Your program should never take the square root of a negative number or divide by zero. Otherwise, points will be deducted from your program score even if the program works. Some computers will crash if you do (Windows 98). When possible, you should always write your programs so they work on other computers. README will contain very simple instructions and information that would be useful to someone using your program. However, your README file will not change the way your program is tested. All programs will be run and tested the same way. In the if-elif structure the last else should result in printing an error message. ( i.e. "ERROR: Never get here!" message ). This is considered good programming. Your source code must be formatted using a style similar to that in the textbook or class examples and the first few lines of the file must begin with a comment giving the complete file name, information about you and what is in the file. Include a doc-string for each module and each function definition. For example >>> import quadroots followed by >>> help(quadroots) should provide useful information about the module and each of the functions in it. Make sure you test your code for all possible types of input values. You can check your answers using a calculator or a program like Maple, Matlab (available in pc-labs) or Octave (on raphael or icarus). Sample input: from file abc.txt (Yours will most likely be different than this) 0 0 0 0 0 1 0 2 4 1 2 1 1 5 6 1.1 2.2 3.3 -3.14159 2.71828 1.414 --------Sample output in file named roots999.txt:------------- ===================== ==Your very nice heading here. == ===================== 0.0*x^2 + 0.0*x + 0.0 = 0 has as an infinity of roots: all complex numbers are roots ===================================================== 0.0*x^2 + 0.0*x + 1.0 = 0 has no roots ===================================================== 0.0*x^2 + 2.0*x + 4.0 = 0 has one root: x = -2.0 ===================================================== 1.0*x^2 + 2.0*x + 1.0 = 0, d = 0.0000 has a double root: x = -1.0 ===================================================== 1.0*x^2 + 5.0*x + 6.0 = 0, d = 1.0000 has two real roots: x1 = -2.0 x2 = -3.0 ===================================================== 1.1*x^2 + 2.2*x + 3.3 = 0, d = -9.6800 has two complex roots: x1 = -1.0 + i*1.4142 x2 = -1.0 - i*1.4142 ===================================================== -3.1416*x^2 + 2.7183*x + 1.4140 = 0, d = 25.1579 has two real roots: x1 = -0.3657 x2 = 1.2309 =====================================================

Show More
Show Less
Ask Your Own Homework Question
Answered in 28 minutes by:
3/4/2013
R.R. Jha
R.R. Jha, Tutor
Category: Homework
Satisfied Customers: 5,471
Experience: B.Tech
Verified
Hi,
Welcome!

I'd be glad to help. Please upload on wikisend.com your original question document and the codes you've so far.

Thanks
Ask Your Own Homework Question
Customer reply replied 4 years ago

I don't have any codes :(


 


The following is the original question document.


 


http://wikisend.com/download/365470/project1.pdf


 

Received it. What's the deadline?
Ask Your Own Homework Question
Customer reply replied 4 years ago

Sir,


How long do you think it will take to get the homework done?

I can have it ready by tomorrow.
Ask Your Own Homework Question
Customer reply replied 4 years ago

The homework is due tomorrow. Thank you so much.

you're welcome
Ask Your Own Homework Question
Customer reply replied 4 years ago

How are you coming, sir?


 

Working through, would post it by sometime tonight.
Ask Your Own Homework Question
Customer reply replied 4 years ago

Hello???

Hi,

Have completed most of it. I'll finish the rest and post your answer in about an hour.
Ask Your Own Homework Question
This answer is protected
Would you like to ask this question?
If you've already paid for this answer, simply Login.
R.R. Jha
R.R. Jha, Tutor
Category: Homework
Satisfied Customers: 5,471
Experience: B.Tech
Verified
R.R. Jha and 87 other Homework Specialists are ready to help you
Ask your own question now
Ask R.R. Jha Your Own Question
R.R. Jha
R.R. Jha
R.R. Jha, Tutor
Category: Homework
Satisfied Customers: 5,471
5,471 Satisfied Customers
Experience: B.Tech

R.R. Jha is online now

A new question is answered every 9 seconds

How JustAnswer works:

  • Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction GuaranteeRate the answer you receive.

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here.

DianeDallas, TX

< Previous | Next >

Meet the Experts:

LogicPro

LogicPro

Engineer

5,731 satisfied customers

Expert in Java C++ C C# VB Javascript Design SQL HTML

Manal Elkhoshkhany

Manal Elkhoshkhany

Tutor

4,551 satisfied customers

More than 5000 online tutoring sessions.

Linda_us

Linda_us

Finance, Accounts & Homework Tutor

3,138 satisfied customers

Post Graduate Diploma in Management (MBA)

Chris M.

Chris M.

M.S.W. Social Work

2,636 satisfied customers

Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)

F. Naz

F. Naz

Chartered Accountant

2,161 satisfied customers

Experience with chartered accountancy

Bizhelp

Bizhelp

CPA

1,887 satisfied customers

Bachelors Degree and CPA with Accounting work experience

Seanna

Seanna

Tutor

1,781 satisfied customers

3,000+ satisfied customers, all topics, A+ work

< Previous | Next >

Related Homework Questions
Just wanted to see if you would be interested in helping me
Hello Again! Just wanted to see if you would be interested in helping me with two more programs? I will attach the Program outlines and the Word documents. Please let me know if you would like to help… read more
George Sibiya
George Sibiya
PhD
217 satisfied customers
6. How many worksheets display in the Excel window when you
6. How many worksheets display in the Excel window when you create a new blank workbook? A. 3 B. 2 C. 4 D. 1 Student Answer: A Answer: Incorrect Reference: Objective 2.17. What would be a situation in… read more
AnswersByEric
AnswersByEric
Software Developer
Associate Degree
37 satisfied customers
Question 18 of 20: Select the best answer for the question.
Question 18 of 20 : Select the best answer for the question. 18. What size paper should you use for a legal document? A. 3″ × 5″ B. 8½″ × 11″ C. 7¼″ × 10½″ D. 8½″ × 14″… read more
JA Engineer
JA Engineer
Broadcast Engineer
Diploma (Honors)
163 satisfied customers
I need help with Exam Number: 00701400 Lesson Name: General
I need help with Exam Number: 00701400Lesson Name: General Math I, Study Unit 2 Pennfoster test… read more
GLENN
GLENN
Master of Mathematics
343 satisfied customers
Answer all three questions and don't exceed 600 words for
Answer all three questions and don't exceed 600 words for each answer while using at least two references to support your answers for each question adopting APA citation in the text and in the referen… read more
F. Naz
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,161 satisfied customers
QUESTION 1 A(n) _________________ policy are codified as
QUESTION 1A(n) _________________ policy are codified as standards and procedures that are used when configuring or maintaining systems.0.10000 points Save AnswerQUESTION 2In systems analysis and desig… read more
F. Naz
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,161 satisfied customers
I need all the questions answered inthis pdf! I need all
I need all the questions answered inthis pdf! I need all sixty questions on all 21 pages answered!… read more
Steven, M.Acc.
Steven, M.Acc.
Instructor
Master\u0027s Degree
252 satisfied customers
Exam Number: 584002RR I need all t he questions answered in
Exam Number: 584002RR I need all t he questions answered in excel in this pdf file now! Asap!… read more
The-PC-Guy
The-PC-Guy
Bachelor\u0027s Degree
629 satisfied customers
How do you differentiate between an expression and an
How do you differentiate between an expression and an equation? Provide an example of each, where the two are either related to or similar to each other. … read more
GLENN
GLENN
Master of Mathematics
343 satisfied customers
Duane will use an open system LAN because he knows the open
Duane will use an open system LAN because he knows the open system will support varieties of hardware and software components made by different vendors. Steve will use a closed system LAN because he k… read more
F. Naz
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,161 satisfied customers
IT 278 Network Administration 1. Server roles and features
IT 278 Network Administration 1. Server roles and features can be added and updated through both a GUI installation and a Server Core installation. In a short essay, explain how to use Windows PowerSh… read more
David L.
David L.
Bachelor\u0027s Degree
6 satisfied customers
For LogicPro only. need help with this debugging to input it
For LogicPro only.need help with this debugging to input it into raptor// A high school is holding a recycling competition // This program allows a user to enter a student's // year in school (1 throu… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
5,731 satisfied customers
I need the answer key to penn american literature, 986174RR
I need the answer key to penn foster american literature, 986174RR 986175RR 986176RR 986177RR 986178RR … read more
GLENN
GLENN
Master of Mathematics
343 satisfied customers
For LogicPro only * Reading data strings from a file *
For LogicPro only* Reading data strings from a file * Convert from int based container to templates or generics based * Accommodate dynamic resizing using this algorithm: 1. Starting with a dynamic si… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
5,731 satisfied customers
Question 1 of 20: Select the best answer for the question.
Question 1 of 20 : Select the best answer for the question. 1. For what type of document would you use the landscape page orientation? A. Three-column brochure B. Business letter C. Legal contract D. … read more
Cher
Cher
JustAnswer Expert & Mentor;Teacher/Tutor
Masters Degree
1,381 satisfied customers
5 - 5 x 5 +5. What is the answer to 5 - 5 x 5 + 5? Only that
no, only that two people using order of operations keeps getting different answers… read more
GLENN
GLENN
Master of Mathematics
343 satisfied customers
Only for F.Naz Tutor. Kindly help with a research report,
Only for F.Naz Tutor.Kindly help with a research report, the links is http://www.mediafire.com/file/bmcea6dt278nw8w/report.txt… read more
F. Naz
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,161 satisfied customers
If I did not look at the description which says 4 cpu cores
if I did not look at the description which says 4 cpu cores and 6 gpu core to make TEN I wonder if you can bundle the two to make an advertisement that says 10 core I also have others in the same fiel… read more
Pete
Pete
Engineer
Bachelor\u0027s Degree
1,124 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x