Question

Create a C++ program that solves the following equations: R = A + B * C...

Create a C++ program that solves the following equations: R = A + B * C - D + E

Print the values of R, A, B, C, D, and E.

Example output:

Enter a value for A: 10

Enter a value for B: 3

Enter a value for C: 2

Enter a value for D: 2

Enter a value for E: 10

The values entered are: A: 10 B: 5 C: 15 D: 2 E: 10 R = 26

Note: Your program should read values using cin

0 0
Add a comment Improve this question Transcribed image text
Answer #1
#include <iostream>

using namespace std;

int main() {
    double R, A, B, C, D, E;
    cout << "Enter a value for A: ";
    cin >> A;
    cout << "Enter a value for B: ";
    cin >> B;
    cout << "Enter a value for C: ";
    cin >> C;
    cout << "Enter a value for D: ";
    cin >> D;
    cout << "Enter a value for E: ";
    cin >> E;

    R = A + B * C - D + E;

    cout << "The values entered are: A: " << A << " B: " << B << " C: " << C << " D: " << D << " E: " << E
         << " R = " << R << "" << endl;
    return 0;
}
Add a comment
Know the answer?
Add Answer to:
Create a C++ program that solves the following equations: R = A + B * C...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a C++ program to read in 4 different types of data values using cin, cout,...

    Write a C++ program to read in 4 different types of data values using cin, cout, and the getline() function and display the values in the same order to the screen. Use cin to read in the first value and getline() to read in the remaining characters. Note that the 4 data items are entered on 1 line. The following shows a sample run of the program. Enter 4 data values: 45 abc 12.34 d The 4 data values entered...

  • Create a complete pseudo-code program in C++ to do the following using the PseudoCode language developed...

    Create a complete pseudo-code program in C++ to do the following using the PseudoCode language developed in class using Absolute Addressing. There is 1 deliverable: 1. You should include the input cards shown below as a test. THE PROGRAM: First you will read in a value N which holds the number of values to be read in. (so if N is 20 then there will be 20 more cards to read in.) Read in N values into an array. Bubble-Sort...

  • This C++ Programs should be written in Visual studio 2017 PROGRAM 1: Comparing Using Arrays to...

    This C++ Programs should be written in Visual studio 2017 PROGRAM 1: Comparing Using Arrays to Using Individual Variables One of the main advantages of using arrays instead of individual variables to store values is that the program code becomes much smaller. Write two versions of a program, one using arrays to hold the input values, and one using individual variables to hold the input values. The programs should ask the user to enter 10 integer values, and then it...

  • Coding in C# please Develop the C# program for the following problems: 1. Create a new...

    Coding in C# please Develop the C# program for the following problems: 1. Create a new class and name it as Conversion. 2. In this class, provide the code that uses a for or while loop to display a table that lists values for some unit and the equivalent in two other units. . Enter a start value, and end value and a step value as a range of values for the unit to be converted, . Show three columns...

  • Create a program that solves programming exercise below. Within this folder is the file state_capitals.txt. The...

    Create a program that solves programming exercise below. Within this folder is the file state_capitals.txt. The file is organized with a state name on a line and the next line has its capital. Your program should read this in and create a dictionary from this file. Then use this dictionary to create a quiz, ask the user for 5 random choice states and give the results back at end. Write a program that creates a dictionary containing the U.S. States...

  • I have this c++ program that i have to create but i am stuck on it....

    I have this c++ program that i have to create but i am stuck on it. Write a height conversion program that shall allow user to convert from feet and inches to meters (option 1) and vice versa (option 2). User shall be able to specify the type of conversion (a menu of two options). Display an error message if an invalid option is specified. Otherwise, the program would read in a length in feet and inches (two separate integer...

  • in C++ Extract and Add a Series of Numbers: Write a program that will extract a...

    in C++ Extract and Add a Series of Numbers: Write a program that will extract a series of numbers (type double) from an input sentence and then add them. EXAMPLE: Suppose the sentence entered is “Give me the sum of 25.25 and 13.50. ”The program should print to the screen: The sum = 38.75 NOTE: The numbers can be of any value. Don’t hard code to the values shown in the example. In this problem take advantage of the input...

  • /* C++ program that prompts the user to enter the name of the student, enter the...

    /* C++ program that prompts the user to enter the name of the student, enter the five scores values. Then calculate the total scores of the student. Then finally calculate the average score of the total score value. Then, print the name, total score , average scrore value on console output. */ //main.cpp //include header files #include<iostream> #include<string> #include<iomanip> using namespace std; //start of main function int main() {    //declare variable to read string value    string studentName;   ...

  • using c++ 2. Write a program to read 3 integers a, b and c, your program...

    using c++ 2. Write a program to read 3 integers a, b and c, your program should print all factors of the integer c that exists between a and b. (a factor is an integer which evenly divides a number without leaving a remainder). Example: if a J 2, b 20 and c -30 then the factors of 30 between 2 and 20 are 2, 3, 5,6,10 and 15. CA. C Windows system32\cmd.exe an C: 2 20 30 Enter a,...

  • C++ please no arrays! Create a program that will allow the user to enter up to...

    C++ please no arrays! Create a program that will allow the user to enter up to 50 whole values and determine the number of values entered, how many of the values were odd and how many of the values were even. Your code should contain 2 functions, a main function and a function to enter the numbers enter and count the values. Your main function should be a driver program that will call another function to count the total number...

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