Answer:
C code for half()
#include<stdio.h>
void half(float *pv);
int main()
{
float value=5.0; //value is initialized
printf ("Value before half: %4.1f\n", value); // Prints 5.0
half(&value); // the function call takes the address of the variable.
printf("Value after half: %4.1f\n", value); // Prints 2.5
}
void half(float *pv) //In function definition pointer pv will hold the address of variable passed.
{
*pv=*pv/2; //pointer value is accessed through * operator.
}
- This method is called call-by-reference method.
- Here when we call a function, we pass the address of the variable instead of passing the value of the variable.
- The address of “value” is passed from the “half” function within main(), then in called “half” function we store the address in float pointer ‘pv.’ Now inside the half(), we can manipulate the value pointed by pointer ‘pv’. That will reflect in the main().
- Inside half() we write *pv=*pv/2, which means the value of variable pointed by ‘pv’ will be the half of its value, so after returning from half function value of variable “value” inside main will be 2.5.
Output:
Output is given as image.
Answer:
import re
with open("../../Downloads/Tweets.txt","r", encoding="utf-8") as tweets:
myfile = tweets.readlines()
for item in myfile:
item = item.rstrip()
mylist = re.findall("^RT (.*) ", item)
if len(mylist) !=0:
for line in mylist:
if line.count("#") >=1:
ln = line.split("#")
dm = ln[1]
print(f"#{dm}")
Explanation:
The python source code filters the document file "Tweets" to return all tweets with a hashtag flag, discarding the rest.
Answer:
In 2000, a basic internet application cost businesses approximately $150,000 per month. In mid-2016, operating the same application in Amazon's cloud cost approximately $1,000 per month.
Explanation:
The role of cloud services cannot be overemphasized. Providing Infrastructure as a service (IaaS), Platform as a service (PaaS) and Software as a service (SaaS) cost a lot as there were very few cloud service providers and most services were yet to be integrated to the cloud.
But as at 2016, the cost on applications dropped as we have experienced an exponential growth in cloud services and applications, we now have Internet of Things (IoT) and other cloud infrastructure.
A. casual users hope this helps
Answer:
1. True 2. False 3. True 4. True 5. True 6. False 7. True
Explanation:
1. A hacker/cracker finds and exploits weakness in order to gain access with a criminal intent, just as an intruder.
2. Activists are people who campaign to bring about a positive political or social change.
3. It is illegal to use a device as a packet sniffer to steal people's usernames and passwords.
4. This quite true, as there is a huge community of hackers where people are highly recognized for hacking.
5. Yes, intruders have a common attack methodology.
6. IDS monitors networks or systems to identify suspicious activities while a user interface is the means the computer and the user interacts. So it's false.
7. instrusion detection involves monitoring networks or systems to identify suspicious activities, so an intruder is detected if their behavior is suspicious when compared to a legitimate user.