Q1) Suppose (x1,y1) and (x2,y2) represents left lower corner and right upper corner of a rectangle respectively. Write a C++ program that asked the user to enter x1,y1, x2, and y2 then find out in which quarter this rectangle lies.
Q: 7. Use the structure Distance to write a C++ program that computes the sum of two distances measured…
A: Remember the case where we have inches representation more than 12 in case of adding 2 inches Then,…
Q: Write a single C statement to accomplish each of the following: d) Calculate the remainder after q…
A: Step 1:- Program Approach:- 1.Include header file 2.Declare variables 3.Take the input from the…
Q: a15: Write C++ program to read x and compute sin, cos, and tan of x. Q16: Rewrite the equivalent…
A: NOTE: According to the guidelines, only the first question is answered. 15. sin(x), cos(x) and…
Q: Q7: Write C++ program to evaluate the following logical expression and print out the result If the…
A: According to the question below the Program:
Q: (Electrical eng.) The electrical resistance, r, of a metal wire, in ohms, is given by this formula:…
A: a. The resistance of the wire needs to be calculated. Hence, there will be only one output i.e., the…
Q: Ques 4. Write a C++ code to input two integers max and min from the user and then generate a random…
A: Write a C++ code to input two integers max and min from the user and then generate a random integer…
Q: 5. Write a c++ code to input a number X which represents the number of seconds. Then output the…
A: EXPLANATION - Create a main function . Declare a variable X and take seconds as an input from the…
Q: Q1: Write a C++ program to calculate the diagonal of a rectangle. Users are required to enter the…
A: C++ Code for above : #include <bits/stdc++.h> using namespace std; int main() {…
Q: 15: Write C++ program to read x and compute sin, cos, and tan of x. Q16: Rewrite the equivalent…
A: // C++ program to read x and compute sin, cos, and tax of x. //include header for standard…
Q: Write a program to display the odd numbers which are divisble by 3 also in range given by user. Do…
A: Program Approach - Use the essential header files as per code requirements. Define the function…
Q: State which of the following are true and which are false. If false, explain your answer.c) The…
A: Answer of the given question: The given statement is False The given statement will just print a=…
Q: Q2: Write C program to find and display the value of X in the following equations: X = 7Y + A²
A: Here is Your Code #include <stdio.h>#include<math.h> int main(){ int x,y=2,a=4; x…
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: Find the values of a and b after the following C++ statements: int a = x; a += 5; a += 6; int b =…
A: Given statements: int a = x;a += 5;a += 6;int b = y;b -= 6;b -= 5;
Q: State whether each of the following is true or false. If false, explain why c) The escape sequence…
A: The escape sequence \n when used in a printf format control string causes the cursor to position to…
Q: Q1/ Write a program to enter a value of x and compute the value of y (xif x > 0 (-x if x < 0 Where y…
A: Define variable x and y for user input x ← Take user input if x>=0 y ← x else y ← -x…
Q: 4/A/Design a program to calculate the value of (H) from the equations according to the specified…
A: Here is the code in Python:
Q: 2. Determine the value of variables after executing each of the following C++ Statement. (all…
A: Note: For the programming purpose i have use the demo value x =5 ,y = 6 , z = 7. Program Code…
Q: -Program C 2. Not my Favorites by CodeChum Admin We've already done looping through a series of…
A: Given: -Program C 2. Not my Favorites by CodeChum Admin We've already done looping through a…
Q: 1. The Boston Electric Co. charges for electricity as follows: Kilowatt-hours Cost 1- 50 51-200 P…
A: Algorithm : Step 1 : declare character array. Step 2 : declare variables. Step 3 : ask for the…
Q: The process of finding the largest number (i.e., the maximum of a group of numbers) is used…
A: A C program that inputs a series of "10" numbers and determines and prints the largest of the…
Q: Q2) Write a C++ program to convert the height and weight of a person from feet and pounds units into…
A: We are going to code in C++ to convert the height and weight of a person into meters and kilogram…
Q: B-A- Write a program in C++ to determines the patient if he is infected with corona virus or not…
A: #include<iostream> using namespace std; int main() { string name; int temp;…
Q: Examine the following C++ code and determine the output. int s=0, d, x-42; while (x > 0) { d = x 8…
A: Consider the given code: int s=0,d,x=42; while(x>0){ d=x%10; s=s*10+d;…
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: Practice time!!!! 1. Write a C program that will ask the user to input 20 integers. The program will…
A: Answering one question as per the guidelines. The problem is based on the basics of loops in C…
Q: Write C++ statement(s) to accomplish each of the following tasks: (i) Declare 2 integer variables, x…
A: C++is an operating system which is an open source. It is a software which helps in managing the…
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: 4. Write a program to find out the area of triangle when three sides a, b and c of the triangle are…
A: Program approach: Input side a, b, and c from keyboard. Calculate s. Compute area using hero's…
Q: Examine the following C+ code and determine the output. int a = 5, c = 10; if (a) if (c) %3D if (a -…
A: Answer:a. XZ
Q: HW: Write a C++ program to calculate the value of y form the following equation when C and D are…
A: Code : -- #include <iostream> using namespace std; int main(){ int C,D; // get…
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: 21: Write a C++ program to calculate the diagonal of a rectangle. Users are required to enter Ehe…
A:
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: Write a single C statement to accomplish each of the following: d) If number is not equal to 7,…
A: Q: Write a single C statement to accomplish each of the following: d) If number is not equal to 7,…
Q: Q6: Write C++ program to evaluate the following logical expression and print out the result If the…
A: The answer for the above logical expression will result in False. The reason is : i<=(j*k)…
Q: Examine the following C++ code and determine the output. int a = 5, c = 10; %3D if (a) if (c) if(a -…
A: In this problem, we will examine the given C++ code and determine the ouput.
Q: 5. Write a c++ code to input a number X which represents the number of seconds. Then output the…
A: Define header file <iostream> for i/o operations. Define a function Convert_sec_to_day with…
Q: 1. The Boston Electric Co. charges for electricity as follows: Kilowatt-hours Cost 1 - 50 51-200 P…
A: Algorithm : Step 1: declare character array. Step 2: declare variables. Step 3: ask for the…
Q: C++ Question, Write a Computer Code: Let l be a line in the x-y plane. If l is a vertical line, its…
A: #include <iostream> using namespace std; int main(){ float m,x1,x2,y1,y2,b; cout…
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: Exercise 3: Write a C++ program that asks the user to enter the value for input variables, and…
A: Please find the answer below :
Q: Fill in each blank with the negation of each statement on the left. [(x)b ^ (x)d] xE Vx [p(x)^¬q(x)]…
A:
Q: (c) You are required to create a program that reads a letter of the alphabet from the user. If the…
A: We want to check if the letter input is vowel or not, for y we have added a check, and printed…
Q: Write C code to locate and show the next date given a date (year, month, and day). Consider all…
A: C code to print the next date of the given date #include <stdio.h>#include…
Q: Write a C statement to accomplish each of the following tasks.b) Set variable x to 1
A: Here we have a variable x and it needs to be set to value 1.
Q: Q1. Write a c++ program to calculate the bill after adding sales tax, if the basic cost is input by…
A: As per company guidelines we are suppose to answer only 1 question. Kindly re-post other questions…
C++
Answer quickly please
Step by step
Solved in 3 steps with 1 images
- (General math) If a 20-foot ladder is placed on the side of a building at an 85-degree angle, as shown in Figure 3.11, the height at which the ladder touches the building can be calculated as height=20sin85. Calculate this height by hand, and then write, compile, and run a C++ program that determines and displays the value of the height. After verifying that your program works correctly, use it to determine the height of a 25-foot ladder placed at an angle of 85 degrees.(Electrical eng.) The amplification of electronic circuits is measured in units of decibels, which is calculated as the following: 10LOG(Po/Pi) Po is the power of the output signal, and Pi is the power of the input signal. Using this formula, write, compile, and run a C++ program to calculate and display the decibel amplification, in which the output power is 50 times the input power. Verify your program’s result by doing a hand calculation. After verifying that your program is working correctly, use it to determine the amplification of a circuit, where output power is 4.639 watts and input power is 1 watt.(General math) The perimeter, approximate surface area, and approximate volume of an in-ground pool are given by the following formulas: perimeter=2( length+width)volume=lengthwidthaveragedepthundergroundsurfacearea=2( length+width)averagedepth+lengthwidth Using these formulas as a basis, write a C++ program that accepts the length, width, and average depth measurements, and then calculates the pool’s perimeter, volume, and underground surface area. In writing your program, make these two calculations immediately after entering the input data:lengthwidthandlength+width. The results of these two calculations should be used as needed in the assignment statements for determining the perimeter, volume, and underground surface area without recalculating them for each equation. Verify your program’s results by doing a hand calculation, using the following test data :length=25feet,width=15feet,andaveragedepth=5.5feet. After verifying that your program is working, use it to complete the following chart:
- General math) a. Write a C++ program to calculate and display the midpoint coordinates of the line segment connecting the two endpoints given in Exercise 1a. Use the fact that the coordinates of the midpoint between two points with the coordinates x1,y1)and(x2,y2)are((x1+x2)/2,(y1+y2)/2). Your program should produce the following display (replacing the underscores with values your program calculates): ThexmidpointcoordinateisTheymidpointcoordinateis b. How do you know the midpoint values your program calculates are correct? c. After verifying the output your program produces, modify it to determine the midpoint coordinates of the line connecting the points (2,10) and (12,6). d. If your program doesn’t already do so, change its output to this: The x coordinate of the midpoint is xxx.xx The y coordinate of the midpoint is xxx.xx The xxx.xx denotes placing the calculated value in a field wide enough for three places to the left of the decimal point and two places to the right of it.(Electrical eng.) a. The voltage gain of an amplifier is given by this formula: voltagegain=[275 23 2 +0.5 f 2 ]n f is the frequency in Hz. n is the number of stages in the amplifier. Using this formula, write, compile, and run a C++ program to determine the value of the voltage gain for a four-stage amplifier operating at a frequency of 120 Hz. Your program should produce the following display: At a frequency of xxxxx hertz, the voltage gain is yyyyy Your program should replace xxxxx with the frequency and yyyyy with the voltage gain. b. Manually check the value your program produces. After verifying that your program is working correctly, modify it to determine the voltage gain of a 12-stage amplifier operating at a frequency of 9500 Hz.(General math) Write, compile, and run a C++ program to calculate the distance between two points with the coordinates (7, 12) and (3, 9). Use the fact that the distance between two points with the coordinates (x1, y1) and (x2, y2) is given by this formula: distance=(x2+y2) After verifying that your program works correctly by calculating the distance between the two points manually, use your program to determine the distance between the points (-12, -15) and (22, 5).
- (Acoustics) The loudness of a sound is measured in units of decibels and is calculated as shown: 10LOG(SL/RL) SL is the intensity of the sound being measured. RL is a reference sound-intensity level. Using this formula, write a C++ program that calculates and displays the decibel loudness of a busy street having a sound intensity of 10,000,000 RL. Verify your program’s result by doing a hand calculation. After verifying that your program is working correctly, use it to determine the sound level in decibels of the following sounds: a.Awhisperatsoundintensity200RLb.Arockbandplayingatsoundintensity1,000,000,000,000RLc.Anairplanetakingoffatsoundintensity100,000,000,000,000RLWrite a statement (or comment) to accomplish each of the following: c) Define the variables x, y and z to be of type int(Physics) a. The weight of an object on Earth is a measurement of the downward force onth e object caused by Earth’s gravity. The formula for this force is determined by using Newton’s Second Law: F=MAeFistheobjectsweight.Mistheobjectsmass.AeistheaccelerationcausedbyEarthsgravity( 32.2ft/se c 2 =9.82m/ s 2 ). Given this information, design, write, compile, and run a C++ program to calculate the weight in lbf of a person having a mass of 4 lbm. Verify the result produced by your program with a hand calculation. b. After verifying that your program is working correctly, use it to determine the weight, on Earth, of a person having a mass of 3.2 lbm.
- (Physics) The maximum height reached by a ball thrown with an initial velocity, v,inmeters/sec,atanangleof is given by this formula: height=(.5v2sin2)/9.8 Using this formula, write, compile, and run a C++ program that determines and displays the maximum height reached when the ball is thrown at 5 mph at an angle of 60 degrees. (Hint: Make sure to convert the initial velocity into the correct units. There are 1609 meters in a mile.) Calculate the maximum height manually, and verify the result your program produces. After verifying that your program works correctly, use it to determine the height reached by a ball thrown at 7 mph at an angle of 45 degrees.(General math) a. Design, write, compile, and run a C++ program that calculates and displays the area of a triangle, such as the one in Figure 2.18, with a base of 1 in and a height of 1.5 in. The area is given by this formula: Area=12(base)(height) b. Manually check the values computed by your program. After verifying that your program is working correctly, modify it to determine the area of a two-dimensional triangle with a base of 3.5 in and a height of 1.45 in.(General math) The volume of oil stored in an underground 200-foot deep cylindrical tank is determined by measuring the distance from the top of the tank to the surface of the oil. Knowing this distance and the radius of the tank, the volume of oil in the tank can be determined by using this formula: volume=radius2(200distance) Using this information, write, compile, and run a C++ program that accepts the radius and distance measurements, calculates the volume of oil in the tank, and displays the two input values and the calculated volume. Verify the results of your program by doing a hand calculation using the following test data: radius=10feetanddistance=12feet.