Answer:
/*C++ program that prompts user to enter the name of input file(input.txt in this example) and print the sum of the values in the file to console. If file dosnot exist, then close the program */
//header files
#include <fstream>
#include<string>
#include <iostream>
#include <cstdlib> //needed for exit function
using namespace std;
//function prototype
int fileSum(string filename);
int main()
{
string filename;
cout << "Enter the name of the input file: ";
cin >> filename;
cout << "Sum: " << fileSum(filename) << endl;
system("pause");
return 0;
}
/*The function fileSum that takes the string filename and
count the sum of the values and returns the sum of the values*/
int fileSum(string filename)
{
//Create a ifstream object
ifstream fin;
//Open a file
fin.open(filename);
//Initialize sum to zero
int sum=0;
//Check if file exist
if(!fin)
{
cout<<"File does not exist ."<<endl;
system("pause");
exit(1);
}
else
{
int value;
//read file until end of file exist
while(fin>>value)
{
sum+=value;
}
}
return sum;
}//end of the fileSum
Explanation:
This is a C++ program that prompts user to enter the name of input file(input.txt in this example) and print the sum of the values in the file to console. If file dosnot exist, then close the program.
Check attachment for sample output screenshot.
Answer:
Option A.
Explanation:
Only option A satisfies the definition of push statements. So it is only the correct option.
Answer:
void delete_record(student_record *arr, int &size, int age, string name, double gpa) {
int index = -1;
if (arr != NULL && size > 0) {
for (int i = 0; i < size; ++i) {
if (arr[i].age == age && arr[i].name == name && arr[i].gpa == gpa) {
index = i;
break;
}
}
}
if (index != -1) {
for (int i = index; i < size - 1; ++i) {
arr[i] = arr[i + 1];
}
size--;
}
}
Answer:
Explanation:
There is a solution called ETA (Encrypted Traffic Analytics) this is a security advanced network that helps us to identify malware between the encrypted data, but with this tool is no necessary to break any protection and privacy chain.
This technology use machine learning to read all the traffic without deciphering it, in this way we can detect a difference between reliable and malicious traffic.
En windows we can use Microsoft Security Essentials like antivirus and detect virus, we can use Process Explorer, analyze the traffic, we can use Microsoft Network Monitor.
Answer:
The answer is "Option A"
Explanation:
A single computer component also known as a single-board computer, it is a total machine, which is built on a single silicon chip with functional devices like microcontroller, (I / O), and storage.
- It normally uses a device, which has a fanless, small-power computation system, and small-profile design.
- This model provides very slow communication between the components of single computers, that's why the given statement is true.