Answer:
Required code is given below.
Best Regards,
Please ask if any queries.
Explanation:
#include <stdio.h>
#include <string.h>
int main(void)
{
char input[100];
printf("Enter desired auto service:\n");
scanf ("%[^\n]%*c", input);
printf("You entered: %s\n",input);
if(strcmp(input,"Oil change") == 0){
printf("Cost of oil change: $35\n");
}
else if(strcmp(input,"Tire rotation") == 0){
printf("Cost of tire rotation: $19\n");
}
else if(strcmp(input,"Car wash") == 0){
printf("Cost of car wash: $7\n");
}
else{
printf("Error: Requested service is not recognized\n");
}
return 0;
}
Answer:
def rec_dig_sum( num ):
num_list = [ digit for digit in str(num)]
total = 0
for x in num_list:
total += x
return total
def dict_of_rec_dig_sums(low, high):
mydict = dict()
for number in the range(low, high+1):
mydict[rec_dig_sum(number)] = number
return mydict
Explanation:
The python program defines two functions, "rec_dig_sum" and "dict_of_rec_dig_sums". The former accepts a number and returns the sum of the digits of the number while the latter accepts a low and high number range.
The program returns a dictionary with the recursive sum as the keys and the number count as the values.
I've included my code in the picture below. Best of luck.
Answer:
C. Spoofing.
Explanation:
Cyber security can be defined as preventive practice of protecting computers, software programs, electronic devices, networks, servers and data from potential theft, attack, damage, or unauthorized access by using a body of technology, frameworks, processes and network engineers.
Some examples of cyber attacks are phishing, zero-day exploits, denial of service, man in the middle, cryptojacking, malware, SQL injection, spoofing etc.
Spoofing can be defined as a type of cyber attack which typically involves the deceptive creation of packets from an unknown or false source (IP address), as though it is from a known and trusted source. Thus, spoofing is mainly used for the impersonation of computer systems on a network.
Basically, the computer of an attacker or a hacker assumes false internet address during a spoofing attack so as to gain an unauthorized access to a network.