Course Solutions Uncategorized (Solved) : Convert Following Python Code Java Code Print Header Forwarding Database Fdb Def Printhead Q32729713 . . . .

(Solved) : Convert Following Python Code Java Code Print Header Forwarding Database Fdb Def Printhead Q32729713 . . . .

 

Convert the following python code into javacode

# print header for forwarding database(FDB)
def printHeader(outFile: str):
outFile.write(“————————————————-n”)
outFile.write(“| Indx | Host | Port |n”)
outFile.write(“————————————————-n”)

# print forwarding database(FDB)
def printFDB(outFile: str, fdb: dict):
index = 1
printHeader(outFile)
for port, src_mac in fdb.items():
………………outFile.write(“|{0}|{1}|{2}|n”.format(index,src_mac, port))
………………index += 1
outFile.write(“n”)

# number of ports in the bridge
number_of_ports = int(input(“Number of ports in the bridge:”))
if number_of_ports > 8:
……………print(“Number of ports should be less than 9”)
……………exit()

fileName = input(“Enter input file name: “)

fdb = {} # empty dictionary to store MAC and its incoming portnumber

with open(“fdb.txt”, ‘w’) as outFile:

………….with open(“inp.txt”, ‘r’) as file:
………………………frames = file.readlines() # The variable”frames” is a list containing all lines in the file
………………………for frame

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Answered) : Question 8 1 Point Input Variables Study Time Attendance Rate Significant Predictors Exam Q28648623(Answered) : Question 8 1 Point Input Variables Study Time Attendance Rate Significant Predictors Exam Q28648623

<br/><img src="https://media.cheggcdn.com/media%2Ff6e%2Ff6e87da6-7a61-42ac-9777-257a7111f86f%2Fimage" alt="Question 8 (1 point) Are both input variables-study time and attendance rate- significant predictors of exam score? Here is the an additional segment of the regression output: Coefficients