Question

Part A) Write a C++ program that calculates the area under a curve. Here is the...

Part A) Write a C++ program that calculates the area under a curve. Here is the equation: f(x) = x^2 +1.5x +4 You must prompt the user for the beginning and the ending x values. You are to assume, but not check, that the user will put in whole positive numbers. The units are inches. The program input/output should look something like this: This program calculates the area under a curve between two points on the x axis. The equation is: XXXXXXXX Please Enter the min x value: Please Enter in the max x value: The area under the curve between ‘min x’ and ‘max x’ is: ‘total’ square inches. You should calculate the area using the basic “rectangular slice” method. Set your x axis intervals at 1 inch. For example, if the user input the x range from 1 inch to 4 inches, you would have three x ranges: from 1 to 2, from 2 to 3 and 3 to 4 in which you calculate the area and make a sum of the total.

PART B) Here is a second equation: f(x) = x^2 + 1.5x – 4 Program this equation in addition to the first.

PART C) Prompt the user for how many segments the x axis should be divided into. Ie., if the user sets the x axis range from 3” to 8”, part A and B would divide it into five segments. Now you prompt the user for how many segments should be used and do the proper calculations. I need help only for part c.

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Part A) Write a C++ program that calculates the area under a curve. Here is the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • #include <iostream> #include <math.h> using namespace std; float f1(int low,int up) { int i,total=0.0; for(i=low;i<=up;i++) {...

    #include <iostream> #include <math.h> using namespace std; float f1(int low,int up) { int i,total=0.0; for(i=low;i<=up;i++) { total=total+(i*i+i*1.5+4); } return total; } float f2(int low,int up) { int i,total=0.0; for(i=low;i<=up;i++) { total=total+(i*i+i*1.5-4); } return total; } int main() { int low,up; cout << "This program calculates the area under a curve between two points on the x axis\n"; cout<< "\nThe FIRST equation is: f(x)=x^2 +1.5x +4"; cout<< "\nThe SECOND equation is: f(x)=x^2 +1.5x -4"; cout << "\nEnter x's minimum value :...

  • In C please! Thank you! Write a program that finds the smallest (min), largest (max), and...

    In C please! Thank you! Write a program that finds the smallest (min), largest (max), and average (mean) of N values entered by the user. Your program should begin by prompting the user for N, the number of values to be entered. Then the program should accept that number of values, determining the min, max, and mean. Then it should display those values. This is an extension of a previous lab. First, get it working for N values. Then, extend...

  • #1 Write a java program which calculates the area of either a Triangle or a Rectangle....

    #1 Write a java program which calculates the area of either a Triangle or a Rectangle. Use Scanner to take an input field to tell you if the area to be calculated is for a Triangle or is for a Rectangle. Depending on that input - the program must call either the Triangle method or the Rectangle method. Each of those methods must receive 2 input fields from the user - one for base and one for height in order...

  • C++ Pr ogramming (CSC-115) Functions (pass by Reference) Programming project Using FUNCTIONS, write a C++ program...

    C++ Pr ogramming (CSC-115) Functions (pass by Reference) Programming project Using FUNCTIONS, write a C++ program that calculates the Area of a cirele, a square and a rectangle. Your program must prompt the user to select which area is to be calculated. Document your program. Apply the do while loop to repeat the program Apply the while loop for input validation. Apply the switch statements or the if/ else if statement to prompt the user for the area's selection. Based...

  • in java plz 8.13 LAB 3e: Calculate Energy (1) Write a program that calculates the energy...

    in java plz 8.13 LAB 3e: Calculate Energy (1) Write a program that calculates the energy needed to heat water from an initial temperature to a final temperature. Your program should prompt the user to enter the amount of water in kilograms and the initial and final temperatures of the water. The formula to compute the energy Q = M * (finalTemperature - initialTemperature) * 4184 where Mis the weight of water in kilograms, initial and final temperatures are in...

  • Write a single C++ program that performs the following conversion (The modulus divide will help you...

    Write a single C++ program that performs the following conversion (The modulus divide will help you get the remainder as shown in class) 39 / 12 = 3 and 39 % 12 = 3, so 3 feet 3 inch(es) Height conversion 1 meter = 39 inches 12 inches = 1 foot Ask/Prompt the user to enter in the height in meters, convert and output the result in feet and inches Example 1 meters as input should produce 3 feet (foot)...

  • Write a JavaScript program to calculate Area of a trapezoid Equation: Area = (top side +...

    Write a JavaScript program to calculate Area of a trapezoid Equation: Area = (top side + bottom side) * height / 2 1. Use prompt() function to take top side, bottom side, and height values from user 2. For validation, if user did not put in a number, your program must send out 3. "Input must be number" error message using alert() function. 4. If user put in all numbers, use alert() function to output correct answer

  • Write a JavaScript program to calculate Area of a trapezoid Equation: Area = (top side +...

    Write a JavaScript program to calculate Area of a trapezoid Equation: Area = (top side + bottom side) * height / 2 1. Use prompt() function to take top side, bottom side, and height values from user 2. For validation, if user did not put in a number, your program must send out 3. "Input must be number" error message using alert() function. 4. If user put in all numbers, use alert() function to output correct answer

  • C++ Please Follow Instructions Write a program that displays an inches to centimeters conversion table. Your...

    C++ Please Follow Instructions Write a program that displays an inches to centimeters conversion table. Your input will be the smallest number of inches and the largest number of inches to be converted. The intervals will be in 6 inch increments. One inch is equivalent to 2.54 centimeters. Include the following in your program: 1. Include an initial algorithm that outlines your steps. 2. Include a refined algorithm that details how each step will be executed. 3. Prompt the User...

  • Write a shell script that given a radius, calculates the area of a circle. (Hint –...

    Write a shell script that given a radius, calculates the area of a circle. (Hint – don’t write this from scratch. Find another script that reads user input and performs a calculation, then modify it to meet your needs.) Save the script in your home directory with the name circle.sh The formula for calculating the area is: Area=Π*Radius2 You can use 3.14 for Π, and either do Radius*Radius or Radius^2 to get the square of the radius. Use the scale...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT