C++ Computer science

C++ Computer science
The codes on assignment A-6-1 work take it and post it in(Visual Studio 2013)
Win32 Console Application Visual C++Then do Requirements A-6-2
Assignment: A-6-2
Objectives:
– Understand the syntax, reserved words, symbols, etc. used in coding basics of using functions in pass and return by value.

– Understand the basics of using functions in pass and return by value.

– Understand the use, placement, and related of the prototype statement, the function code build and calling of a function.

– Understand the use, placement, and related of the function declare and build section of code.

– Understand and apply the call and use a function, passing data items to the function, and returning an item from a function

Take assignment A-6-1, and document how what each reserved word, symbol, command, curly bracket, semi-colon, etc., does, and what each statement as a whole does.
• You need only address the concepts dealing with the function portion of the code to include:-
• Add extra documentation focusing on what is going on and how the code is working.
• The prototype statement.
• The calling statement, to include what is passed to the called function, what happens to the returned values, etc.
• The called functions definition/build section of code, what is returned, local variables, etc. Focuses on how the program works.
II – Show memory map of what is happening. Ensure you address:
• How the values from the calling program, void main () get passed by value to the called function int funcDoAdd (int, int).
Ii – What happens to in memory when:
• The called function is called
• The called function returns it return value and ends.
Assignment: A-6-1
Purpose:In this program you will code a simple function in which you will pass two integers by value of type int to the called function and name the function funcDoAdd (or equivalent) and return an integer of type int to the main calling block of code, ie. The main function.

READ ALSO :   Annotated Bibliography

#include “stdafx.h”
#include <iostream>
#include <iomanip>

using namespace std;

//prototype
int funcDoAdd(int Num1, int Num2);

int main()
{//begin main true leg here
int iAnswer = 0;
int number1 = 0;
int number2 = 0;

cout << ” Enter the First Integer->”;
cin >> number1;
cout << ” Enter the First Integer->”;
cin >> number2;
iAnswer = funcDoAdd(number1, number2); //Calling up the function

cout << number1 << ” Plus ” << number2 << ” = ” << iAnswer << endl;
system(“pause”);

}//end main true leg here

int funcDoAdd(int Num1, int Num2) //Function with 2 parameters:
{//begin function true leg here
int iAns = Num1 + Num2;
return iAns;
}//end function true leg here