Write a C++ program to calculate and display the midpoint coordinates of the line connecting the two points with coordinates of (3,7) and (8,12)
Q: (f) Write a C program to input the stress and strain from the user and print Elastic potential…
A: Write a C program to input the stress and strain from the user and print Elastic potential energy…
Q: A function is defined as f(y) = f(y-2) + 2y ,f(0) = 11, f(1) = 10. Write a C program to find the…
A: A function is defined as f(y) = f(y-2) + 2y2 ,f(0) = 11, f(1) = 10. Write a C program to find the…
Q: 3. Write program in c++ to compute the value of z from the following equation: Z= x-y'+3.
A: Solution: Approach: Include necessary header files In the main function declare the variables of…
Q: Question 1: Write a C++ program to read a number from the user and print whether it is zero,…
A: #include <iostream> using namespace std; int main(){ int num; //to initilize an…
Q: (c) Write a C program to compute van der Waals' gas constants a and b.
A: In this question we need to create a C program to compute Van der Waals' gas constants a and b.…
Q: Write a C++ program to calculate the sum and average of six student's degrees and print the…
A: We need to read in 6 student grades and then we compute the sum , average then determine the result
Q: 4. Write a C program to input the coefficients a,b, and c of the equation ax2 + bc + c = 0 and then…
A: Write a C program to input the coefficients a,b, and c of the equation ax2 + bc + c = 0 and then…
Q: You have to make aC Program to Convert Celsius from Fahrenheit, Kelvin and Réaumur or to Convert…
A: As per the question statement, we will write program in c language.
Q: Write a C++ program to develop following shapes or pattern by using nested loop. Give source code…
A: According to the guideline, I can answer only one question. I am printing the shape of a hollow half…
Q: Write a C++ program that accepts a number followed by one space and then a letter. If the letter…
A: #include <iostream>using namespace std; int main() { double t, t2; char c; cout <<…
Q: Write a C++ program that prompts the user to enter two integer numbers and the program should print…
A: Algorithm : - we will convert the inputed number to string - we will store the index of largest…
Q: = Write a C++ program, using function, to evaluate the following equation: z= (x! - y!)/ (x-y)!
A: C++ program using functions to evaluate the equation z = (x! -y!) /(x-y)!
Q: 4. Write a C++ program to calculate the value of distance, in miles, given this relationship:…
A: #include <iostream>using namespace std;int main(){ double…
Q: d) Write a C program to print all the multiples of x in the range 1 to y, where X,y are two positive…
A: Coded using C language.
Q: Write a C++ program that computes the shaded area in the figure below using the function carea().…
A: To compute shaded area, logic is to subtract smaller area from bigger area . Enter two radius by…
Q: Write C++ program to compute the following equation: y-3 sin(x) if x>0 tan if x = 0 x + (5x) 2- 10…
A: Sample Response: //C++ program to find the value of Y for given equation Y =…
Q: Write a C++ program to input Length and Width of two squares and print the Area and Circumference of…
A: The problem is based on finding the area and circumference of the squares using functions.
Q: Q1: Write a C++ program to find the value of Z from the following equation using function x2 Z=20 +…
A: Objective: This program will calculate the value for a given polynomial function for n term. The…
Q: Question 3) Write a C program to take input two integers x,y from the user and compute the value of…
A: Write a C program to take input two integers x,y from the user and compute the value of t1 and t2…
Q: Write a C program to accept a coordinate point in a XY coordinate system, determine in which…
A: #include <stdio.h> #include <math.h> int main(){int x,y;float…
Q: Create a C program that will dispay centimeters to inches conversion table. - The smallest and…
A: Answer : Centimeter to inches Conversion: #include<stdio.h>int main(){ int small,large;…
Q: You have to create a program in C language in which the user enters the mass mand radius R of a…
A: Introduction: A physical quantity that quantifies a body's resistance to having its speed of…
Q: FOR C++ PROGRAM, PLEASE WRITE THE CODE IN 15 MINUTES ! Write a function that draws a square as…
A: As given, I need to write a C++ program having a function that prints the given square pattern. I…
Q: 1- Write a c++ program to print the output of the following equation: y= -x+x? - x3+ x* +x"
A: According to the guidelines we are allowed to answer only the first question. Please ask the other…
Q: 4. Write a C program in which the user can input the radius of two soap bubbles in contact and the…
A: Write a C program in which the user can input the radius of two soap bubbles in contact and the…
Q: Question 4) Write a C program to take input two integers x,y from the user and compute the value of…
A: Write a C program to take input two integers x,y from the user and compute the value of t1 and t2…
Q: Write C program to calculate A value from the equation below. Then, round it to the nearest integer…
A: Here, first you need to include one header file i.e (#include<math.h>) After that, declare 3…
Q: Write a C program to enter two float numbers and use two functions in the same program : ( i ) one…
A: Here let's use call by value method in the function.
Q: The circuit above represents a non-inverting amplifier with input, V₁ and output, V₁. A dc lamp,…
A: Program Plan: Initialize Vl, Il, R1 and R2. Declare Rl, flag, and ratedCurrent to 220, false, and…
Q: Please in C#, Create a program that generates a Frequency Distribution Table, compute and display…
A: Different count variables are taken to find frequency of different characters in a given line of…
Q: Write a C program to input electricity unit charges and calculate total electricity bill according…
A: Answer :
Q: Write a C++ program that prompts the user to enter two integer numbers and the program should print…
A: The [program is implemented in C++ with procedural approach. Following is the program algorithm Ask…
Q: Write a C program to accept a coordinate point in a XY coordinate system and determine in which…
A: #include <stdio.h> int main(){ int x , y; printf("Test Data : "); scanf("%d %d",…
Q: Write a c program to calculate velocity of a car when distance and time are given by the user.
A: C program to calculate the velocity of a car. Prompt the user to enter the distance. Prompt the user…
Q: Write a C++ program that prompts the user to enter two integer numbers and the program should print…
A: According to the Question below the program: Program Output:
Q: You have to create a program in C language in which the user enters the mass m and radius & of a…
A: Introduction: The program can be coded in C language. For that we need to know the formula of:…
Q: Q3) Write a C++ program to calculate Z and display the result where: x >-0 2y+3 Z= x<0 4w-1
A: Algorithm: Start Read x value If x>=0, read y value and set Z=2*y+3 Else read w value and set…
Q: b) Write a program in C++ to evaluate the following expression where X=2.5: Y = 2X^3 +5
A: Initialize the variable X. Calculate the value of expression Y. Finally, print the result.
Q: you have to create a program in C language in which the woen entero the mass M and radiws ł of a…
A: Algorithm: 1. Read mass, m. 2. Read radius, r. 3. moment_of_inertia = (m * r * r) / 2. 4. Print…
Q: Write a C++ program that calculates the Diagonal of a Square. The main function asks the user to…
A: Diagonal of a Square=side* square root of 2 Algorithm 1. In main take side length of square from…
Q: PROBLEM 5. Write a C++ program that would output the following series numbers. OUTPUT: 1, 2,…
A: Here we have given a series , i.e. 1, 2, 4, 7, 11, 16, 32, 39, 47, 56, 66We have asked to write C++…
Q: 3) Write a C++ program that stores the variable length and the variable width. Have your program…
A: Algorithm: 1. Start. 2. Read the value for length and width variable. 3. Calculate the value for…
Q: 2. Write a C++ program to print all numbers from (1-100) except the multiples of three, where each 7…
A: Answer Code in C++ #include <iostream> using namespace std; int main() { int count = 0;…
Q: Using function(s), write a C++ program that computes the positive and negative sums of a set of…
A: We have to ask the user 5 numbers and and then find the average of positive and negative number and…
Q: Write a C Program that calculate the following equations and display the value for x, y and z in…
A: Solution: code: #include<stdio.h> #include<conio.h> void main { float x, y, z;…
Q: Write a C program to take input for a number, if the number is palindrome, then display its half on…
A: Lets see the solution.
c . Write a C++ program to calculate and display the midpoint coordinates of the line connecting the two points with coordinates of (3,7) and (8,12). Use the fact that the midpoint coordinates between two points with the coordinates (x1,y1) and (x2,y2) are ((x2 + x1) / 2, (y2 + y1) / 2). Your program should produce this display:
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.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
- (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).(General math) a. Write a C++ program to calculate and display the value of the slope of the line connecting two points with the coordinates (3,7) and (8,12). Use the fact that the slope between two points with the coordinates (x1,y1)and(x2,y2)is(y2y1)/(x2x1). b. How do you know the result your program produced is correct? c. After verifying the output your program produces, modify it to determine the slope of the line connecting the points (2,10) and (12,6). d. What do you think will happen if you use the points (2,3) and (2,4), which results in a division by zero? How do you think this situation can be handled? e. If your program doesn’t already do so, change its output to this: The value of the slope 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.2. Write a C++ program that accepts a number followed by one space and then a letter. If the letter following the number is an f, the program should treat the number entered as a temperature in degrees Fahrenheit, convert the number to the equivalent degrees Celsius, and print a suitable display message. If the letter following the number is a c, the program should treat the number entered as a temperature in Celsius, convert the number to the equivalent degrees Fahrenheit, and print a suitable display message. If the letter is neither an f or c, the program should print a message that the data entered is incorrect and then terminate. Use an if-else chain in your program and make use of the conversion formulas: Celsius = (5.0/9.0) *(Fahrenheit – 32.0)Fahrenheit = (9.0/5.0) * Celsius + 32.0)
- Q1. Write a program in C++ language to obtain the equation below, for values of x from (1 - 20), by using for statement: 2 X e Y= —+cosix— VX+ — 4 Ix|Write a C++ program that calculates the Volume of a Triangular Prism. The main function asks the user to input a (i.e., length of the triangular prism), b(i.e., base length of the triangular prism), and h(i.e., the height of the triangular prism. Then the main function calls another function to calculate the volume of that triangle prism. Finally, the main function displays the volume of the triangle prism. Recall that Volume of a Triangular Prism =1/2 abhWrite a c program to calculate velocity of a car when distance and time are given by the user.
- Write a complete C program that prompts the user for the coordinates of two 3- D points ( x1 , y1 , z1 ) and ( x2 , y2 , z2 ) and displays the distance between them computed using the following formula:You will develop a c++ program to find all prime numbers in the range specified by the user. For instance, the execution of your program should look like the following: Enter the range to find all prime numbers in that range: 10 20 111317 19Write a C++ program to compute the surface-area of a cylinder, given the radius (R) and the height (H). The program must ask the user to enter R and H. It then prints the surface-area with a proper message in the main program. Define a function to compute the surface-area and let main() call it. Clearly show the function prototype. This function takes the radius R and height H as parameters and returns the surface area. The formula for computing the surface-area of a cylinder is 2πR(H + R), where ? = 3.141 Write a function called isValidLength that takes an integer number and returns true if the number has a valid length and false otherwise. Valid- length is determined by finding number length. If the length is at least 3 digits and at most 5 digits, then the number has a valid length. For example, the number 324 is valid because it's 3 digits long and the number 22 is invalid because it’s 2 digits long. Write a function called isValidDigits that takes an integer…
- PROBLEM 5. Write a C++ program that would output the following series numbers. OUTPUT: 1, 2, 4, 7, 11, 16, 32, 39, 47, 56, 66Write a C++ program that will print out the following simple shapes: triangle, rectangle and diamond using different characters for each shape. Requirements:- each shape uses a different character and it must be exactly 5 lines.- for this exercise, please do not use loop but only simple printing characters.Write a C++ program that calculates the Diagonal of a Square. The main function asks the user to input the side length of the Square (i.e., a). Then the main function calls another function to calculate the Diagonal of that Square. Finally, the main function displays the Diagonal of Square. Recall that DiagonalofaSquare=a square root of 2