Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 Network team has different types of switches and they use specific type of switches in the distribution point data center, in hubs etc.

Question 1 Network team has different types of switches and they use specific type of switches in the distribution point data center, in hubs etc. Each switch has a model number and port. Based on the model number and port they will classify the switches as type 1, type 2 and core switches. Can we help them in the classification? Our aim is to get the model number and classify the switch as type 1, type 2 or core switch. Model number of the switch can be in one of the following format below where X denotes an alphabet and N denotes a number XX-XNNNN-NNX-X (or) XNNNN-NNX (or) XNNNNX- NNX-NX Eg: WS-C3850-24P-S, C5200-48P, C5200L-24P-8X. In the model C5200L-24P-8X,5200 is the model in short, 24 is the port number and 8X indicates that it is stacked. Here are the rules for classification Any switch with model numbers 5200,5250,5270 and port count is not more than 24 are Type 1 switches Eg: C5200L-12P ALL 1 Any switch with model numbers 5200,5250,5270,5300,5350,5370 with port count more than 24 and model numbers 5400 are Type 2 switches. C5250L-32P-2T If the switches are stacked, then it is a Core switch. Stacked switches are indicated by -Sand -NX(here N is a number) at the end. Eg:C5200L-24P-4X, WS- C3850-24P-S. Here are few more examples In table Model Number C5200L-12P C5250L-32P-2T 525052005200 Ports 12 Type 132 Type 2 C5200L-32P-4X C5200-48P C5370-48U WS-C3850-24P-S 520032 Core 48 Type 2537048 Type 23850 C5200L-24P-8X Model in short 520024 Core 24 Classification Core Function Description Complete the function classifySwitch in the editor below. The function must print the port and type of switch. classifySwitch has the following parameter(s): modelnumber: string Constraints If the model number is not in the specified format, print as "Invalid model number" Input Format For Custom Testing The first line contains a string, modelnumber, denoting the model number of the switch Sample Case 0 Sample Input For Custom Testing C5200L-12P Sample Output 12 Type 1 Explanation All 5200 switches with port less than 24 are Type 1 switches. Sample Case 1 Sample Input For Custom Testing 5200L-24P Sample Output Invalid model number Explanation Model number is not in the specified formatformat

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

I'm stuck on this one please help and show work.

Answered: 1 week ago