CS 265 Programming in C++ Week 1 Assignment Answered 2024 Week #1 Assignment
Program Description
This program is designed to take the average of three specific numbers, it
demonstrates how to create a program using C++
Program Code
//***********************************************************
//Curtis Wilson
//CS265 Programming in C++
//
//This program is designed to take the average of three numbers
//
//***********************************************************
#include // preprocessor directives and header files are placed first so that the
identifiers declared can be use throughout the program
using namespace std; // this statement allows you to use cin and cout without using the
prefix std::.
int main() //Heading of the function main, where variables are declared,
manipulated, assigned, within the main function
{
int num1; // declaration statement to declare variable num1
int num2; // declaration statement to declare the variable num2
int num3; //declaration statements to declare the variable num3
int average; //declaration statement to declare the variable average
num1 = 125; //assignment statement to assign 125 to the variable num1
num2 = 28; //assignment statement to assign 28 to the variable num2
2