In three paragraphs answer the following questions:
What is an index of a vector or array? A vector is used to collect multiple values for the
same type, it is known as a collection of data items of the same type. An index or subscript of a
Choose one of the following for this week's assignment:
Create an algorithm for a program that greets the user, ask what the users name is, and
then greets the user by their supplied name.
Hello, my name is Hal.
What is your name?
Explain what the purpose is of designing a function that contains no side-effects.
A function that has no side effects can be run over and over with no surprises or errors. When a
function is given the same inputs, it will always return the sam
The first piece of code executes both if statements if condition is true means if x > 0 and y > 0.
Both of the statements are independent of each other meaning if x > 0, s+ will always execute
regardless of the below if statement. Similarly, y > 0,
s = 0;
If (x > 0) s+;
If (y > 0) s+;
s = 0;
if (x > 0) s+;
else if (y > 0) s+;
The first piece of code executes both if statements if condition is true means if x > 0 and
y > 0. Both of the statements are independent o
What is the screen output of the following code segment?
Explain the reasoning behind your answer.
using namespace std;
double Test1 = 70;
double Test2 = 80;
double Test3 = 84;
double Average = 0;
int NumberOfTests = 3;