1. (TCO 13) The header file that defines the classes for processing and manipulating files is called the _____. (Points : 4)
<iostream>
<fstream>
<pstream>
<mstream>
1. (TCO 3) What is the output of the following program?
#include <iostream>
using namespace std;
int main()
{
int x1, x2, i, j, k, y, z;
float f;
x1 = 1;
x2 = 1;
y = 5 + x1--;
z = 5 + ++x2;
i = 6 % 4;
j = 1;
j += j + 3;
k = 25 / 2;
f = (float)((2 / 5) * k);
cout<<"x1 is "<<x1<<"\nx2 is "<<x2<<"\ni is "
<<i<<"\nj is "<<j<<"\nk is "<<k<<"\nk is "
<<k<<"\ny is "<<y<<"\nz is "<<z<<"\nf is "<<f<<endl;
return 0;
}
2. (TCO 4) When using a logical AND (or a logical OR), are the expressions to both sides of the && (or ||) always evaluated? Please explain. (Points : 15)
3. (TCO 5) Using a loop, write a program that reads in exactly five integers and outputs the sum. (Points : 15)
4. (TCO 7) Explain the difference between a function prototype and a function definition. Use a C++ program segment to illustrate your answer. (Points : 15)
5. (TCO 11) Explain how a linear search is conducted to find a particular data value in an array. Provide a C++ program segment to illustrate your answer. (Points : 15)
6. (TCO 9) Define objects, class, method, and proprieties and provide code segment that illustrates these terms. (Points : 15)
7. (TCO 13) Create a writeData method snippet of code using NAME and State as variables. Collect the information and write it to file. (Points : 20)
Need Solution Click link:
https://gum.co/fBEc
OR email me
topsolutions8@gmail.com
<iostream>
<fstream>
<pstream>
<mstream>
Opens myFile in append mode Creates an empty file named myFile Opens a file in input mode to write to |
at the beginning of the file in the middle of the file after the file header |
is_open is_closed is_ready |
tPtr[ 3 ] &t[ 3 ] *( t + 3 ) |
position of Row position of Column last position of an array |
Index1-error Off-by-one-error N-1 |
7 6 1 |
syntax binary logic |
functions addresses data fields |
Definition Return Members |
specifier class specifier None of the above |
Mutator method Constructor method Destructor method |
parameter initializer reference |
header return statement void statement |
Determines who can see and access the variable It is the length of time the variable is in existence, AND determines who can see and access the variable. None of these |
main() passes them for you. All functions defined after the global variable definition can see and access global variables. They remain local to main(). |
Compiler Linker Common language runtime |
to perform mathematical calculations as approximate representations of decimal numbers for applications when precision is required |
controlled-counter outer counter-controlled |
99 100 The loop is not written correctly. It would not compile. |
nesting overloading validation |
You cannot compare apples to oranges. Assumes indentation has a logical purpose No error |
The case label is needed so that the switch finds the correct condition. The break statements separate the case statements. None of these statements explain why a switch needs break statements. |
5.75 3.75 4.15 |
; \\ >> |
.h .txt .doc |
Debugging notes Comments Output documentation |
IDE compiler debugger |
C++ is FUN C++ is Fun C++ is fun |
#include <iostream>
using namespace std;
int main()
{
int x1, x2, i, j, k, y, z;
float f;
x1 = 1;
x2 = 1;
y = 5 + x1--;
z = 5 + ++x2;
i = 6 % 4;
j = 1;
j += j + 3;
k = 25 / 2;
f = (float)((2 / 5) * k);
cout<<"x1 is "<<x1<<"\nx2 is "<<x2<<"\ni is "
<<i<<"\nj is "<<j<<"\nk is "<<k<<"\nk is "
<<k<<"\ny is "<<y<<"\nz is "<<z<<"\nf is "<<f<<endl;
return 0;
}
2. (TCO 4) When using a logical AND (or a logical OR), are the expressions to both sides of the && (or ||) always evaluated? Please explain. (Points : 15)
3. (TCO 5) Using a loop, write a program that reads in exactly five integers and outputs the sum. (Points : 15)
4. (TCO 7) Explain the difference between a function prototype and a function definition. Use a C++ program segment to illustrate your answer. (Points : 15)
5. (TCO 11) Explain how a linear search is conducted to find a particular data value in an array. Provide a C++ program segment to illustrate your answer. (Points : 15)
6. (TCO 9) Define objects, class, method, and proprieties and provide code segment that illustrates these terms. (Points : 15)
7. (TCO 13) Create a writeData method snippet of code using NAME and State as variables. Collect the information and write it to file. (Points : 20)
Need Solution Click link:
https://gum.co/fBEc
OR email me
topsolutions8@gmail.com