<u>Answer:</u>
<em>int fNumber,scndNumber = -1, </em>
<em>dup = 0;
</em>
<em>do {
</em>
<em>cin >> fNumber;
</em>
<em>if ( scndNumber == -1) {
</em>
<em>scndNumber = fNumber;
</em>
<em>}
</em>
<em>else {
</em>
<em>if ( scndNumber == fNumber )
</em>
<em>duplicates++;
</em>
<em>else
</em>
<em>scndNumber = fNumber;
</em>
<em>}
</em>
<em>} while(fNumber > 0 ); </em>
<em>cout << dup;
</em>
<u>Explanation:</u>
Here three variables are declared to hold the first number which is used obtain all the inputs given by the user, second number to hold the value of <em>last encountered number and “dup” variable to count the number of duplicate values.</em>
<em>“Do-while”</em> loop help us to get the input check whether it is same as previous input if yes then it <em>adds to the duplicate</em> value otherwise the new previous value if stored.
Answer:
a) Pick ONE OR MORE options Using code-splitting for JS files.
b) Compressing the JS files on the server-side
Explanation:
Javascript is a multi-purpose programming language, it is used in web development as a scripting language for programming the interactiveness of the web application.
Loading and running the script from the server can take a lot of time, so, the file is compressed and split for faster loading.
Answer:
The program to this question can be given as:
Program:
#include <iostream> //header file
using namespace std; //using namespace
double MphAndMinutesToMiles(double milesPerHour, double minutesTraveled) //defining method
{
return (minutesTraveled/ 60.0)*milesPerHour; //return value.
}
int main() //defining main method
{
double milesPerHour,minutesTraveled; //define variable
cout<<"Enter miles per hour :";
cin >> milesPerHour;
cout<<"Enter travelling minutes :";
cin >> minutesTraveled;
cout << "Miles: "<< MphAndMinutesToMiles(milesPerHour, minutesTraveled)<< endl;
return 0;
}
Output:
Enter miles per hour :12
Enter travelling minutes :20
Miles: 4
Explanation:
The explanation of the above C++ program can be given as:
- In the first header file is include the function is define that is "MphAndMinutesToMiles". This function accepts two parameters that are "milesPerHour and minutesTraveled".
- Both parameter datatype is double and the function return type is also double. Inside a function calculate miles and return its value.
- In the main method, two variable defines that takes value from the user side and pass into the function. To print function return value we use "cout" function that prints function return value.
Answer:
The basic comaprism of OSSTMN and PTES includes the following: OSSTMN is more theoretical, security assessment methodology, and Metrics based why PTES is technology oriented, penetration testing methodology
, extended analysis of all stages
Explanation:
Solution
Penetration testing has several methodologies which include :OSSTMM and PTES
The comparison between OSSTMM and PTES is stated as follows:
OSSTMM:
Security assessment methodology
More Theoretical
Metrics based
PTES
:
Technology oriented
Penetration testing methodology
Extended analysis of all stages
Now,
There are 7 stages which is used to define PTES for penetration testing.(Penetration Testing Execution Standard)
- Pre-engagement Interactions
Now,
The OSSTMM is used to obtain security metrics and performing penetration testing .The OSSTMM provides transparency to those who have inadequate security policies and configurations.
The OSSTMM includes the entire risk assessment process starting from requirement analysis to report creation.
Six areas are covered by OSSTMM which are:
-
Internet technology security