3) Write a general program that computes the values e" by using the following equation. Calculate the output when x=3. The equation must have 15 terms with x. e =1++ 2x (2x) (2x) I! 21 +. 3! Do not write the program by simply adding the terms in the equation. You are allowed to use "math.h" functions.
Q: Question 2 Write a program which takes two float numbers from the user and check, if first number is…
A: algorithm:- (I) input first, second (II) if(first>second) { first=first+5;…
Q: Q3: The volume of a circular cylinder V=rtr?h, write a program to compute the volume if r=8m and…
A: Objective: This program designs a class to create cylinders for a given height and radius. The…
Q: Q4. Write the following equation as a C++ expression and state the order of evaluation: NITX x = (a…
A: Evaluation perform based on the priority order. Highest precedence operators evaluate first after…
Q: 17. Write a program that calculates and print the numbers (from 0 to 10) and it squares and cubes.
A: Mathematically we know that square of a number is its multiplication by itself. For example if n is…
Q: 04. Write the following equation as a C++ expression and state the order of evaluation: -b + vb2 –…
A: The answer is given below.
Q: Question 2 Write a program which takes two float numbers from the user and check, if first number is…
A:
Q: C++ Have the user input a Float (ex: -15.750) and the output must display the following: Float…
A: c++ program to input the float value and print it into IEE 754 representation.
Q: int x = 0; for (x=1; x<4; x++); cout<<"x="<< x; The output value after executing the above…
A: Given To know the output of program int x=0; for(x=1;x<4;x++);…
Q: Q1/an A-Write a program to compute the drag force F, (in Newton) When a body swims through fluid,…
A: Logic:- Given values of p=1000 vinf=1.25 A=0.25 Cd=0.09 We have to calculate Fd, Given formula:-…
Q: 28. If originally x=4, what is the value of x after the evaluation of the expression: x+=4
A: Given, x = 4. The value of x after the evaluation of the expression: x+=4 is 8.
Q: Q2: Write a program to compute and display a person's weekly salary as determined by the following…
A: Since no programming language is mentioned, I am using python. Algorithm: Start Read no.of hours n…
Q: 2. Write a program to find value of z according to the following equations: Z-xty when r-1 Z-X-y…
A: 2. Purpose: The main purpose is finding the value of z that is by given equations and in…
Q: 9- Write a program which read a number of 3 digits and check if (units, tens, hundreds) digit is…
A: #include <stdio.h>int main(){ int digit[3],i=0,a=5; // Input the digit as an array…
Q: Exercise 3: Write a C++ program that asks the user to enter the value for input variables, and…
A: Given that Write a c++ program that asks the user to enter the value for input variables, and…
Q: Q2)- Choose the correct statement 1- To change the text x to capital letters, use the function : a)…
A: Lcase is a function in Visual Basic is used to convert a string to lower case Ucase is a function in…
Q: 6.29 LAB: Max and min numbers Write a program whose inputs are three integers, and whose outputs are…
A: Answer: step 1: take three inputs step 2 : define two functions one for finding largest among three…
Q: Q1/A-Write a program to compute the mass flow rate of a fluid (in kg/sec) through a thermal unit…
A: Code: Dim A as DoubleDim M as DoubleDim Po as Double Dim K as DoubleDim R as DoubleDim T0 as…
Q: Write the input statement to get float input from the user with a prompt message as "Enter Float…
A: Given Write the input statement to get float input from the user with a prompt message as "Enter…
Q: 2- Write a pyhton function that prompts the user to input three integers and prints the sum of those…
A: Given: 2- Write a pyhton function that prompts the user to input three integers and prints the sum…
Q: Exercise 5 : Write a C++ program that asks the user to enter the value for input variables, and…
A: I have provided both the programs in C++ language in step 2 with its outputs.
Q: 16. Write a program that will display the following pattern, given the value of n and m. Example if…
A: We have to write a C program to print the pattern as given. Here n (number of columns) and m (number…
Q: 2. Write a program to input a number x from the keyboard. If the number is larger than 0, find its…
A: The problem is based on finding the square or square root of a number depending on its value.
Q: 2- Now we can move on to writing some code that calculates the average of 3 numbers. a) This program…
A: (a) int n1,n2,n3; printf("\nENTER THREE NUMBERS: " ); scanf("%d %d %d",&n1,&n2,&n3);…
Q: Please revise the program and correct the errors of the program and make varaibles a and b not…
A: Using the member functions setA and setB of Struct X, the values of a and b are given to the…
Q: Exercise 2: Write a C++ program that asks the user to enter the value for input variables, and…
A: The code for the above problem is as follows:
Q: 3- The below program has errors, trace the below program and mention the errors: # include int main…
A: - We have to correct the code removing the errors.
Q: Q2) Write a program to solve the following equation: xa + ya? + z*
A: According to the information given:"- We have to define the write program to solve the mention…
Q: 3. Convert the following code into descriptive code, and verify using White Box Testing. a = 2 b =…
A: According to the information given:- we have to convert following code into descriptive code and…
Q: 2. Write the statements to sum the odd integers between 1 and 99 by using a for statement. Assume…
A: Here we have written a c program to print the sum of the odd integers between 1 and 99 using for…
Q: complete the function that calculates the Euler's number e from the series you learnt during the…
A: 1. e and x are given 2. loop from 0 to n i. add math.factorial(i) to e ii. if x have other…
Q: 3. Question 1 Write a program which takes two float number from the user and check, if first number…
A: Since you are not specify any language for implementation, I choose C language. Program #include…
Q: b-Find the output of the following program. # include using namespace std; int main() int n.m.y.…
A: Here we have 3 different variables named n, m, and y. Next, we have initialized n and m with values.…
Q: Q1/an A-Write a program to compute the drag force F, (in Newton) When a body swims through fluid,…
A: Hello student Greetings Hope you are doing great Thank You!!!
Q: Assume a, b, c and n are float variables, and d, e, fand m are integer variables, what is the result…
A: As I have read the guidelines I can provide answers to only 1 part of the questions in case of…
Q: 4. Write a program that computes the following equation: 1 2 y = 1+ - + - ... .2 xn
A: I have answered this question in step 2.
Q: In the below given program there is an error, find the error and write the correct statement.
A: In assignment statement num2 variable is not passed, hence it will return syntax error, num not…
Q: One lap around a standard high-school running track is exactly 0.25 miles. Write the function…
A: Program code: #define function miles_to_laps def miles_to_laps(user_miles): #return laps…
Q: Q/ A College of engineering is advertised to call high school graduates to apply to its departments…
A: Problem Statement: A College of engineering is advertised to call high school graduates to apply to…
Q: Write a program calculating the area of a triangle with the length of the three sides as a, b, c,…
A: Task :- Write a program to calculate the Area of given triangle . C++ program :- #include…
Q: Write assignment statements that perform the following operations with int variable i, double…
A: GIVEN: int i; double d1, d2; char c; A) Subtract 8.5 from d2 and store…
Q: The following code will print Int X-0; Int y=x + -X; Printf("%d",y);
A: The Output Will be : -1(Option d)
Q: Problem 2. (Playing the Waltz) Write a program called playwaltz.py that accepts from standard input,…
A: Write a program playvalt2.py that accepts from standard input, a sequence of 32 integers…
Q: Point out the errors if any in the following part of the program in c++ void main() { int…
A: void main() { int a=30; f(); // function call } void f() //function definition { int b=10;…
Q: 3. Write a computer program to solve the quadratic equation below: ax²+ bx + c = 0 The input data is…
A: Program: Programs are used to solve complex problems. The main objective of the program is…
Q: Write a program that prompts the user to input three (3) integers: MM, DD, and YYYY. For example, 07…
A: Use a function to check whether year is leap year or not and then an array to save the number of…
Q: A) What is the output for the following code? B) Explain what the code is doing. i = 0 mypi = 0.0…
A: The program is trying to find the value of pi using formula π4 = 1 - 13 + 15 - 17 ± The program…
Q: 2. Construct a program where you deciare and initialize a constant variable, now try to reassign…
A: EXPLANATION: The constant variables are basically those variables which can not be modified at the…
Q: Y USING C++, SOLVE THE FOLLOWING QUESTION. Based on the coding attached, further modify the C++…
A: Q: Code the given problem.
Step by step
Solved in 3 steps
- 3 Write two different functions which have the following results with input 1 and 2. It means that these two different functions are equivalent at input 1 and input 2.Find the error in each of the following program segments and explain how the error can becorrected (see also Exercise 5.46):a) int g(void){printf("%s", Inside function g\n");int h(void){printf("%s", Inside function h\n");}}b) int sum(int x, int y){int result = x + y;}c) void f(float a);{float a;printf("%f", a);}Point out the errors if any in the following part of the program in c++ void main() { int a=30; f(); } void f() { int b=10; }
- C++ Have the user input a Float (ex: -15.750) and the output must display the following: Float Number (what the user inputted), Sign (If the user inputted a positive or negative Float), Whole (binary), Fractional, Exponent, Mantissa and IEE 754. NO library functions like atoi. These are the steps that I have so far: Input a Float Check if Float is Pos or Neg -> store 0 or 1 (and then make it positive to make it easier) Split the float into whole (int) and fractional (float) Convert whole number into binary (if whole == 0) like (0.1231), then just store 0 into the binary Convert fractional to binary Find exponent bias Convert exponent bias to binary Create the mantissa Create IEE754 (the whole thing) OUTPUT: Float Number: Sign: Whole (Binary): Fractional: Exponent: Mantissa: IEE 754:Write true if the two statements are equivalent; otherwise write false. (p∨∼q) ∨q and pPlease use C Program In order to discourage excess electric consumption, an electrical company charges its customers a lower rate of P75 for the first 250 kilowatt-hours and a higher rate of P8.5 for each additional kilowatt-hour. In addition, a 10% surtax is added to the final bill. Write a program that calculates the electrical bill given the number of kilowatt-hours consumed as input. At the end, print the number of kilowatt-hours consumed and the computed bill.
- Display the first N magic numbers, where N is a positive number that the user provides as input. Here, a magic number is a number whose sum of its digits eventually leads to 1. For example, 1234 is a magic number because 1 + 2 + 3 + 4 = 10 and 1 + 0 = 1, while 1235 is not (1 + 2 + 3 + 5 = 11 and 1 + 1 = 2). Write a program that prints out the first N magic numbers, seven on each line. You are required to use the following function prototype: bool isMagic(int value); // Returns true if value is a magic number The outline of this function will be as follows: Step 1: Calculate the sum of digits of the value Step 2: Repeat Step 1 until we get a single-digit Step 3: If the resulting sum is equal to 1 then it is a magic number, otherwise not Here is the sample output:C++ Programming Exercise: A real estate office handles, say, 50 apartment units. When the rent is, say, $600 per month, all the units are occupied. However, for each, say, $40 increase in rent, one unit becomes vacant. Moreover, each occupied unit requires an average of $27 per month for maintenance. How many units should be rented to maximize the profit? Write a program that prompts the user to enter: a. The total number of of units. b. The rent to occupy all the units. c. The increase in rent that results in a vacant unit. d. Amount to maintain a rented unit. The program then outputs the number of units to be rented to maximize the profit.6.29 LAB: Max and min numbers C++ Write a program whose inputs are three integers, and whose outputs are the largest of the three values and the smallest of the three values. Ex: If the input is: 7 15 3 the output is: largest: 15 smallest: 3 Your program must define and call the following two functions. The LargestNumber function should return the largest number of the three input values. The SmallestNumber function should return the smallest number of the three input values.int LargestNumber(int num1, int num2, int num3)int SmallestNumber(int num1, int num2, int num3)
- Write true if the two statements are equivalent; otherwise write false. 1. ∼(∼p∨q) and p∨∼q 2. p and ∼(∼p)3. Write a program to take input for a number, if the number is palindrome, then display its half on the screen, otherwise take input for 2 more numbers, and display their product on the screen. Use minimum two functions including main function.Q3, A lecturer intends to separate his students into 2 groups based on their INDEX Numbers, those with odd numbers in group A and EVEN numbers in B. Use if-else statement to implement this. Q4.Your son intends to randomly mention some numbers to you, write a program using While or do-whileloop that will print all the numbers and the sum of the positive numbers.