Question

In: Computer Science

In c++   Design and implement a programming (name it SimpleMath) that reads two floating-point numbers (say...

In c++   Design and implement a programming (name it SimpleMath) that reads two floating-point numbers (say R and T) and prints out their values, sum, difference, and product on separate lines with proper labels. Comment your code properly and format the outputs following these sample runs.

Solutions

Expert Solution

//C++ code

#include<iostream>
using namespace std;

//Entry point
int main()
{
   /* reads two floating-point numbers*/
   cout << "Enter first number: ";
   float num1;
   cin >> num1;
   cout << "Enter second number: ";
   float num2;
   cin >> num2;
   /* prints out their values, sum, difference,
   and product on separate lines with proper labels*/
   cout << "The sum of " << num1 << " and " << num2 << " is : " << (num1 + num2) << endl;
   cout << "The difference of " << num1 << " and " << num2 << " is : " << (num1 - num2) << endl;
   cout << "The product of " << num1 << " and " << num2 << " is : " << (num1 * num2) << endl;
   //pause
   system("pause");
}

//Output

//If you need any help regarding this solution ......... please leave a comment........ thanks


Related Solutions

IN C++ PLEASE!!! Design and implement a programming (name it SimpleMath) that reads two floating-point numbers...
IN C++ PLEASE!!! Design and implement a programming (name it SimpleMath) that reads two floating-point numbers (say R and T) and prints out their values, sum, difference, and product on separate lines with proper labels.
USING C# Design and implement a program (name it SumValue) that reads three integers (say X,...
USING C# Design and implement a program (name it SumValue) that reads three integers (say X, Y, and Z) and prints out their values on separate lines with proper labels, followed by their average with proper label. Comment your code properly.Format the outputs following the sample runs below. Sample run 1: X = 7 Y = 8 Z = 10 Average = 8.333333333333334
In C++ Design and implement a program (name it ProcessGrades) that reads from the user four...
In C++ Design and implement a program (name it ProcessGrades) that reads from the user four integer values between 0 and 100, representing grades. The program then, on separate lines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Format the outputs following the sample runs below.
Using C# Design and implement a program (name it ProcessGrades) that reads from the user four...
Using C# Design and implement a program (name it ProcessGrades) that reads from the user four integer values between 0 and 100, representing grades. The program then, on separate lines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Format the outputs following the sample runs below. Sample run 1: You entered:   95, 80, 100, 70 Highest grade:100 Lowest grade:  70 Average grade:86.25
PLEASE DO THIS IN C#Design and implement a programming (name it NextMeeting) to determine the day...
PLEASE DO THIS IN C#Design and implement a programming (name it NextMeeting) to determine the day of your next meeting from today. The program reads from the user an integer value representing today’s day (assume 0 for Sunday, 1 for Monday, 2 for Tuesday, 3 for Wednesday, etc…) and another integer value representing the number of days to the meeting day. The program determines and prints out the meeting day. Format the outputs following the sample runs below. Sample run...
I need this in C# with pseudocode Exercise #2: Design and implement a programming (name it...
I need this in C# with pseudocode Exercise #2: Design and implement a programming (name it EvenOdd) that uses a while loop to determine and print out all even numbers between 50 and 100 on a single line, separated by commas. Then another while loop in the same program to print out all odd numbers between 50 and 100 on a new line, separated by commas. Document your code and properly label the outputs as shown below. Even numbers between...
I need this in C# please. Exercise #2: Design and implement a programming (name it NextMeeting)...
I need this in C# please. Exercise #2: Design and implement a programming (name it NextMeeting) to determine the day of your next meeting from today. The program reads from the user an integer value representing today’s day (assume 0 for Sunday, 1 for Monday, 2 for Tuesday, 3 for Wednesday, etc…) and another integer value representing the number of days to the meeting day. The program determines and prints out the meeting day. Format the outputs following the sample...
PLEASE DO THIS IN JAVA!Design and implement a programming (name it NextMeeting) to determine the day...
PLEASE DO THIS IN JAVA!Design and implement a programming (name it NextMeeting) to determine the day of your next meeting from today. The program reads from the user an integer value representing today’s day (assume 0 for Sunday, 1 for Monday, 2 for Tuesday, 3 for Wednesday, etc…) and another integer value representing the number of days to the meeting day. The program determines and prints out the meeting day. Format the outputs following the sample runs below. Sample run...
In C ++, Design and implement a program that reads from the user four integer values...
In C ++, Design and implement a program that reads from the user four integer values between 0 and 100, representing grades. The program then, on separate lines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Format the outputs following the sample runs below. Sample run 1: You entered:    95, 80, 100, 70 Highest grade: 100 Lowest grade:   70 Average grade: 86.25
C++ code Output Formatting. Design and implement a complete C++ program that reads a customer record...
C++ code Output Formatting. Design and implement a complete C++ program that reads a customer record from the user such as the record has 4 fields (pieces of information) as shown below: Account Number (integer) Customer full name (string) Customer email (string) Account Balance (double) The program is expected to print the record in the format shown below: Account Number :  0000000 Name                     :  full name Email                      :  customer email Balance                  :  000000.00$ For example, if the user enters the following record 1201077 Jonathan I. Maletic [email protected]...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT