Given a string, write a program to re-arrange all the numbers appearing in the string in decreasing order. Note: There will not be any negative numbers or numbers with decimal part
Printers, Inc. is redesigning the network that connects its three locations. The administrator gave the networking team 192.168.11.0 to use for addressing the entire network. After subnetting the address, the team is ready to assign the addresses. The administrator plans to configure IP subnet-zero. As a member of the networking team, you must address the network and at the same time conserve unused address for future growth. With those goals in mind, choose the host addresses on the left to the correct router interface. All the routers interfaces are given below and one of the routers is partially configured. Not all of the host address on the left are necessary.192.144.11.217/30;192.144.11.215/29;192.144.11.225/27;192.144.11.31/25;192.144.11.164/26;192.144.11.215/30 The router interfaces are: Inkjet Fa 0/0 IP : Laser Fa 0/0 IP: Spooler Fa 0/0 IP: Inkjet S0/0 IP
For the given IP address with subnet, identify the number of subnet, the valid host IP addresses for the given problem. Network address : 200.10.10.0 Number of needed usable hosts : 20 Address Class : ---------------- Number of host bits borrowed : ------------------------------ Default Subnet mask : ----------- Custom subnet mask : ----------- Total number of subnets : ------------------------------- Total number of host addresses : ------------------------------- Number of usable address : ------------------------------- i. What is the 7 th subnet range? ii. What is the subnet number for the 5 th subnet? iii. What is the broadcast address of the 4 th subnet? iv. What are the assignable addresses for the 6 th subnet?
For the given IP address with subnet, identify the number of subnet, the valid host IP addresses for the given problem. Network address : 195.223.50.0 Number of usable hosts needed : 45 Address Class : ---------------- Number of host bits borrowed : ------------------------------ Default Subnet mask : ------------------------------- Custom subnet mask : ------------------------------- Total number of subnets : ------------------------------- Total number of host addresses : ------------------------------- Number of usable address : ------------------------------- i. What is the 2 nd subnet range? ii. What is the subnet number for the 2nd subnet? iii. What is the broadcast address of the 4 th subnet? iv. What are the assignable addresses for the 3rd subnet?
Write a program that can be used to determine the total amount a family needs to pay for bus tickets. The price for a bus ticket is linked to the age of the passenger, as indicated in the table below:
Age
Younger than 2 2 - 12
13 or more
Ticket price
R 50 R 100 R 180
The program must prompt the user for the number of family members who will be travelling on the bus. For each travelling member the age must be entered, and the price determined and displayed. When all family members have been processed, the total amount due must be displayed. Monetary amounts must be displayed with currency formatting. (You may assume that only valid ages will be entered)
Ordered Matrix
Given a M x N matrix, write a program to print the matrix after ordering all the elements of the matrix in increasing order.Input
The first line of input will contain two space-separated integers, denoting the M and N.
The next M following lines will contain N space-separated integers, denoting the elements of each list.Output
The output should be M lines containing the ordered matrix.
Note: There is a space at the end of each line.Explanation
For example, if the given M is 3 and N is 3, read the inputs in the next three lines if the numbers given in the next three lines are the following.
1 20 3
30 10 2
5 11 15By ordering all the elements of the matrix in increasing order, the ordered matrix should be
1 2 3
5 10 11
15 20 30Sample Input 1
3 3
1 20 3
3 10 2
5 11 15
Sample Output 1
1 2 3
5 10 11
15 20 30
Sample Input 2
2 5
-50 20 3 25 -20
88 17 38 72 -10
Sample Output 2
-50 -20 -10 3 17
20 25 38 72 88
LCM and GCD
You are given two integers
The input contains two integers
The output contains
Given
x = 6 and y = 14.The GCD of the numbers is
2. The LCM of the numbers is 42.The output is
2 42.