Q6: Write a program to find and print the value of (f) from the following equations for Fourteen known value of (U, 8 and Q). (U 6+15)/6 q=1 f= (&-07)/2 9-2 (U 0) +(0-18) -3 (U+0)/12 other wise
Q: Example: (H.W) Given a quadratic equation as follows: ax2 + bx + c = 0 if b*b-4*a*c_is greater than…
A: ! ---------------------------------------------------! Solve Ax^2 + Bx + C = 0 given B*B-4*A*C…
Q: compare loans with various interest rates) Write a programthat lets the user enter the loan amount…
A: By given problem, it is to be desired to display the user different loan amounts according to the…
Q: Many companies use telephone numbers like 555-GET-FOOD so the number is easier for their customers…
A: Answer:
Q: Q#1: Write a program that prints the numbers from 1 to 1000 On the same line it should also print…
A: Program plan: Create a function name printSquare() loop from i=1 to 1000 print(str(i)+". Squared…
Q: 3) Two integers x and y have values of 2 and 3, respectively, and two reals z and f have values of…
A: .not. Logical not .negv. logical not equivalence and. logical and Program: program TESTreal zreal…
Q: Q1: Write a program that reads 10 numbers and then finds the largest number and prints it and finds…
A: - The question wants us to find the largest and smallest number after reading 10 numbers and print…
Q: Build a program to input student grade by Text1 and print (A or B or C) by the following conditions:…
A: Dim x as integerPrivate sub command1_click()x= val (text1.text)If x<= 100 And x>=80 then…
Q: A factorial of N is defined as 1 if N is O or 1, and 1*2**N if N is a non-negative integer. Write a…
A: note:- only one program will be solved if they are not linked . Also mention programming language…
Q: Homework-4 Write a program read x value then compute S value from the following series: 1 (X – 1y +…
A: Note: Answering in python as no language is specified. Input to the Program : Four different values…
Q: "QUICK-BASIC64 Write an algorithm that finds and prints the sum of the first N terms of the series…
A: CLS A = 1 INPUT "ENTER NUMBER OF TIMES THE SERIES WILL RUN="; N FOR I = 1 TO N PRINT A; A = A +3…
Q: 1. Write a program to find the square of two numbers 10, -4. 2. Write a program to find the square…
A: 1. Sample Response: #Python3 program#function to print teh square of 10 and -4def printSquare():…
Q: Question: Write A Program That Compares The Values Of Y1 And Y2 In.. 3. ( Write a program that…
A: Given:
Q: Square of 13 is 169. 31, which is a reverse of 13 has a square 961. Here are few numbers which have…
A: // Following C Program will give required Output #include <stdio.h>int reverse(int n){…
Q: Example-3: Write a program to calculate the Area and volume for a sphere. Sol. -The area of sphere =…
A: In the above code, it has been asked to print the area and volume of the sphere, in the following…
Q: Q1: Write C++ program to read two integer numbers then print "multiple" or "not" if one number is a…
A: q1) #include<bits/stdc++.h>//header fileusing namespace std;int main()//main function{ int…
Q: The purpose of the following program is c = 0; k= 1; m= [ 6 7 11 4 12]; while k<=length(m) d=…
A: Here we have variable c initialized to 0 and k initialized to 1. In the loop, we have calculated the…
Q: Excercise 30 defines the number e and exerecise 31 shows how to approximate the value of e using a…
A: Since no programming language is mentioned. I am attempting this in python. if you need it in any…
Q: Q2) Write a QBASIC program to compute the volume of cube, right circular cone, sphere depending on…
A: Code: Dim V as DoubleDim op as Integer PRINT "1. Compute the volume of cube"PRINT "2. Compute the…
Q: (Racket) Write sequences of cars and cdrs that will pick the symbol 'x out of the following…
A: Given: (Racket) Write sequences of cars and cdrs that will pick the symbol 'x out of the following…
Q: Please help me solve this problem
A: Note: The Python program is coded as the user requirements.In Python, code indentation is very…
Q: Exercise 30 defines the number e and Exercise 31 shows how to approximate the value of e using a…
A: Since no programming language is mentioned. I am attempting this in python. if you need it in any…
Q: We are given 5 integer numbers. Write a program that checks if the sum of some subset of them is 0.…
A: - We need to highlight the code for subset.
Q: Q29) Consider you have a list of 20 exam scores. Write a computer program that calculates the…
A: #Code in MATLAB: clear; a=[73, 91, 37, 81, 63, 66, 50, 90, 75, 43, 88, 80, 79, 69, 26, 82, 89, 99,…
Q: Write a Program to find all Roots of a Quadratic Equation
A: a,b, c are coefficients where x can be calculayed by: x = [-b +- (b^2 - 4ac)^1/2] /2a D = b^2-4ac is…
Q: 3- Write a program to read a sequence of integers (n), then print the number of the positive and…
A: Start Input value of n from user For n times Input number If number greater than 0, then increment…
Q: (b) In a crypto-arithmetic puzzle, a mathematical equation is written using letters. Each letter can…
A: Python Program: From itertools import combinations, permutations x = input("Enter the value of x: ")…
Q: Write a program that displays all possible combinations for picking two numbers from integers 1 to…
A: Her is the Java program: public class Combinations{ public static void main(String[] args) { int…
Q: Q4 write a program that accepts a day, month and year then calculate the day of year corresponding…
A: Given requirement, Write a program that accepts a day, month and year then calculate the day of the…
Q: 3- Given S= 1 + 3! 5! ,correct the following program which describes the series S,. 7! 9! S=2; m=1;…
A: Error in the above program: Variable S's initial value should be 1 instead of 2. f = f*i will…
Q: Complete the following program that collects an input word from the keyboard and finds if the word…
A: Solution Code word = input("enter")is_palindrome = Truei=-1for j in range(len(word)): if word[j]…
Q: Complete the following program that finds which of the time points comes first. The time is…
A: (1 ) here time2 comes first means hh1 > hh2 because as hh2 is come first it will must be less…
Q: You can approximate e using the following summation: Write a program that displays the e value for i…
A: Note: Programming language is missing in the question. So we will answer this program in Java…
Q: Write a program that finds the negative integer solutions of the following equation ax³ + bx² + cx'…
A: The objective of the given problem is to find the negative integer solution in the range of -200 to…
Q: A. Sum of Others: Write a program called sum_of_others.py Given three numbers x, y, z, determine if…
A: Steps in program: Take x, y, z as input Check using if-elif-else statement whether any two are sum…
Q: 3. Write a program to read 20 integer numbers, each number consist of 3 digits, then find the number…
A: // Taking 20 numbers of three digits and storing them to a list numbers = [] for i in range(20):…
Q: Find the first 10 square numbers that are greater than Long.MAX_VALUE. A square number is a number…
A: Program: import java.math.BigInteger; public class Main { public static void main(String[] args) {…
Q: Write a program to read a sequence of integers (n), then print the number of the positive and…
A: Required: Write a program to read a sequence of integers (n), then print the number of the positive…
Q: 4. Write a simple program that checks the coordinates of a point taken from a user and identifies…
A: Code: //include the required headers #include<iostream> using namespace std; //main method…
Q: QUESTION 2 Write a program that prints out the following pattern **** **** **** ****
A: Required: C++
Q: Complete the following program that finds which of the time points comes last. The time is expressed…
A: The answer is given below according to the sequence.
Q: Write a program that invites the user to enter two numbers: a dividend (the top number in a…
A: According to the Question below the Solution: Output:
Q: Example-3: Write a program to calculate the Area and volume for a sphere. Sol. -The area of sphere 4…
A: Given: The program is written in C language to find area and volume of sphere.
Q: Q2) Write a program to read a group of numbers between 1 to 100, then find the sum of the even…
A: PROGRAM CODE: #include <stdio.h> void main(){ int i, num, odd_sum = 0, even_sum = 0;…
Q: Q2) Write a program to read a group of numbers between 1 to 100, then find the sum of the even…
A: "Since you have not mention any programming language, so we will write our program in C++ language."…
Q: Q5: Ask the user to enter five capital letters (A..Z), and check if the letters are in an ascending…
A: According to the provided information: We need to create a program that will take five capital…
Q: Complete the following program that collects an input word from the keyboard and finds if the word…
A: PROGRAM CODE: word = input("Enter a word: ") // take the word from the…
Q: Create a c++ langauge that ask the user to enter a name (one word only) and then print the name in…
A: Code: #include <iostream>#include <bits/stdc++.h>using namespace std; int main(){…
Q: 3) Write a program to find a. Surface area (A= 2 r n) b. volume(v=r ² a h) of a cylinder using…
A: Algorithm: Step-1: Start Step-2: Take input radius and height from the user. Step-3: Calling…
Q: Question: 2 Write a program using nested loop structures that displays the following ou tput. 00 01…
A: #Logic to develop code Let we have two variable i and j. variable i will print rows and variable j…
Step by step
Solved in 4 steps with 2 images
- le.com/forms/d/e/1FAlpQLSc6PlhZGOLJ4LOHo5cCGEf9HDChfQ-tT1bES-BKgkKu44eEnw/formResponse The following iterative sequence is defined for the set of positive integers: Sn/2 3n +1 ifn is odd if n is even Un = Using the rule above and starting with 13, we generate the following sequence: 13 u13 = 40 u40 =20 u20 = 10→ u10 =5 u5 = 16 u16 = 8 ug = 4 → Us =2 u2 =1. It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. The below function takes as input an integer n and returns the number of terms generated by the sequence starting at n. function i-Seq (n) u=n; i=%3; while u =1 if statement 1 u=u/2; else statement 2 end i=i+1; end statement 1 and statement 2 should be replaced by: None of the choices statement 1 is "mod(u,2)=D%3D0" and statement 2 is "u = 3*u+1;" statement 1 is "u%2" and statement 2 is "u = 3*u+1;" O statement 1 is "mod(n,2)=30" and statement 2 is "u = 3*n+1;"Let A = {a, b, c} and B = {u, v}. Write a. A × B b. B × AWrite code for. Computes the smallest x that satisfies the chinese remainder theorem for a system of equations. The system of equations has the form: x % nums[0] = rems[0] x % nums[1] = rems[1] ... x % nums[k - 1] = rems[k - 1] Where k is the number of elements in nums and rems, k > 0. All numbers in nums needs to be pariwise coprime otherwise an exception is raised returns x: the smallest value for x that satisfies the system of equations.
- The great circle distance is the distance between two points on the surface of a sphere. Let (x1, y1) and (x2, y2) be the geographical latitude and longitude of two points. The great circle distance between the two points can be computed using the following formula: d = radius * arccos(sin(x 1) * sin(x 2) + cos(x 1) * cos(x 2) * cos(y1 - y2)) Write a program that prompts the user to enter the latitude and longitude of two points on the earth in degrees and displays its great circle distance. The average earth radius is 6,371.01 km. Note that you need to convert the degrees into radians using the math.radians function since the Python trigonometric functions use radians. The latitude and longitude degrees in the formula are for north and west. Use negative to indicate south and east degrees.(Learning Objective: students will be able to apply their knowledge of the built-in random package to generate simulations of simple phenomena.) Write a function: • dicesim(D1,D2,trials) that takes as input the number of sides on die 1 (D1) and die2 (D2) and the number of trials. Your function should repeatedly sum pairs of random numbers between 1 and D1 and 1 and D2 and keep track of how many times each sum occurs. The function returns a numpy array with the fraction each sum of rolls occured. Since the numbers are chosen at random, the fractions will differ some from run to run. One run of the function print(p22.dicesim(6,6,10000)) resulted in: [0. 0. 0.0259 0.0615 0.0791 0.1086 0.139 0.1633 0.1385 0.114 0.0833 0.0587 0.0281] or displayed using the code from Section 16.1.1.: PMF of X Note: you should submit a file with only the standard comments at the top and the function. The grading scripts will then import the file for testing.(Numerical) Write a program that tests the effectiveness of the rand() library function. Start by initializing 10 counters to 0, and then generate a large number of pseudorandom integers between 0 and 9. Each time a 0 occurs, increment the variable you have designated as the zero counter; when a 1 occurs, increment the counter variable that’s keeping count of the 1s that occur; and so on. Finally, display the number of 0s, 1s, 2s, and so on that occurred and the percentage of the time they occurred.
- A pentagonal number is defined as for and so on. So, the first few numbers are 1, 5, 12, 22, .... Write a function with the following header that returns a pentagonal number:def getPentagonalNumber(n):Write a test program that uses this function to display the first 100 pentagonal numbers with 10 numbers on each line.Given L = {w = {a, b}*: |w| is even}, the correct statements are: (aa U ab Uba U bb)* is a regular expression that generates L. (ab Uba)* is a regular expression that generates L. aa U ab U ba U bb is a regular expression that generates L. ab U ba is a regular expression that generates L.Rolling a single six-sided die produces a random number between 1 and 6 with a uniform distribution. Rolling two dice produces a number between 2 and 12 with a binomial distribution. In this lab you will simulate a number of dice rolls and graph the number of occurrences of each value. 1) Create a function called rollDie() that takes no parameters, and returns a random value between 1 and 6. Do not seed the random number generator in this function. int rollDie() 2) Create a function called initArray() that takes a data array and the size of the array as parameters and fills each element with the summed results of rolling two dice. Do not assume that the data array has been initialized. void initArray(int data[], int size) 3) Create a function called sortArray() that takes an array and the size of the array as parameters, and sorts the array using the sediment sort. void sortArray(int data[], int size) The sediment sort works as follows: start with the second element in the array if…
- Code in Python Write a function, print_integers_less_than(n), which takes an integer parameter n and prints each integer k which is at least 0 and is less than n, in ascending order. Hint: use a simple for loop. For example: Test Result print_integers_less_than(2) 0 1 print_integers_less_than(5) 0 1 2 3 4 print_integers_less_than(-3)Part a:Finding Pythagorean Triples with OpenMPWrite a program that calculates Pythagorean triples using nested for loops. The Pythagorean Theorem states the following:?2 + ?2 = ?2Where a, b, and c are whole numbers. Part b: Modifying the Pythagorean Theorem Modify the Pythagorean Theorem by either adding or subtracting a times b on the left-hand-side, and run the program again. Are there integer solutions for this??2 + ?2 + ??= ?2Computer Science This is an introductory exercise to the manipulation of random variables with Python as a language for scientific computing and numerical computation. You have: f(x) = Ae-0.1x)° 4 x*, 0SEE MORE QUESTIONS