7) Solving quadratic equation program Let's consider the general formula of a quadratic equation : ax? + bx +c = 0 Example in the equation : x? + 3x + 8 = 0 a=1, b=3 and c=8 where a, b and c are real numbers and a # 0 To solve the equation a discriminant D is calculated as: D = b2-4ac If D is less that 0: there is no solution If D is equal to 0: there is one solution b 2a If D is greater that 0: there is two solutions x1 and x2 -b + VD x1. 2a -b-VD x2 = 2a
Q: (Electrical eng.) The electrical resistance, r, of a metal wire, in ohms, is given by this formula:…
A: a. The resistance of the wire needs to be calculated. Hence, there will be only one output i.e., the…
Q: PROBLEM 2: Using user defined function and appropriate conditional and looping statements, create a…
A: The program is written in C++. Please find the source code in the below steps.
Q: Activity 20 Electric Bill: Using C Language and Using Switch Statement, Make a program that will…
A: Please find the code and output below:
Q: Complete the function yum to return the area of a pizza with a diameter of d inches. Assume the…
A: Step 1:- Note:-I am writing the program in c++ programming language because no programming language…
Q: Problem 2: This program will compute the volume of a cylinder. Write a function, area, that will…
A: As programming language is not mentioned we are providing answer in C++ language.…
Q: Problem #1: Car experts recommend changing your air filter as often as every 6000 miles if the oil's…
A: Declare two variables, char which stores category A or B and int which store miles in number.…
Q: C Program / CLanguage Make a C program. The date is january 1, 2019. Cody has a lot of neighbors who…
A: We have to follow this alogithm Declare two variables currentYear and birthYear Then ask the user…
Q: C++ program to find roots of a Quadratic Equation For a quadratic equation ax2+bx+c = 0 (where a, b…
A: Answer: Here is the code: #include <iostream>#include <cmath>using namespace std; int…
Q: 3- Enter a=3; b=5; e=7, then clear the variable b only Matlab
A: Step 1 : Start Step 2 : Take user input for the variable a , b and c using the input() function.…
Q: The function in the code snippet above is incomplete, and at least 4 more statements are required to…
A: The question is asking us to complete a linear search algorithm. So the completed code is mentioned…
Q: Problem Statement The area under a curve can be estimated by breaking the x axis into increments,…
A: Following is the Matlab code to find the area of the above function: clc; close all; %Taking all…
Q: ogramming problem Consider data points (xị, Y;), i = 0,..., n. We would like to interpolate them…
A: Newton's interpolation method.
Q: Rolling Two Dice (in c language) Write a program that simulates the rolling of two dice. The program…
A: A required program is as follows, #include<stdio.h> #include<time.h>…
Q: c++ program or code of Juan works on a field and for his work he receives 1/3 of the crop. If his…
A: #include<iostream>using namespace std; int main(){ float share_of_juan = 245; float part…
Q: In a triangle, the sum of the 1st and 2nd side must always be greater than the 3rd side. Create a…
A: Algorithm: for (initialExpression; testExpression; updateExpression){ // body of the…
Q: Based on the image attached, shows a statement of a program are in the incorrect order. Rearrange…
A: The Answer is
Q: Direction: Provide solution for Problem Solving Phase: d) Flowehart e.) Source Code in Ć Machine…
A: Algorithm: Take the distance, efficiency, and price of gas from user. Calculate the cost of commute…
Q: type python program with indentation for: Write a program to calculate the balance and minimum…
A: Actually, program is a executable software that runs on a computer.
Q: 1- Write C++ program (a Main function) that prints out whether a thrill-seeking person standing in…
A: Program Explanation:- Using the header file. Using the standard namespace input/output function.…
Q: Branching Statements on Solving Function My Solu Write a MATLAB program to evaluate the function…
A: According to the information given:- We have to follow the instruction mentioned.
Q: Assignment #1 Compute the net take-home pay of the employee in AXB Company. The program accepts name…
A: The program is written in c
Q: This exercise is to develop programming skills in comparative operations using the conditional…
A: Short Summary : Implemented the program as per requirementAttached source code and sample output
Q: Hypotenuse) Define a function hypotenuse that calculates the length of the hypotenuse of a right…
A: We can easily solve the problem . As the programming language is not mentioned in the question as…
Q: Complete the following program. An object floats in any fluid, if the density of the object is lower…
A: The program illustrates calculating density and printing the message based on the given constraint.…
Q: Problem #1: Car experts recommend changing your air filter as often as every 6000 miles if the oil's…
A: Actually, Java is a programming language originally developed by James Gosling at Sun Microsystems…
Q: Q3) (Temperature Conversions) Implement the following integer functions: a) Function celsius returns…
A: Programming is a way to instruct the computer devices to operate. Every computer needs a set of…
Q: C PROGRAM ONLY) 3. Outsmarting the Guard by CodeChum Admin Great! Thanks to your…
A: #include <stdio.h> int factorial(int n); int main(void) { int n; printf("Enter n: ");…
Q: MACHINE PROBLEM 2 Numerical Methods WRITE A COMPUTER PROGRAM USING ANY LANGUAGE OF YOUR CHOICE THAT…
A: Program: #include<iostream> #include<iomanip> #include<vector>…
Q: L- Example 1: Write a program that solves a quadratic equation using Quadratic equation (-b± Vb² –…
A: NOTE:“Since you have asked multiple questions, we will solve the first question for you. If you want…
Q: Q1- Example 1: Write a program that solves a quadratic equation using Quadratic equation (-b± vb² –…
A: Step 1:- Program Approach:- 1.Include header file 2.Declare variables 3.Take the input from the…
Q: (Temperature Conversions) Implement the following integer functions:a) Function toCelsius returns…
A: Since no programming language is mentioned, I am using c++. As per the given question, we need to…
Q: Problem #1: [35 pts] Profit calculation for an Avocado farm Write a program that helps a farmer…
A: .
Q: Provide your own short C++ code example that uses math operators of your choice. Try to use at least…
A: 100 + 10 is 110 as you can see in the output. We achieved this result of addition using the +…
Q: e of cube using constructor an
A: Code: #include<iostream>using namespace std; class cube{ public: double side; double…
Q: Modified coin-row problem: If we modified the coin-row problem, so that you cannot take the adjacent…
A:
Q: (c) Assuming function prototype is declared, identify and correct the errors for the following…
A: Here we are given a function definition. The function takes 2 integer parameters as input and…
Q: Q2) The following graph shows the x and y coordination of different cities. Write a C Program that…
A: Declare six integer variables to hold the x and y coordinates of the three points. Initialize the…
Q: ach occupied unit requires an average of $27 per month for maintenance. How many units should be…
A: The program of output in the number of units is given as,
Q: 4. A newly opened college ground is rectangular in shape and the Management decides to build a fence…
A: Algorithm: Step 1: Start Step 2: declare variables l and b Step 3: read l(length), b(width) Step 4:…
Q: 10. Salary/Income Calculator Write a C program that computes an employee's monthly salary and…
A: C is a versatile middle-level programming language that can be used for a variety of tasks. It can…
Q: Exercise 1: A large chemical company pays its sales staff on a commission basis. They receive 200…
A: //Importing library#include <stdio.h>//Importing library#include <stdbool.h>//Main of…
Q: NB: USE IF ELSE STATEMENTS FOR THIS CODING IN C++ • Calculate each student's grade - 10 students in…
A: Using object oriented approach. We have used if to determine whether the marks entered by user are…
Q: I need help with my program. When I run the program I input the yearly income and it skips to "Enter…
A: The program is correct there is only one problem data type. Data type means int, double, string,…
Q: In C++ A carpet company has determined that every 50 square feet of floor coverage will require 6…
A: #include<iostream>using namespace std; bool inputValidate(double);void getInfo(double&,…
Q: 4. A newly opened college ground is rectangular in shape and the Management decides to build a fence…
A: Algorithm: Step 1: Start Step 2: declare variables l and b Step 3: read l(length), b(width) Step 4:…
Q: Perform any two arithmetic operations on 'n' polynomials using the following options Structures in C…
A: Perform any two arithmetic operations on 'n' polynomials using the following options Structures in C…
Q: 4. A newly opened college ground is rectangular in shape and the Management decides to build a fence…
A: Algorithm: Step 1: Start Step 2: declare variables l and b Step 3: read l(length), b(width) Step 4:…
Q: Question 1 : (Solve quadratic equations) The two roots of a quadratic equation ax² + bx + c = 0 can…
A: Algortihm: 1.import java.util.Scanner 2.create a class called main 3.create a main method 4.check…
Step by step
Solved in 4 steps with 3 images
- a. Discuss Integer Programming b. Discuss the Application in situations where decision variables must be integers.I need help problem: A two dimensional random walk simulates the behavior of a particle moving in a grid of points. At each step, the random walker moves north, South, east, or West with probability 1/4, independent of previous moves. Compose a program that takes a command line argument n and estimates how long it will take a random walker to hit the boundary of a 2n-by-2n square centered at the starting point.Solve the problems Solve the quadratic equation 2x^2 + 6x + 4 = 0. Implement a function that takes incoefficients A,B,and C forthequadratic equation Ax2 + Bx + C = 0 and computes the two solutions. Have the function return the number of valid (not NaN) solutions and fill in the return arguments so the smaller of the two solutions is first.
- (Electrical eng.) You’ve been asked to write a C++ program to calculate the total resistance of a series circuit. In this circuit, the total resistance is the sum of all individual resistance values. The circuit consists of a number of 56-ohm, 33-ohm, and 15-ohm resistors. a. For this programming problem, how many outputs are required? b. How many inputs does this problem have? c. Determine a formula for converting input items into output items. The number of 56-ohm resistors is m, the number of 33-ohm resistors is n, and the number of 15-ohm resistors is p. d. Test the formula written for Exercise 1c using the following sample data: m=17,n=24,andp=12.Write a C++ / CLI program to resolve the following indefinite equation problem:Please draw the Olympic Rings. You can output many stars (*) to form a rings, but the parameter of the rings should be adjustable.1. Using object-oriented approach.2. Test your codes in the main function.3. Write a technical report to explain your code.Suppose that you want to solve the following quadratic formula in Julia: x = −b ± √(b2 − 4ac) / 2a Where: a = the coefficient in front of or the number beside x2 b = the coefficient in front of or the number beside x c = the constant Write a Julia functional program to generate the solutions for a quadratic solution like this one: Where:a = 2, b = -1, c = -1and solutions for this equation will be 1 and – 1⁄2.
- Consider the following programming problem: The values of three integer variables—first, second, and third—must be placed in the three variables max, mid, and min, with the obvious meanings, without using arrays or user-defined or predefined subprograms. Write two solutions to this problem, one that uses nested selections and one that does not. Compare the complexity and expected reliability of the two.Design by C++ Using subroutines (VOID) write a program to perform numerical integration of f(x)=x^2*sin(x)*exp(x^2) over x=[0,Pi] having a choice of (i) rectangular rule (ii) the 1/3 Simpson’s rule Divide the domain into N subsections, where N=5,10,20,40. Compare your results.I need Help again understanding C++ programming with a problem: Assume an equation is in the form: ax + b = c. Prompt for and get the user’s values for a, b, and c (allintegers), then solve for x. So, if the user entered 6 for a, 9 for b, and 2 for c, output should be in thisform:Your equation : 6x + 9 = 2Has solution x = -1.16667NOTE: 1. Assume that a will NOT be 0.2. Variable names of a, b, and c are actually descriptive in the context of this program
- Problem 6: Induction and Recursion Consider a postal system for which the minimum postage required for any service (e.g. mailing a postcard) is 18 cents. [a] Prove by strong induction that any postage ≥ 18 can be formed using only 4-cent and 7-cent stamps. (Hint: consider bases cases for 18 thru 21.) [b] Write a Java/Python-like pseudocode for a function that determines the number of each denomination of stamp for a postage amount ≥ 18. (It need not be concerned with lesser cases as they are never used).Draw Flowchart of this program // C# program for implementation // of Lagrange's Interpolation using System; class GFG { // To represent a data point // corresponding to x and y = f(x) class Data { public int x, y; public Data(int x, int y) { this.x = x; this.y = y; } }; // function to interpolate the given // data points using Lagrange's formula // xi corresponds to the new data point // whose value is to be obtained n // represents the number of known data points static double interpolate(Data []f, int xi, int n) { double result = 0; // Initialize result for (int i = 0; i < n; i++) { // Compute individual terms // of above formula double term = f[i].y; for (int j = 0; j < n; j++) { if (j != i) term = term * (xi - f[j].x) / (f[i].x - f[j].x); } // Add current term to result result += term; } return result; } // Driver code public static void Main(String[] args) { // creating an array of 4 known data points Data []f = {new Data(0, 2), new Data(1, 3), new Data(2, 12), new Data(5,…Construct C++ program to solve a given problem using appropriate programming techniques. Write a program that will calculate and print bills for the city power company. The rates vary depending on whether the use us residential, commercial, or industrial. A code of R means residential use, a code of C means commercial use, and a code of I means industrial use. Any other code should be treated as an error. The rates are computed as follows: R: $6.00 plus $0.052 per kwh used. C: $60.00 for the first 1000 kwh and $0.045 for each additional kwh. I: Rate varies depending on time of usage Peak hours: $76.00 for first 1000kwh and %0.065 for each additional kwh. Off-peak hours: $40.00 for first 1000 kwh and $0.028 for each additional kwh. Your program should prompt the user to enter an integer account number, the use code (type char), and the necessary consumption figures in whole numbers of kilowatt-hours. Your program should display the amount due from the user.