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
- The State Department of Motor Vehicles (DMV) has asked you to write a program that grades the written portion of the ‘n’ drivers’ license exam, which has ‘m’ multiple choice questions. A correct answer has 2 marks and a wrong answer has -1 mark. There is no mark if the question is unanswered. Write a C program to read the answers of ‘n’ candidates and print the total score of each candidate.Consider the simple electric circuit above. Write a C program that calculates the current through each resistor. The code must use a constant for the voltage and arrays for the resistor and current values. The program prints each current value for each resistor on a new line in the format: "I1 = x.xx", etc. Ohm's Law states: I=V/R Complete the following C program using the code provided to match the correct lines of code in the correct order to create the C program. //Line 1 //Line 2 //Line 3//Line 4//Line 5 //Line 6//Line 7//Line 8//Line9//Line 10 -//Line 1 -//Line 2 -//Line 3 -//Line 4 -//Line 5 -//Line 6 -//Line 7 -//Line 8 -//Line 9 -//Line 10 1. #include <stdio.h> 2. printf("I%d = %.2f\n", i+1, currArray[i]); 3. void main(char argc, char **argv) 4. currArray[i] = (float)VOLTAGE/resistArray[i]; 5. float currArray[4], resistArray[4] = {10, 20, 30, 40}; 6. for (int i = 0; i < 4; i++) ; 7. int currArray[4], resistArray[4] = {10, 20, 30, 40}; 8. while…(Practice) Write a C++ program that accepts the rectangular coordinates of two points (x1,y1)and(x2,y2), calculates the distance of each point from the origin, and calculates the distance between the two points. The distance, d, between two points is given by this formula: d=(x2x1)2+(y2y1)2
- Using C++ Program, please help me code this problem. The utilities commission has decided that the electric company overcharged its customer for 2 months last year. To make up the difference to the customers, the commission orders the company to decrease each of next month’s bill by 10%. The city also levies a 3% utility tax, which is to be applied to the bill before it is discounted. Also, the 10% discount does not apply to the utility tax. Assume electricity costs 25.50 per kilowatt. Create the program to compute for next month’s electricity bill.For the program below, assume that a point on a Cartesian plane comprises values representing x and y coordinates. The distance between two points in a Cartesian plane can be calculated using the formula derived from d=√((x2-x1)²+(y2-y1)²). Write a C++ program that prompts a user to input two points on the Cartesian plane and works out the distance between them. Use comments in your code, highlight how you have used the following concepts of C++ : class, object, constructors and destructors.create a c++ program: Given TWO SIDES and an OPPOSITE ANGLE, find the missing side and two missing angles with this given situation (see image below): ps: Let a and b the two given sides & A be the given angle opposite side A. pps: use beginner code only.
- I need help writing a C++ code. I need the code to show the current rate for a country club prices. The starting Prices start at 3000 for a year and raise 3% each year for 5 years. I need a program that will loop to display the projected rates for each of the next 5 years.Create a c++ program that asks the user to enter all of his 3 quizzes during the preliminary coverage. The program would then compute the average of these 3 quizzes. Afterwards, the program would ask the user again to enter 3 quizzes for his/her midterm coverage. The program again would compute the average for the quizzes for the midterm coverage. Use the math function max() to find out which of the two average grades are highest. Example: Please enter 1st prelim quiz: ____ Please enter 2nd prelim quiz: ___ Please enter 3rd prelim quiz: ___ Please enter 1st midterm quiz: ____ Please enter 2nd midterm quiz: ____ Please enter 3rd midterm quiz: ____ The average of your quizzes in prelims and midterms are: 93 for prelims and 97 for midterms. 97This is a C program. I want you to convert it to a C++ program. Also provide a screenshot that it is still working.Here is the program to be converted: /* Write a program that will compute and display sales commission ofa Sales Representative given as input his total sales. The sales commissionis computed as 15% of the total sales. Moreover, a bonus of 1000.00 is givenif the computed sales commission exceeds 20,000.00. */ #include <stdio.h>#include <conio.h>int main(){ float TS,SC; clrscr(); printf("Enter your Total Sales: Php "); scanf("%f",&TS); SC=TS*0.15; if (SC<=20000.00) printf("The Sales Commission is Php %0.2f\n",SC); else { printf("For Exceeding Php 20000.00 Sales Commission\nYou are entitled for Php 1000.00 bonus!!!\n\n"); SC=SC+1000.00; // SC+=1000.00 printf("Your Total Sales Commission is Php %0.2f\n",SC); } getch(); return(0);}
- This is a C program. I want you to convert it to a C++ program. Also provide a screenshot that it is also working.Here is the program to be converted: /* Write a program that will compute and display sales commission ofa Sales Representative given as input his total sales. The sales commissionis computed as 15% of the total sales. Moreover, a bonus of 1000.00 is givenif the computed sales commission exceeds 20,000.00. */ #include <stdio.h>#include <conio.h>int main(){ float TS,SC,TSC; clrscr(); printf("Enter your Total Sales: Php "); scanf("%f",&TS); SC=TS*0.15; if (SC>20000.00) { printf("For Exceeding Php 20000.00 Sales Commission\nYou are entitled for Php 1000.00 bonus!!!\n\n"); TSC=SC+1000.00; // SC+=1000.00 printf("Your Sales Commission of Php %0.2f with the bonus of Php 1000.00 totals to Php %0.2f\n",SC,TSC); } else printf("The Sales Commission is Php %0.2f\n",SC); getch(); return(0);}Write the c program that displays the water invoice price on the screen as follows, according to the first and last indicator values entered from the keyboard. (The price per cubic meter of water is 0.912857 TL.) SAMPLE WORK :: Enter the first indication: 838 Enter the last indicator: 859 ------------------------- Consumption amount: 21 Consumption amount: 19.17 Wastewater price (50 percent): 9.58 ------------------------- TOTAL: 28.75 TL make it fastPlease 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.