// import java.util.Scanner;

//import java.util.Comparator;

//import java.util.Map;

//import java.util.Set;

//import java.util.TreeMap;

import java.lang.*;

import java.util.*;

summary class Graph

class motorway extends Graph

class pedestrianRoad extends Graph

non-public int width;

non-public int scenicValue;

non-public int occupancy;

non-public int maxOccupancy;

pedestrianRoad(String information[])

tremendous(information);

this.width = Integer.parseInt(information[6]);

this.scenicValue = Integer.parseInt(information[7]);

this.occupancy = Integer.parseInt(information[8]);

this.maxOccupancy = 1500;

findEffectiveSpeed();

findCost();

void findEffectiveSpeed()

public String toString()

return ( this.getName()+ ” “+ this.getLength()+” “+ this.getMaxSpeed()

+” “+width +” “+ scenicValue +” “+ occupancy);

class cyclistRoad extends Graph

non-public int curvature;

cyclistRoad(String information[])

void findEffectiveSpeed()

this.setEffectiveSpeed(this.getMaxSpeed()/(curvature*1.Zero));

//return effectiveSpeed;

public String toString()

class swamps extends Graph

non-public int issue;

swamps(String information[])

void findEffectiveSpeed()

public String toString()

class lakes extends Graph

non-public int width;

non-public int tidalLevel;

non-public int depth;

lakes(String information[])

tremendous(information);

this.width = Integer.parseInt(information[6]);

this.tidalLevel = Integer.parseInt(information[7]);

this.depth = Integer.parseInt(information[8]);

findEffectiveSpeed();

findCost();

void findEffectiveSpeed()

public String toString()

return ( this.getName()+ ” “+ this.getLength()+” “+ this.getMaxSpeed()

+” “+width +” “+ tidalLevel +” “+ depth);

class sortComparator implements Comparator

class makeGraph

class print

{

public static void printGraph(TreeMap graphlist)

}

public class Roadnetwork1{

public static void important(String[] args)

{

Scanner obj= new Scanner(System.in);

int t=obj.nextInt();

for(int j=Zero;j

Published by
Essays
View all posts