Answer:
<em>C++</em>
////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> v;
int n = 1;
while (n != 0) {
cout<<"Enter an integer, the input ends if it is 0: ";
cin>>n;
v.push_back(n);
}
cout<<endl;
///////////////////////////////////////////////////////////
int sum = 0;
int num_positives = 0, num_negatives = 0;
for (int i=0; i<v.size()-1; i++) {
if (v[i] > 0)
++num_positives;
else
++num_negatives;
sum = sum + v[i];
}
//////////////////////////////////////////////////////////
cout<<"The number of positives is "<<num_positives<<endl;
cout<<"The number of negatives is "<<num_negatives<<endl;
cout<<"The total is "<<sum<<endl;
cout<<"The average is "<<(float)sum/(v.size()-1);
///////////////////////////////////////////////////////////
return 0;
}
An Object-Oriented code or coding refers to a technique of programming that utilizes the identification of classes of objects that are closely tied to the functions with which they are related.
<h3>What is a Procedural Oriented Code?</h3>
This refers to a kind of programming language that utilizes a step-by-step method so as to break down a task into a set or a collection of factors or variables and routines or sub-routines using a set of instructions that are sequential.
Objects in programming refer to a type of abstract data that has a state and behavior. It is a specific instance of a class.
A class in programming is a templated definition of the techniques and variables of a certain type of object.
<h3>What are some of the principles and structures of coding?</h3>
There are 10 principles of coding. Some of them are:
- Keep it simple
- Separate concerns
- Document your Code etc.
Some of these principles can be used in normal day-to-day activity and even in business. item 1 for instance can be used during communication. Effective communication is more effective when it is kept very simple.
It is to be noted that the code referenced in the question is unavailable hence the general answer.
Learn more about Object-Oriented Code at:
brainly.com/question/4560494
Answer:
String word = "George slew the dragon";
int pos = word.indexOf("dr");
String drWord = word.substring(pos, pos+4);
System.out.println(drWord);
Explanation:
Assuming dr is always there, we don't have to check the validity of 'pos'. Normally, you would!
AI-driven attacks caused sandbox technology to automate and introduce artificial intelligence learning. AI and machine learning can be used to fight against malware attacks.
<h3>
Artificial intelligence, machine learning, and malware</h3>
Artificial intelligence (AI) refers to the ability of a PC to perform tasks done by humans due to the requirement of discernment.
Machine learning is a subdivision of (AI) based on the use of data and algorithms to mimic human learning.
Malware is malicious software generated by cybercriminals, which are capable of stealing unauthorized information.
Learn more about malware here:
brainly.com/question/399317