(e) A survey is being carried out which involves reading and recording sound levels near a busy road junction. A sound level of 0 decibels (0 dB) indicate the end of the data. Write an algorithm, using pseudocode, which inputs all the sound levels and after a sound level of 0 is input, outputs the average sound level and the highest recorded sound level.
Q: Assume that a, b, c, and d are as defined, and evaluate the expressions: (a >b && c > d ) and (-b).…
A: a = 20 b = -2 c = 0 d = 1 1. (a > b && c > d) a > b = 20 > -2 = 1…
Q: 1. Find the error in each of the following code segments and explain how to correct it. a) x = 1;…
A: a) Here the loop goes into an infinite loop as x=1 and 1<=10 is always true and the value of x is…
Q: Given initial values of x= 2, y = 1 and count 2. and a code : count+=y; if (count 3 ) X--; else x++;…
A: y = 1 and, count = 3
Q: Fill in the gap to complete the code so that the program produces the expected output. Expected…
A: The solution to the given problem is below.
Q: sin'a 1) Let A = 1-cos and B = B for x = 0.1,0.01, 0.001, 0.0001,0.00001, and calculate the error…
A: 1) clc;clear all;close…
Q: Q2)Write a MATLAB program to Solve the following system of three linear equations: 2x + 3y = 0.5a…
A: Ans:) Given, a system of linear equations, a, b, and c are ASCII values of the first three letters…
Q: and : are 1. The difference(s) between following expressions. 2. The use of axis() is for . . 3. The…
A: Answer :- ( 1 ). The difference between expressions .* and : are :- Z = X.*Y multiply the arrays X…
Q: 2. Assuming a sequence of integer numbers, from X to Y (both received as input), where X<Y, write…
A: Given :
Q: ( (A + B ) * (C – D) + E / F ) – G Using manual and algorithmic methods, write the following…
A: Given expression: ( (A + B ) * (C – D) + E / F ) – G Convert it into postfix form.
Q: (b) Calculate the final value of the following postfix expression. Consider each number is…
A: Find the required answer with calculation given as below :
Q: 3 and -2 2. Consider the mean vectors = H, =4, and the covariance matrices of x1, x, and [2 1 3 y…
A: This C program implements Linear Regression Method using Least Square Method to find linear equation…
Q: Given a and b are int variables and c is a double variable. The initial value for a, b, and c are 8,…
A: b++ is a post increment operation where the result in b updates after expression evaluation and thus…
Q: formula that generates the following sequence a1,a2,a3, …. a) 4, 6, 8, 10, 12, ... b) 0, 3, 8,…
A: Given : a) 4, 6, 8, 10, 12, ... b) 0, 3, 8, 15, 24, ….
Q: Give all the possible ways to test the equality of two variables with suitable program code
A: We can check whether our elements are equal or not. There are several ways to do this some of them…
Q: Given the initial statements s1 = [2,1,4,3] s2 = ['c','a','b'] show the result of evaluating each of…
A: s1 = [ 2,1,4,3] and s2 ['c','a','b'] We need to show the result when each of the given expression is…
Q: Q3) The exponential function is represented by Taylor series as: By using fortrango programming…
A: We need to write Fortran-90 program to compute ex using Taylor's series expansion.
Q: Determine the output of the given program segment. Assume the following initialization: int x =5, y…
A: Solution - In the given question, we have to determine the output of the given program segment.
Q: Read in 5 numbers from the keyboard and, if any of the entered numbers is < 0, then print out…
A: Pseudo code is given below to read five numbers from the keyboard and print “Negative” if the number…
Q: Use numpy library to solve the simultaneous equation below to output p, q, r and s. The value a and…
A: Python used to answer this question
Q: 2. Complete the program and identify and correct the errors in each of the following. a) if ( sales…
A: * Question a. #include<stdio.h>int main(){ int sales; printf("Enter Sales:");…
Q: 3. Make a program to accept a reading in richter scale of an earthquake and display the extent of…
A: Given :
Q: Write a single line of code to print the the decimal portion of value using casting. Example Output…
A: we can easily get decimal portion from any give value using below code
Q: 4. Draw a flowchart for the following algorithm: When two points in time are compared, each given as…
A: flowchart is a graphical presentation which shows flow of controls and execution of statements.
Q: 9. write algorithm to find the result of the following equation: S-x, x<0 (x, x 20 f(x) =
A: Algorithm :- Start; Input x If( x<0) Return -x Else Return x. End Here first check…
Q: Computer Science Code the below in python or C: Given: n*m bar of chocolate and minimum number of…
A: def findMinimum(arr, n, k): res = 0 i = 0…
Q: Q1/answer A or B: A-Write a program to compute the drag force Fn (in Newton) When a body swims…
A: Hello student Greetings Hope you are doing great. Thank You!!!
Q: I. Create the code/C program and generate the output. Compute the average and print the standard…
A: Declare and initialize four double variables to hold the four values. The values of these variables…
Q: { int x, y = 1; For(x=0; x<50; x+ =5) 66 { cout << x << "<< y; y ++; }}
A: 1) The C++ code snippet in question does below activities It declare variable x and y and…
Q: 31. If originally x=4, what is the value of x after the evaluation of the expression: x++
A: Postfix increment operator:. 1) postfix increment is denoted as : expr ++ 2) prefix increment is…
Q: 1- Given the length and width of a rectangle, write C program to computes and outputs the perimeter…
A: In this question, we are asked to print the perimeter and area of rectangle Algorithm: 1) Enter the…
Q: e a Numpy Program to calculate the mean of the number of steps of the first crossing time which is…
A: Numpy code to calculate the mean for a given condition is detailed below.
Q: The roots of a cubic equation ax'+a,x² +ax +a, =0_can be calculated using the following procedure:…
A: the code is an given below :
Q: 5. Use the truth table to determine the following compound statements (i) ((PAQ) V (RA S)) (ii)…
A:
Q: 1) For the following program: a=6.3; ..(a) ; b=7; c=a+b; , the result will be: ans=13.
A: Note: we are only allowed to solve one question in one post. I am solving the first on here. To get…
Q: Describe what the following code is doing (the outcome), by annotating each line of code and giving…
A: The program starts by moving 100 in R0 and 20 in R1 In second line the loop starts: It compares…
Q: Assume that a, b, c, and d are as defined, and evaluate the expressions: (a > b && c > d) and (-b).…
A: Given:
Q: 1. Write Octave code to solve the quadratic equation 3x2-5x + 1 = 0 Find roots of the equation and…
A: Given quadratic equation is: 3x2-5x + 1 = 0 Requirement: Write octave program to solve the given…
Q: Use the equations in the book or the computer program of this chapter. Find the radiation efficiency…
A: a)
Step by step
Solved in 2 steps with 2 images
- Given a sequence of N input number variables, where itself is an input variable number, write predocode for a program that first checksif N is greater than zero and then goes on to output the minimum of the N input numberdiscrete math programing python or c++ the range of values is from 0 to 5 Let Q(x, y) denote “x + y = 5” The domain of x and y is from range 0 to 5 . Implement the code that outputs the truth values of the following quantifications: 1. ∀x ∀y Q(x, y) 2. ∀x ∃y Q(x, y) **Display values of variables x and y if the quantification is true.Airline companies apply baggage restrictions for their passengers. An airline company has decided to apply a 10kg limitation for passengers' hand luggage and 20kg for their normal baggage. When passengers arrive, they enter their hand and normal luggage weight from the keyboard. If passengers exceed their normal baggage allowance of 10 dollars per gram, they pay 12 dollars per kg. Accordingly, write the program that calculates the baggage price of the airline they will go to according to the baggage values entered by the arriving passenger and keeps this from closing the program for each passenger. Note: If hand and normal baggage allowances are stretched below the maximum value, the payment amount will be considered not negative. An example printout is given on the right. Geri bildirim gönder
- An integer n is divisible by 9 if the sum of its digits is divisible by 9. Develop a program to display each digit, starting with the rightmost digit. Your program should also determine whether or not the number is divisible by 9.please use pseudocode to answer the following question Two students challenge each other to a basketball shootout. They agree to limit the number of attempts to 3 throws each. The game will be constructed in two sessions where the first student will make all 3 attempts followed by the second student. The student who makes the most baskets (gets the ball in the hoop) will be declared the winner. In the case of a tie, the game will be repeated until a winner can be determined.Givenx = 9, and y = 4, compute the product p = x ÷ y by using Unsigned Binary Division Algorithm, where each number is represented using 4 bits. Note: x is the dividend and y is the divisor You MUST SHOW the STEPS of the calculation. The flowchart of Unsigned Binary Division algorithm is shown below. START A-0 M-Divisor Q-Dividend Count Shift Left A, Q A-A-M No Yes A<0? Qo–1 A-A+M Count-Count– 1 No Yes Count = 0? Quotient in Q Remainder in A END
- 3. Write an algorithm that inputs a student's score outputs his grade according to the following: Score Grade 0- 59 F 60 - 69 D 70 – 79 80 – 89 В 90 – 100 AWrite an algorithm that asks the user to enter 10 test scores and do the following:(a) Print out the highest and lowest scores.(b) Print out the average of the scores.(c) Print out the second largest score.(d) If any of the scores is greater than 100, then after all the scores have been entered, print a message warning the user that a value over 100 has been entered.(e) Drop the two lowest scores and print out the average of the rest of them.Suppose that the cost of sending an international fax is calculated as follows: Service charges $3.00; $.20 per page for the first 10 pages; and $0.10 for each additional page. Design an algorithm that asks the user to enter the number of pages to be faxed. The algorithm then uses the number of pages to be faxed to calculate the amount due. Write your algorithm in pseudocode.
- PYTHON PROGRAMMING LAB Write a python program to check whether two user inputted numbers have the same last digit or not. If they have same digit then print the addition of both numbers else print the subtraction of both numbers.Write a program will then ask for the prelim grade, midterm grade and final grade of the student. The program should only accept grades 100 and below. After getting the three grades, the program should compute for the semestral grade. The computation of the semestral grade is as follows: 30%*PrelimGrade + 30%*midtermgrade + 40%finalgrade After inputting all the grades, the screen should clear again and will proceed to another screen. Use C ++ program, cin, cout, and iostream.Write a program which repeatedly reads several people's height numbers in cm(centimeter) until the user enters "done". Once "done" is entered, print out the max, min, and average of the height numbers. Correct height data should be number between 50cm and 250cm. If the user enters number out of the range, or anything other than a number, detect the mistake and print an error message and skip to the next number. Sample input and output: Enter a height: 300 Invalid input Enter a height: 10 Invalid input Enter a height: 200 Enter a height: good Invalid input Enter a height: 180 Enter a height: 165 Enter a height: done Max: 200.0 Min: 165.0 Average: 181.67