question one\na) explain any five ways by which computer viruses can be spread. 10\nb) a banks atm provides…

question one\na) explain any five ways by which computer viruses can be spread. 10\nb) a banks atm provides customers with three essential banking services: depositing money, withdrawing funds, and checking their account balance. each customer begins with an initial balance of $500 in their account. write a program that allows the user to perform multiple transactions through a loop and provides the following options:\n• deposit: adds a specified amount to the account balance.\n• withdraw: deducts a specified amount, but only if sufficient funds exist.\n• check balance: displays the current account balance.\n• ensures that a withdrawal cannot exceed the available balance, preventing overdrafts.\n• continues allowing transactions until the user chooses to exit\nnb your program should provide a menu for the above options 15\nquestion two\na) explain the functions of the following components in a computer system.\ni. arithmetic and logic unit (alu). 2\nii. address bus 2\niii. register 2
Answer
Explanation:
Step1: Answer for Question One a
Computer - viruses can spread in the following ways:
- USB drives: When an infected USB is inserted into a clean computer, the virus can transfer. For example, if a user takes a USB from an infected public - access computer and inserts it into their work computer.
- Email attachments: Malicious files sent as attachments in emails. Once the user opens the attachment, the virus can infect the system. For instance, an attachment with a .exe file that looks like a legitimate document but is actually a virus.
- Network sharing: In a local area network, if one computer is infected, the virus can spread to other connected computers through shared folders or network resources.
- Downloads from the internet: Downloading infected software, music, or other files from untrusted websites can introduce a virus. For example, downloading a cracked version of a software that contains a virus.
- Infected websites: Visiting websites that are compromised can lead to drive - by downloads of viruses. Some websites may exploit security vulnerabilities in a browser to install malware.
Step2: Answer for Question One b (using Python)
balance = 500
while True:
print("1. Deposit")
print("2. Withdraw")
print("3. Check Balance")
print("4. Exit")
choice = input("Enter your choice: ")
if choice == '1':
amount = float(input("Enter the amount to deposit: "))
balance += amount
print(f"Deposit successful. New balance: ${balance}")
elif choice == '2':
amount = float(input("Enter the amount to withdraw: "))
if amount <= balance:
balance -= amount
print(f"Withdrawal successful. New balance: ${balance}")
else:
print("Insufficient funds.")
elif choice == '3':
print(f"Current balance: ${balance}")
elif choice == '4':
print("Thank you for using our services.")
break
else:
print("Invalid choice. Please try again.")
Step3: Answer for Question Two a i
The Arithmetic and Logic Unit (ALU) in a computer system performs arithmetic operations (such as addition, subtraction, multiplication, and division) and logical operations (such as AND, OR, NOT). It is the part of the CPU that actually processes data and makes decisions based on logical comparisons.
Step4: Answer for Question Two a ii
The Address Bus in a computer system is used to carry the memory address of the data that the CPU wants to access. It specifies where in memory the data is located for read or write operations. For example, when the CPU wants to read a value from a particular memory location, it sends the address of that location over the address bus.
Step5: Answer for Question Two a iii
A Register in a computer system is a small, high - speed storage location within the CPU. Registers are used to hold data and instructions that are currently being processed by the CPU. For example, an accumulator register is used to store the result of arithmetic and logical operations temporarily.
Answer:
For Question One a: USB drives, Email attachments, Network sharing, Downloads from the internet, Infected websites. For Question One b: See the Python code above. For Question Two a i: Performs arithmetic and logical operations. For Question Two a ii: Carries memory addresses for data access. For Question Two a iii: Small, high - speed storage within the CPU for data and instructions.