
Need help with number 3, thanks!
function [root1, root2]=myquad(a, b, c)
if a!=0
D=b^2-4*a*c;
if D<0
fprintf('\nThe equation has no real roots.\n\n') ;
end
elseif D==O
root1=b/(2*a);
root2=b/(2*a);
fprintf('\nThe equation has one root,\n');
fprintf(' %.3f\n\n',root1);
end;
else
root1=(-b+sqrt(D))/(2*a);
root2=(-b-sqrt(D))/(2*a);
fprintf('\nThe equation has two roots,\n') ;
fprintf(' %.3f and %.3f\n\n',root1,root2);
end
end
else
fprintf('\nThe equation is not a quadratic equation,\n');
end
end
Need help with number 3, thanks! isplays l itnuml is less than num2. 2. (50+30- 80...
write a C programming code for the following prompt. please
use stucture concept and test if the code works perfectly.
Project Description: In this project, you will write a program to calculate the roots of a quadratic equation. Structure concepts will be used in this project. Your program will prompt the user to enter the coefficients of a quadra coefficientsType. Then it will compute the roots of the quadratic equation and store the result in a structure variable of type...
A quadratic equation is generally represented as, ax^2 + bx + c The root(s) of the above quadratic equation is computed using the following formula, root1 = (-b + sqrt(D))/ 2a root2 = (-b - sqrt(D))/2a Where D is the discriminant of the quadratic equation and is computed as, D = b^2 - 4ac Given the value of D, the roots of a quadratic equation can be categorized as follows, D > 0 : Two distinct real roots D =...
In this homework, you will create a class that stores a list of transactions and computes the average transaction for a given month. The user must input the name of the month and the transactions into the terminal. The Transaction_List Class First you will create two C++ files called abc1234_Transaction_List.h and abc1234_Transaction_List.cpp. Below is a UML class diagram that shows the basic design of the Transaction_List class. Transaction List -month : string transactions: vector-sdouble - num transactions: int +Transaction Listim...
Rule book: 1.)Must be Python - 2.) no imported module (ie cmath) - no can do on the imports... pure code.. 3.) numbers are float - not integer. Here's the prompt: (Algebra: solve quadratic equations) The two roots of a quadratic equation ax^2 + bx + c = 0 can be obtained using the following formula: r1 = (-b + sqrt(b^2 - 4ac)) / (2a) and r2 = (-b - sqrt(b^2 - 4ac)) / (2a) b^2 - 4ac is called...
2. The roots of the quadratic $a x^2 + b x + c$ are given by $$\frac{-b \pm \sqrt{b^2-4ac}}{2a}$$ If $b^2-4ac <0$, the quadratic has no real roots. Write a function to calculate the real roots of a quadratic. The function should have 3 arguments, *a*, *b* and *c*. If $b^2-4ac <0$, the function should print "quadratic has no real roots", and then return(NULL). Otherwise, the function should return a vector of length 2, those being the real roots (which...
Hello I need help with this program. Should programmed in C!
Program 2: Sorting with Pointers Sometimes we're given an array of data that we need to be able to view in sorted order while leaving the original order unchanged. In such cases we could sort the data set, but then we would lose the information contained in the original order. We need a better solution. One solution might be to create a duplicate of the data set, perhaps make...
C++ requirements The store number must be of type unsigned int. The sales value must be of of type long long int. Your program must properly check for end of file. See the section Reading in files below and also see your Gaddis text book for details on reading in file and checking for end of file. Your program must properly open and close all files. Failure to follow the C++ requirements could reduce the points received from passing the...
I need help creating program for the Test_Bisection pseudocode.
I need to find a root for each function f and g and get the output
below.
Pseudocode Now let's construct pseudocode to carry out this procedure. We shall not try to create a piece of high-quality software with many "bells and whistles,” but we write the pseudocode in the form of a procedure for general use. This allows the reader an opportunity to review how a main program and one...
Python GPA calculator: Assume the user has a bunch of courses they took, and need to calculate the overall GPA. We will need to get the grade and number of units for each course. It is not ideal to ask how many courses they took, as they have to manually count their courses. Programming is about automation and not manual work. We will create a textual menu that shows 3 choices. 1. Input class grade and number of units. 2....
For Python-3 I need help with First creating a text file named "items.txt" that has the following data in this order: Potatoes Tomatoes Carrots. Write a python program that 1. Puts this as the first line... import os 2. Creates an empty list 3. Defines main() function that performs the tasks listed below when called. 4. Put these two lines at the top of the main function... if os.path.exists("costlist.txt"): os.remove("costlist.txt") Note: This removes the "costlist.txt" file, if it exists. 5....