Answer:
import java.util.Scanner;
public class U6_L1_Activity_One{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int[] arr = new int[4];
arr[1] = scan.nextInt();
arr[2] = scan.nextInt();
arr[3] = scan.nextInt();
System.out.println("Contents: " + arr[1] + " " + arr[2] + " " + arr[3]);
int Sum = (1 + 2 + 3);
System.out.println("Sum: " + Sum);
}
}
Explanation:
A main problem that may arise is if they have created two different ways of adressing the same part of the software
Answer:
Required code is given below:
Explanation:
def add_to_dict(dictt, key,value):
if key in dictt.keys():
print("Error. Key already exists.")
else:
dictt[key]=value
return dictt
def remove_from_dict(dictt,key):
try:
dictt[key]
dictt.pop(key, None)
return dictt
except KeyError:
print("No such key exists in the dictionary.")
def find_key(dictt,key):
try:
value=dictt[key]
print("Value: ", value)
except KeyError:
print("Key not found.")