How JustAnswer Works:

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

Ask R.R. Jha Your Own Question

R.R. Jha
R.R. Jha, Tutor
Category: Homework
Satisfied Customers: 5420
Experience:  B.Tech
Type Your Homework Question Here...
R.R. Jha is online now
A new question is answered every 9 seconds

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

Resolved Question:

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 =====================================================

Submitted: 1 year ago.
Category: Homework
Expert:  R.R. Jha replied 1 year ago.
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
Customer: replied 1 year ago.

I don't have any codes :(


 


The following is the original question document.


 


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


 

Expert:  R.R. Jha replied 1 year ago.
Received it. What's the deadline?
Customer: replied 1 year ago.

Sir,


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

Expert:  R.R. Jha replied 1 year ago.
I can have it ready by tomorrow.
Customer: replied 1 year ago.

The homework is due tomorrow. Thank you so much.

Expert:  R.R. Jha replied 1 year ago.
you're welcome
Customer: replied 1 year ago.

How are you coming, sir?


 

Expert:  R.R. Jha replied 1 year ago.
Working through, would post it by sometime tonight.
Customer: replied 1 year ago.

Hello???

Expert:  R.R. Jha replied 1 year ago.
Hi,

Have completed most of it. I'll finish the rest and post your answer in about an hour.
Expert:  R.R. Jha replied 1 year ago.
THIS ANSWER IS LOCKED!
You can view this answer by clicking here to Register or Login and paying $3.
If you've already paid for this answer, simply Login.
R.R. Jha, Tutor
Category: Homework
Satisfied Customers: 5420
Experience: B.Tech
R.R. Jha and 5 other Homework Specialists are ready to help you

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
< Last | Next >
  • 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!!!! Alex Los 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. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, 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. Esther Woodstock, 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. Robin Elkton, 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. Diane Dallas, TX
 
 
 

Meet The Experts:

 
 
 
  • Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4520
    More than 5000 online tutoring sessions.
< Last | Next >
  • http://ww2.justanswer.com/uploads/BU/BusinessTutor/2012-2-2_115741_Kouki2.64x64.jpg Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4520
    More than 5000 online tutoring sessions.
  • http://ww2.justanswer.com/uploads/LI/lindaus/2012-6-10_04811_IMG20120609164157.64x64.jpg Linda_us's Avatar

    Linda_us

    Finance, Accounts & Homework Tutor

    Satisfied Customers:

    3121
    Post Graduate Diploma in Management (MBA)
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Engineer

    Satisfied Customers:

    3035
    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • http://ww2.justanswer.com/uploads/lanis/2009-4-1_233717_phput9xef_c1pm.jpg Lani S.'s Avatar

    Lani S.

    Tutor

    Satisfied Customers:

    2457
    Registered Nurse, Internet Researcher, Private Tutor
  • http://ww2.justanswer.com/uploads/chooser77/2009-08-18_162025_Chris.jpg Chris M.'s Avatar

    Chris M.

    M.S.W. Social Work

    Satisfied Customers:

    2341
    Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
  • http://ww2.justanswer.com/uploads/JawaadAhmed/2009-6-27_12137_SIs_SHadi.jpg F. Naz's Avatar

    F. Naz

    Chartered Accountant

    Satisfied Customers:

    1975
    Experience with chartered accountancy
  • http://ww2.justanswer.com/uploads/JK/jkcpa/2011-1-16_182614_jkcpa.64x64.jpg Bizhelp's Avatar

    Bizhelp

    CPA

    Satisfied Customers:

    1873
    Bachelors Degree and CPA with Accounting work experience