C++ Assingment
//Create a simple program that stores the values of 2 variables,_x000D_
//Then perfoms the following operations and store the results in _x000D_
//at least one other variable:_x000D_
//-Addition_x000D_
//-Substration_x000D_
//-Multiplication_x000D_
_x000D_
//Preprocessor Directives_x000D_
//#include "StdAfx.h"_x000D_
_x000D_
#include <iostream>_x000D_
#include <string.h>_x000D_
_x000D_
using namespace std;_x000D_
//Global Declarations_x000D_
//Create my variables (Declaration)_x000D_
//*** Create variables to hold values_x000D_
double Variable1;_x000D_
double Variable2;_x000D_
//*** Create variable (s) to hold the result of the operations_x000D_
double OperationResult1, OperationResult2, OperationResult3;_x000D_
_x000D_
//Function Declarations_x000D_
float Addition_Operation();_x000D_
_x000D_
//Define an object for a simple calculator_x000D_
class Simple_Calculator_x000D_
{_x000D_
public:_x000D_
//Data members_x000D_
double Variable1;_x000D_
double Variable2;_x000D_
double Result;_x000D_
_x000D_
//Function Set-UP: Initialize your data members_x000D_
int Set_Up()_x000D_
{_x000D_
Variable1 = 4;_x000D_
Variable2 = 6;_x000D_
Result = 0;_x000D_
}_x000D_
_x000D_
_x000D_
//Methods (members)_x000D_
double Addition()_x000D_
{_x000D_
//Perform Addition _x000D_
//*** Add Variable1 and Variable2 and save the result_x000D_
Result = Variable1 + Variable2;_x000D_
//*** Output the result on the screen_x000D_
cout << "The resulf of the Addition of " << Variable1 << " + " << Variable2 << " is " << Result << 'n';_x000D_
}_x000D_
double Substraction()_x000D_
{_x000D_
}_x000D_
double Multiplication()_x000D_
{_x000D_
}_x000D_
_x000D_
_x000D_
};_x000D_
_x000D_
//Main Function_x000D_
int main() {_x000D_
_x000D_
//Use Algorithm to outline the series of steps required to solve your problem_x000D_
//Algorithm: Structure Chart, Pseudocode, Flowchart_x000D_
_x000D_
//Create an object of type Simple_Calculator_x000D_
Simple_Calculator myCalculator;_x000D_
_x000D_
myCalculator.Set_Up();_x000D_
myCalculator.Addition();_x000D_
_x000D_
//Assign values to my variables_x000D_
Variable1 = 25;_x000D_
Variable2 = 00;_x000D_
_x000D_
//Call the Addition function: Function Call_x000D_
Addition_Operation();_x000D_
_x000D_
//Perform Substration Operation_x000D_
//*** Substract Variable2 from Variable1 and save the result: Substract Operands from one another_x000D_
OperationResult2 = Variable1 - Variable2;_x000D_
//*** Output the result of the operation on the screen_x000D_
cout << "The resulf of the Substration of " << Variable1 << " - " << Variable2 << " is " << OperationResult2 << endl;_x000D_
_x000D_
//Perform Multiplication Operation_x000D_
//*** Multi;ply Variable2 by Variable1 and save the result_x000D_
OperationResult3 = Variable1 = Variable2;_x000D_
//*** Output the result of the operation on the screen_x000D_
cout << "The resulf of the Multiplication of " << Variable1 << " * " << Variable2 << " is " << OperationResult3 << endl;_x000D_
_x000D_
_x000D_
return 0;_x000D_
}_x000D_
_x000D_
//Other Function Definitions_x000D_
_x000D_
//Addition function_x000D_
float Addition_Operation()_x000D_
{_x000D_
//Perform Addition _x000D_
//*** Add Variable1 and Variable2 and save the result_x000D_
OperationResult1 = Variable1 + Variable2;_x000D_
//*** Output the result on the screen_x000D_
cout << "The resulf of the Addition of " << Variable1 << " + " << Variable2 << " is " << OperationResult1 << 'n';_x000D_
_x000D_
}_x000D_
//Other Function Definition
"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.
Discount Code: CIPD30
Click ORDER NOW..


