Write a program to calculate the K value using if else condition If P value is more than 9 then K = M/2 - VP +C If P value is less than or equal to 9 then K = M2 + VP+C Where C is a constant with value 1.7
Q: Q/ Write a program in MATLAB to solve the following equation: a- using if. b- b- using switch if you…
A: Given a Scenario where we need to evaluate an expression based on the value of x if x is from 0 to…
Q: Write a program to compute (S) value where: SA + sin B X-1 |2a° - 9B| X-2 VA? + 2B X-3 log(B? + 4B)…
A: Since no programming language is mentioned, I am using c++ Algorithm: Start Read X value Read A,B…
Q: Write a program computing terms of the sequence given by the condition: x_0=1, x_1=1/3,…
A: Here is the complete matlab code. See below step
Q: Write a program that computes and print the sum for an input integer n,a.c. £ fx= co+Ci (x - a) + c2…
A: for this programme we will take input as x,a,n and n times c for c1,c2,c3,....cn and then we will…
Q: Write a program to calculate the value (x + 1)! (x+ 2)!, (x+3)! (x+ 4)! (x + n)! s = 1+ 2! 4! 6! 8!…
A: PROGRAM CODE: #include <iostream> // include header file for input output…
Q: Write a F90 program to find the number of terms that are required to make (y = 0.4930687) of the…
A: The sin function in Fortran calculates sin of a radian value. To determine the radian value, the…
Q: Write a python program to accept 4 numbers x, y, p and q as input from user if x modulus p is equal…
A: required
Q: write a program c ++ Find the value of B (true or false) for the following : i= 5:j = 9 B= ! (( i>…
A: Boolean operator in C: In C++ three categories of Boolean operators are used: "&&" used for…
Q: The following mathematical operation is written in C++ as: P = 700Po (700-Po)e-(T/10) Po+…
A: Given mathematical operation is, p=700 p0p0+(700-p0)e-(T/10) In this expression, it contains an…
Q: Write a program that is given two doubles for comparison and a third double that is a differen three…
A: C++ program:#include <iostream>#include <math.h>using namespace std; int main(){…
Q: Write a program (using a switch statement) that converts three numbers specifying ar HSV…
A: Answer: we have written code as given instruction in code image in C++ programming language and also…
Q: Write a program in cpp that takes three inputs from the user and output the mean and median of the…
A: Mean is the average of 3 numbers. Median means the middle value.
Q: Write an C program to read a value from PORT C, add value 33h. Send value to PORT B if value is…
A: Following needs to be done : Read value from PORT C Add 33h If value is greater than 99, send to…
Q: Consider the given form F(A,B,C)=D7(1,2,3), which is the equivalent expression from the given…
A: BOOLEAN THEORMS: Boolean algebra helps us to analyze a logic circuit and express its operations…
Q: Consider the following Boolean expression: $ = q • (q . r')' · r' + ((p + q) · (p' + q') Tick all…
A: Disjunctive Normal Form (DNF) can be described as a sum of products, and an OR of AND's. So option 1…
Q: Write a program that takes in a line of text as input, and outputs that line of text in reverse. You…
A: Given: Write a program that takes in a line of text as input, and outputs that line of text in…
Q: (a) For two functions f(n) and g(n), if f(n) = O(g(n)) then g(n) = N(f(n)). (b) For positive valued…
A: As per our company guidelines we are supposed to answer only first 3 bits. Kindly repost other bits…
Q: Based on C++ program code below, choose any random integer value for x and y, then predict the…
A: Ternary Operator: => The ternary operator is the only operator that takes three operands: =>…
Q: Construct a truth table for the statements below a. (p ∧ q) ∧ (~r ∨ q). b. ~[~p ∧ (q ∧ r)] c. [p ∧…
A: Three cases are given for each of the expression. So put these values for p, q and r in truth table…
Q: write program that find and print z value as fallow sin(a) + cos(b) Va - eb + 2 ab Jal+ b| x = 1 x =…
A: ## As no language is mentioned, we write the code in Python. import math…
Q: Suppose we want to store the value 1.5 into a double variable d. Which of the following would not…
A: Syntax rule:- Out of two operands on division operation , if anyone of them is double will produce…
Q: Write a python program to accept 2 numbers, if two numbers are same calculate Z=a2+b², if modules of…
A: In python pow() function is used to find an exponent power of any number. The syntax for pow is…
Q: Write a c-program that can detect if a given function is increasing or descreasing.
A: Note: There are multiple questions are given in one question. According to the rule, you will get…
Q: C++ write an program that gives an output of these examples ./a.out -c ATTCGG 6 22 240 ./a.out…
A: The objective is to write a program that gives an output as given.
Q: Write a program that calculates the root mean square value (rms) of the real numbers those will be…
A: sqrt() is used to find the square root of number available in cmath header section
Q: Construct a truth table for the given statement. Fill in the truth table. (PAq) (-p v q)(p A q) (-p…
A: - The question is to write the truth table of the provided equation. - In the provided question…
Q: Consider the following program which is partially correct given the postcondition is x + y = 0 && y…
A: Option B is correct As x will always be greater than 0, x >=0 is the weakest loop invariant that…
Q: Write a program to calculate the K value using if else condition If P value is more than 9 then K =…
A: Step 1:- Program Approach:- 1.Declare the 3 variable of data type float 2.Declare one variable as a…
Q: Q6: If X = 2 y = 5 Z = 0 then find values of the following expressions: a. x == 2 b. x != 5 C. x !=…
A: Given x=2 y=5 z=0 a. x==2 == is comparison operator. When both the values are equal, then the value…
Q: Write a program to calculate the K value using if else condition If P value is more than 9 then K =…
A: Program description: M and P are the user input integer variables. C is a constant having a constant…
Q: Q/ Write a program in MATLAB to solve the following equation: a- using if. b- b- using switch if you…
A: CODE:
Q: Write a program that will read in a length i meters and centimeters. Use at least three (consider…
A: #include <iostream>#include <cmath>#include <string> using namespace std; int…
Q: Problem 2 Write the sentence with variables p, q, r and connectors, A, V for the following two truth…
A:
Q: 2. Find simpler formulas equivalent to this formulas: a) ~(pV~ q) b) ~ (q ^~ p) V p c) pV (q ^~ p)
A: Note: The answers to the first three subparts are shown below. Please repost the remaining subparts…
Q: Evaluate the given Computer Expressions below: Suppose the value of A = 10; B = 15; C = 20.50; D =…
A: INTRODUCTION: Here we need to tell the answer of the given computer expression. According to…
Q: Let Q(x, y) denote "x + y = 5" The domain of x and y is from range 0 to 5 . Implement the code that…
A: #include <iostream> using namespace std; int main() { cout<<"1.€x €y Q(x, y)\n";…
Q: Write a python program to accept 4 numbers x, y, p and q as input from user if x modulus p is equal…
A: #Taking input from userprint("Enter x: ")x = (int)(input()) print("Enter y: ")y = (int)(input())…
Q: Write a YACC program to identify whether a given number is positive integer and negative integer,…
A: Lets see the solution.
Q: Write a python program to accept 2 numbers, if two numbers are same calculate Z=a2+b2, if modules of…
A: Algorithm: Start Read 2 numbers if two numbers are same Read a,b values calculate Z=a*a+b*b if…
Q: Write a python program to accept 4 numbers x, y, p and q as input from user if x modulus p is equal…
A: Editable code: #Input x, y, p, qx=int(input())y=int(input())p=int(input())q=int(input()) # if-else…
Q: Write a program to find H value where : H = |x* +5 if K=1 H= cos(A+ B)3 + VY + M if K=2 H = log (R3+…
A: import math def calculate_HValue(k): if k == 1: x = int(input('Enter X value: '))…
Q: Consider the following program. if(N1 == R* || N2 =='r' ) cout<<"Red"; else if(N1 == 's' | N2 ==…
A: Since value of N2 is r and s hence The condition for Logical OR operator is being satisfied.
Q: Complete the following truth table. p q r ~p ∨ ~(q → ~r)
A: Propositional Logic A proposition is the basic building block of logic. It is defined as a…
Q: Write a Numpy Program to calculate the mean of the number of steps of the first crossing time which…
A: NumPy in which stands for Numerical Python.
Q: Select all true statements. 1. If z does not occur free in B, then FB→A if and only if HB→ (Vz)A. 2.…
A: Answer:)
Q: Write a C++ program to compute x based on the following formula. x=2-" + /c2 - 4nk Given that y =…
A: A required C++ program is as follows, //Include header file #include <iostream>…
Q: 2. Given a boolean expression below, find the value of the expression if the values of P = 1, Q = 0,…
A: Given Expression: Y = P.Q + Q.(R+P+Q) Values: P = 1, Q = 0, R = 1 Requirement: Find the value of the…
Step by step
Solved in 3 steps with 2 images
- (Statistical) In many statistical analysis programs, data values considerably outside the range of the majority of values are simply dropped from consideration. Using this information, write a C++ program that accepts up to 10 floating-point values from a user and determines and displays the average and standard deviation of the input values. All values more than four standard deviations away from the computed average are to be displayed and dropped from any further calculation, and a new average and standard deviation should be computed and displayed.(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:(Civil eng.) Write a C++ program to calculate and display the maximum bending moment, M, of a beam that’s supported on both ends (see Figure 3.8). The formula is M=XW(LX)/L, where X is the distance from the end of the beam that a weight, W, is placed, and L is the beam’s length. You program should produce this display: The maximum bending moment is xxxx.xxxx The xxxx.xxxx denotes placing the calculated value in a field wide enough for four places to the right and left of the decimal point. For your program, assign the values1.2,1.3,and11.2toX,W,andL.
- When you perform arithmetic operations with operands of different types, such as adding an int and a float, ____________. C# chooses a unifying type for the result you must choose a unifying type for the result you must provide a cast you receive an error messageraph EECP1290: Computer Programming for Engineering Write a program to calculate the K value using if else condition If P value is more than 9 then K = M/2 – vP+C If P value is less than or equal to 9 then K = M/2 + /P +C I= Where C is a constant with value 1.7C++ Programming Language: Enhance the code given by outputting: The largest number of the sequence a0 ,a1 ,a2 , ..., ak. The position of the largest number Test your program for the following values of x: 75, 111, 678, 732, 873, 2048, and 65535. Example: "For example, for the input sequence: 75, 226, 113, 340, 170, 85, 256, 128, 64, 32, 16, 8, 4, 2, 1, the program output should contain the following: The largest number of the sequence is 340 The position of the largest number is 4" Code Given: #include <iostream> #include <iomanip> using namespace std; int main() { long x; int count; long a_n; cout << "Enter a nonnegative integer: "; cin >> x; cout << endl; count = 0; a_n = x; cout << a_n << ", "; while (a_n !=1) { if (a_n %2==0) a_n = a_n / 2; else a_n = 3 * a_n + 1; count++; cout << a_n <<", "; } cout << endl; cout << "The integer k such that a_k = 1 is " << count << endl; return0; }
- Written in C# Language Please! A fixed percentage of water is taken from a well each day. Request values for W and P where: ▪ W is the amount (in litres) of water in the well at the start of the first day ▪ P is the percentage of the water in the well taken out each day Write a program to print the number of the day, the amount taken for that day and the amount remaining at the end of the day. The output should be terminated when 30 days have been printed or the amount of water remaining is less than 100 litres, whichever comes first. For example, if W = 1000 and P = 10, the output should start as follows: Day Amount Taken Amount Remaining 1 100 900 2 90 810 3 81 729 Note: The amount taken and amount remaining should be displayed to 2 decimal places.c programing language A store asks you to write a C program to make cash payment easier for cashiers. Write a Cprogram that divides the amount of money entered by the cashier into 200 TL, 100 TL, 50 TL,20 TL, 10 TL, 5 TL, and 1 TL banknotes and shows the number of each banknote. Your programshould have an output as given below.elearning.ibrict.edu.om EE EECP1290: Computer Programming for Engineering-CLA#1 Write a program to calculate the K value using if else condition If P value is more than 9 then K = M/2 VP+C If P value is less than or equal to 9 then K = M2 + P+C Where C is a constant with value 1.7 Sample output: Enter p value:16 Enter M value:4 p, M and K values are:16.000000 4.000000 -0.300000 Sample output: Enter p value:9 Enter M value:4 P, M and K values are:9.000000 4.000000 6.700000 >
- Write a C program that can generate the following pattern. Enter the number of rows (must be an odd number) : 5 AAA --BB ----c --BB AAA Enter the number of rows (must be an odd number) : 21 AAAAAAAAAAA --BBBBBBBBBB -CCCCCCCCC -DDDDDDDD -EEEEEEE -FFFFFF. -GGGGG -HHHH III Enter the number of rows (must be an odd number) : 11 AAAAAA --BBBBB J] -III ----CCCC -HHHH -DDD --GGGGG -EE -FFFFFF -EEEEEEE EE -DDDDDDDD -DDD --ССССССССС ---CCCC --BBBBBBBBBB AAAAAAAAAAA --BBBBB AAAAAAIn c language Using function strtod(), Create a character string that contains the following string: “78.3% is the average success rate” Divide this string into double and display the rest of the string The output will be: The original string is: 78.3% is the average success rate The extracted double value is: 78.3 The remainder of the string is: % is the average success rateBrute force equation solver this is python program. Numerous engineering and scientific applications require finding solutions to a set of equations. Ex: 8x + 7y = 38 and 3x - 5y = -1 have a solution x = 3, y = 2. Given integer coefficients of two linear equations with variables x and y, use brute force to find an integer solution for x and y in the range -10 to 10. Ex: If the input is: 8 7 38 3 -5 -1 Then the output is: 3 2 Use this brute force approach: For every value of x from -10 to 10 For every value of y from -10 to 10 Check if the current x and y satisfy both equations. If so, output the solution, and finish. Ex: If no solution is found, output: No solution You can assume the two equations have no more than one solution. Note: Elegant mathematical techniques exist to solve such linear equations. However, for other kinds of equations or situations, brute force can be handy. ''' Read in first equation, ax + by = c '''a = int(input())b = int(input())c = int(input()) ''' Read in…