Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please show input and output code clearly! Thank you! Program 5- Roots (homework) CSCI 251 The two roots of a quadratic equation ax2 + bx

Please show input and output code clearly! Thank you!

image text in transcribed

image text in transcribed

Program 5- Roots (homework) CSCI 251 The two roots of a quadratic equation ax2 + bx +c can be obtained using the following formula: and r2 2a b2-4ac is called the discriminant of the quadratic equation, and its value determines the mumber of roots as follows: b2-4ac>0, tworeal roots:l and r2 b2-4ac 0, one real root: r b2-4ac 0, no real roots Write a function called roots yourLastName that takes in 3 arguments- coefficient a, coefficient b, and coefficient c, and the return value for the function expects one of three values as shown below: 0: no roots 1: one root 2: two roots b'-4ac
    0 within the function, determine the number of roots and return the corresponding number [O1, or 2). Also write how this function would be called in your main program rootsTest yourLastName.m In the main program, prompt the user for coefficients a, b, and c. Based on the number of roots, determine and output the root values, if there are any (you must use an if-statement for this You need to submit two files for this program, roots yourLastName.m and rootsTest yourLastName.m Include header comments formatted exactly as shown below but with your name, student ID, and section numbre., these comments should be the FIRST LINES in your script). Be sure to include the Honor Code statement. Your electronic submission of the program file will represent your endorsement of the Honor Code Statement. % Course: CSCI 251, Section X % Student Name:ane Doe % Student ID: 12345678 % Program 5 homework % Due Date: % In keeping with the Honor Code of UM, I have neither % given nor received assistance from anyone other than the instructor. Description: Before each significant step, provide a comment explaining the step (do not comment every line of code)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

ISBN: 3319712721, 978-3319712727

More Books

Students also viewed these Databases questions

Question

Concepts of Database Management.Concepts of Database Management

Answered: 1 week ago

Question

What were the issues and solutions proposed by each team?

Answered: 1 week ago

Question

Were all members comfortable brainstorming in front of each other?

Answered: 1 week ago

Question

5. What information would the team members need?

Answered: 1 week ago