python3 quadratic.py 15 19 4 the answer should be The solutions are -0.27 and -1.00 its only showing -0.27 and -1.0 when ran , it should be -0.27 and -1.00 not -1.0 import sys
Q: 2- Use bitwise operators to compute division and multiplication by a number that is power of 2. For…
A: Hey, “Since you have asked multiple questions, we will solve question 2 (specified) for you. If you…
Q: A-1D-9 Given the code segment below, what will be the sum of ALL elements of dCData after running…
A: Please upvote. I am providing you the correct answer below. Please please please.
Q: 22 44 peat the table for the following values of x: 526 b. 847 a. c. 914 d. 752 e. 439 a. Write a…
A: Note : Answering the first question i.e. (a) as per the guidelines. Input : Two odd integer…
Q: Use the programming logic constructs and write a C++ program which will perform the following: (a).…
A: #include <iostream>#include <algorithm>using namespace std;int main(){ string id[10]…
Q: Compute the zero of the function y(x) from the following data x = 0.2, 0.4, 0.6, 0.8, 1.0 y =…
A:
Q: umber g such that 1 + g > 1? What is the relationship between f and g? Write a short C++ or Python…
A: NOTE: ACCORDING TO COMPANY POLICY WE CAN SOLVE ONLY 1 QUESTION. YOU CAN RESUBMIT THE QUESTION AGAIN…
Q: Assume double[][] x = new double[2][5], what are x.length, and x[1].length?
A: Introduction: There is a 2D double type array is given in java and we are asked to answer the…
Q: A code C runs T seconds to obtain results for an input of size S. How to find the order of runtime…
A: Given Data : (a) (S1,T1), (S2,T2)(b) (S1,T1), (S2,T2), (S3, T3)
Q: Write a python program that:
A: def expand(strand): ret = "" i = 0 while i < len(strand): if(isInt(strand[i])): # integer…
Q: Q5 Write C expressions, in terms of variable x, for the following values. Your code should work for…
A: #include<stdio.h> int main(){ int x = 0x87654321; //Bitwise anding x with 0x000000FF…
Q: D. What is printed by the following? printf("%d", *(x+2) + 5); Е. Write a statement to store the…
A: Pointers are variables which store the address of variables of similar data type. Example, int a=5;…
Q: B) Write a PYTHON script to enter a value of S (between 1 and 3) for O entered values of X then find…
A: Input the value of S Then if S is in valid range, input the values into X and perform the operation
Q: Code in C++ only Levy and Samay are playing chess and while discussing on some point they come about…
A: Algorithm: 1. Take the input for Range 2. Iterate to find the pairs and take XOR 3. Print all the…
Q: Write programs in MSP430 language for the following questions: a(15 points} Load least significant 6…
A:
Q: Every cell (x,y) contains an integer ax,y signifying the course of how the ball will move. ax,y=1 —…
A: Here have to determine about Jeopardy of Dropped Balls code for given problem.
Q: getting the answer to round up to 2 decimal places anwer comes out as The solutions are…
A: round() function returns a floating point number that is a rounded version of the given number.…
Q: REVERSE 8 BYTES NUMBER WITH MOV ONLY: We have an 8 bytes width number, so we save the lower bytes in…
A: reverse:bswap eax ; Reverse the bytes of eax. So now eax becomes 15141312hbswap edx ; Reverse the…
Q: Solution required in python only Given a triplet of integers (X , Y , Z), such that X ≤ Y and Y ≥…
A: Required: Given a triplet of integers (X , Y , Z), such that X ≤ Y and Y ≥ Z, we define f(X , Y , Z)…
Q: Write a Python code WITHOUT USING NUMPY to generate a random matrix A of size m x n with m >n and…
A: Code: import randomimport mathm=4n=3A = []for i in range(m): t =[] for j in range(n):…
Q: Problem 1 What is this? what does the following program do? "C language" #include #define…
A: Given Program: #include <stdio.h> #define SIZE 10 int whatIsThis(const int b[], size_t p);…
Q: P(0,x) = 1 9986 The Legendre polynomial P(n,x) ca 0078 4643998 be defined by: P(1,x) = x P(n,x) =…
A: #include<stdio.h>float p(float x, int n){ if(n==0){ return 1; }else if(n==1){…
Q: In c++ Now write a program for a double floating pointtype.•What are the number of significant bits…
A: Solution:-- 1)As the question has required to provide the solution in the C++ language…
Q: Consider that the program uses student ID for interface i.e., input and output purposes but use a…
A: #include <stdio.h>#include <stdint.h>int getStdCode(int stdID){ // move 13 bit to 18…
Q: Below is C code that runs successfully but now i want to rewrite this C code and convert it to MIPS…
A: the answer is an given below :
Q: Problem F. 73154. Trailing zeros Input file: Output file: Time limit: Memory limit: standard input…
A: Let's first understand how to solve problem: Since language is not given so using C++. 1. Take…
Q: I need help in solving the following question using C(NOT C++ OR C*) without using strings or…
A: Here I have taken input from the user and then stored it into different variables. Next, I have used…
Q: Using RAM model of computation, represent the following code in terms of mathematical function of…
A: The given program is - public static void main (String[] args) { int[] ar = {1, 2, 3,…
Q: 4. Examine the -find_root.by_Newton.Raphson_Example.py posted in the stream to write a Python code…
A: For function : ###CODE # Defining Functiondef f(x): return x**3 - 6*x**2+ 11*x -7 # Defining…
Q: 18. (Ref) Suppose r0 = 0XFFFFFFFF, r1 = 0x00000001, and r2 = 0x00000000. Initially the N, Z, V, C…
A: According to the information given:- We have to choose the correct option to satisfy the statement.
Q: Please answer as soon as posibble.
A: The code given below is written in Python programming language.The output of the code is arg1: john,…
Q: This problem is a programming version of Problem 169 from projecteuler.net Define f(0) = 1 and f(n)…
A: GIVEN:
Q: #include gint main () { int a[4]={101,65,97,100}; int *p=&a[0]; printf("\n%c %x", *p,p); p++; (*p)…
A: A pointer is a special variable that can hold the address of another variable. An address in memory…
Q: Consider the block of code below and answer each part accordingly. Assume the input for the values…
A: Here, we have to write answers to the above questions.
Q: program in python the following problem We ask that you assist the ITPC by indicating the maximum…
A: The python code for the above question can be solved in a way as following: We are checking for the…
Q: Instruction: A mathematician named Ulam proposed generating a sequence of numbers from any positive…
A: Even number is found for when it is divided by 2 , and we get remainder 0 2) 8 (4…
Q: 2- Use bitwise operators to compute division and multiplication by a number that is power of 2. For…
A: According to Bartleby guidelines, we can only answer 3 questions in a solution. Please post the rest…
Q: What will the following Python code print: i. a = "Jan&Fed&Mar&Apr&May&Jun"…
A: The Answer is in step-2.
Q: B) Write a PYTHON script to enter a value of S (between 1 and 3) for (50) entered values of X then…
A: Here I consider input of 50 numbers like : 0,1,2,3,4,5..................................upto 49 You…
Q: t the program intends to do ! Program 4 .begin .org 2048 main: ld [a], %r1 ld [b], %r2 ld [c], %r3…
A: To speed up the processor operations, the processor includes some internal memory storage locations,…
Q: 5. Given the following table. Write a C program to implement Mono-alphabetic ciphe for encrypting…
A: #include<bits/stdc++.h>using namespace std;int main(){ string…
Q: python3 quadratic.py 15 19 4 the answer should be The solutions are -0.27 and -1.00 its only…
A: For the given python code, you can find the roots of a quadratic equation. But here for values 15,19…
Q: Write it's python3 code and CPP code for the problem as stated below : Sort an array of 0s, 1s and…
A: void sort012(int a[], int arr_size){ int lo = 0; int hi = arr_size - 1; int mid = 0; //…
Q: Instruction: A mathematician named Ulam proposed generating a sequence of numbers from any positive…
A: - We have to code and make flowchart for the Ulam pattern.
Q: Instruction: A mathematician named Ulam proposed generating a sequence of numbers from any positive…
A: PROGRAM EXPLANATION Import the java.util package. Create the main class. Define the main method.…
Q: B) Write a PYTHON script to enter a value of S (between 1 and 3) for (50) entered values of X then…
A: Note: The value of array X is hardcoded and arbitrary numbers are used, so change them according to…
Q: code in python And Vs Xor Shobhit is trying to impress Kriti. Kriti is stuck in a problem and…
A: Coded using Python 3.
Q: Problem 2. VWrite a program Icm.py that takes two integers x and y as command-line arguments and…
A: Answer is given below .
Q: An interesting application of a PLA is conversion from the old, obsolete punched cards character…
A:
Q: How can i do this in cpp without this #include and this: greater());
A: Yes, this program can be done without both #include <bits/stdc++.h> and greater<>());…
Q: C code to Mips Consider the follawing C code and MIPS ansletion auningis in S3 and y lsin Set. SC…
A: To do: C code to MIPS
python3 quadratic.py 15 19 4
the answer should be
- The solutions are -0.27 and -1.00
its only showing -0.27 and -1.0 when ran , it should be -0.27 and -1.00 not -1.0
import sys
def main():
if len(sys.argv) == 4:
a = float(sys.argv[1])
b = float(sys.argv[2])
c = float(sys.argv[3])
d = (b ** 2) - (4 * a * c)
if d < 0 or a == 0:
print("There are no roots")
else:
root1 = (-b + d ** 0.5) / (2 * a)
root2 = (-b - d ** 0.5) / (2 * a)
print("The solutions are", round(root1,2), "and", round(root2,2))
else:
print("Please provide 3 numbers as command line arguments")
main()
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Write a code that would be able to perform matrix operations of variable size depending on user to input operations should include matrix addition,multiplication,and transpose. If the user wishesh to perform a transpose operation the program should accept a single matrix only. In python.Program in C++ only: Mahesh is very good at his analytical skills so his teacher Ramanujan wants to test his skills so he gives him a condition let's consider a rectangular R table containing N rows and M columns. Rows are numbered 1 to N from top to bottom. Columns are calculated from 1 to M from left to right. Each element of R is a non-negative number. R is pronounced steadily if the total number of elements in the ith line is not less and then the total number of elements in the i-line (1) th for each i lapho is 2 Kanye N and the total element in the Nth line is less than or equal to M. Your job is to find the number of fixed tables of different sizes N x M modulo 1 000 000 000 000. Input: 1 11 Output: 21. The runsing time of fl (n) and C) are
- Write a C++ program that creates a 2D integer array of user-defined row size only. Initially, it has only 1 column, but it asks that does the user want to add a column to the array and then takes integer values to fill up the newly created column. It continues to do so until the user enters N/n to exit the program. For Example: Matrix: 1 2 4 8 Do you want to Add a column: y Enter the values in columns: 7 9 So updated Matrix is: Matrix: 1 2 7 4 8 9code in java pls Summary: Given integer values for red, green, and blue, subtract the gray from each value. Computers represent color by combining the sub-colors red, green, and blue (rgb). Each sub-color's value can range from 0 to 255. Thus (255, 0, 0) is bright red, (130, 0, 130) is a medium purple, (0, 0, 0) is black, (255, 255, 255) is white, and (40, 40, 40) is a dark gray. (130, 50, 130) is a faded purple, due to the (50, 50, 50) gray part. (In other words, equal amounts of red, green, blue yield gray). Given values for red, green, and blue, remove the gray part. Ex: If the input is: 130 50 130 the output is: 80 0 80 Find the smallest value, and then subtract it from all three values, thus removing the gray.2. code locations Consider the following C code and the corresponding assembly code: void baz(int a, int * p) { pushq %rbp movq %rsp,%rbp subq $16,%rsp int c; C = a-*p; movl %ecx,16(%rbp) movq %rdx, 24(%rbp) movq 24(%rbp), %rax movl (%rax),%eax movl 16(%rbp),%edx subl %eax,%edx movl %edx,%eax movl %eax,-4(%rbp) cmpl $0, -4(%rbp) je L2 if (c) { int d = c*2; movl -4(%rbp),%eax addl %eax,%eax movl %eax,-8(%rbp) *p -= d; movl 24(%rbp),%rax movl (%rax),%eax subl -8(%rbp),%eax movl %eax,%edx movq 24(%rbp), %rax movl %edx, (%rax) jmp L4: (continued on next page)
- 497 Bytes Write a recursive function that returns the sum of the digits of a given integer.Input format :Integer NOutput format :Sum of digits of NConstraints :0 <= N <= 10^9Sample Input 1 :12345Sample Output 1 :15Sample Input 2 :9Sample Output 2 :9 Solution:///////////// public class solution { public static int sumOfDigits(int input){ int sum; if(input<10){ return input; } sum = (input % 10) + sumOfDigits(input / 10); return sum; }}. .In c++, please. Thank you! Given a main() that reads user IDs (until -1), complete the BubbleSort() functions to sort the IDs in ascending order using the Bubblesort algorithm, and output the sorted IDs one per line. You may assume there will be no more than 100 user IDs. Ex. If the input is: kaylasimms julia myron1994 kaylajones -1 the output is: julia kaylajones kaylasimms myron1994 The following code is given: #include <string>#include <iostream> using namespace std; // TODO: Write the Bubblesort algorithm that sorts the array of string, with k elementsvoid Bubblesort(string userIDs [ ], int k) { } int main() { string userIDList[100]; string userID; cin >> userID; while (userID != "-1") { //put userID in the array cin >> userID; } // Initial call to quicksort Bubblesort(userIDList, /* ?? */ ); //make this output only the userIDs that were entered, not garbage for (int i = 0; i < 100; ++i) { cout <<…The method in Python to calculate the eigenvalues and eigenvectors of a matrixfrom the numpy linalg library is eig. It returns the eigenvalues and the eigenvectorsas one eigenvector per column of a matrix as shown in the code below. The vectorw contains the eigenvalues of the matrix A and the matrix V has one eigenvectorper column. Eigenvalues for the given matrix A are 2, 1 and 4 and we can see thatdeterminant of A is equal to the product of these values and the trace of A to thesum. write code
- (Data processing) Your professor has asked you to write a C++ program that determines grades at the end of the semester. For each student, identified by an integer number between 1 and 60, four exam grades must be kept, and two final grade averages must be computed. The first grade average is simply the average of all four grades. The second grade average is computed by weighting the four grades as follows: The first grade gets a weight of 0.2, the second grade gets a weight of 0.3, the third grade gets a weight of 0.3, and the fourth grade gets a weight of 0.2. That is, the final grade is computed as follows: 0.2grade1+0.3grade2+0.3grade3+0.2grade4 Using this information, construct a 60-by-7 two-dimensional array, in which the first column is used for the student number, the next four columns for the grades, and the last two columns for the computed final grades. The program’s output should be a display of the data in the completed array. For testing purposes, the professor has provided the following data:Given an array of size N-1 such that it only contains distinct integers in the range of 1 to N. Find the missing element. Example 1: Input:N = 5A[] = {1,2,3,5}Output: 4 Write the code for this problem in C++ and Python3Using language C++ and includes the knowledge of data structure Do it by your own pls Description Given n non-negative numbers, you need to output the non-zero numbers in reverse order. Input The input data contains multiple test cases. The first line of the input is an integer T, indicating the number of test cases. The first line of each test case contains an integer n. The second line contains 72 non-negative integers. Output For each test case, output the non-zero numbers in reverse order in a line. Simply print a blank line if there is no positive number. Sample Input/Output Input 2 5 0 0 0 0 0 9 998244053 Output 35442899