At one college, the tuition for a full-time student is $8,000 per semester. It has been announced that the tuition will increase by 3 percent each year for the next 5 years. Write a program with a loop that displays the projected semester tuition amount for the next 5 years.
The program should print out the result in the form
In 1 year, the tuition will be $8002.3.
In 2 years, the tuition will be $8103.2.
In 3 years, …
In 4 years, …
In 5 years, …
(If, for example, the tuition would cost 8002.3dollars in one year, etc.)
Sample Run
In 1 year, the tuition will be $8240.0.↵
In 2 years, the tuition will be $8487.2.↵
In 3 years, the tuition will be $8741.816.↵
In 4 years, the tuition will be $9004.07048.↵
In 5 years, the tuition will be $9274.192594400001.↵
use sort() function to sort [34,1,2,6,3,7], [[1,3], [3,2], [1,2], [3,1]] and ['a', 'x', 'e', 'A', 'X', 'E'] and tell us what you observe in 2nd, 3rd list"You have subnetted your class B network 190.220.1.0 with a subnet mask of 255.255.255.224. Please list the following :
- Number of subnet bits.
- Number of networks.
- Number of hosts per network.
- The full range of first two networks.
- The usable IP address range from those
first two networks.
- The broadcast address for first two
networks.
Number Arrangement
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.
Input
The input is a string containing the actual sentence.
Output
The output is a string containing the modified sentence as mentioned above.
Explanation
For example, if the actual sentence is It is a 3days 4nights holiday trip.
The numbers in the sentence are 3 and 4.After arranging them in the decreasing order, the output looks like It is a 4days 3nights holiday trip.
Sample Input1
It is a 3days 4nights holiday trip
Sample Output1
It is a 4days 3nights holiday trip
Difficult Addition
Arjun is trying to add two numbers. Since he has learned addition recently, an addition which requires a carry is difficult for him. Your task is to print Easy if the addition does not involve a carry, Otherwise print Hard.
Input
The first line of input contains two space separated integers A and B.
Output
If the addition does not involve a carry,print Easy, otherwise print Hard.
Explanation
When calculating 229 + 390, we have a carry from the tens digit to the hundreds digit, so the answer is Hard.
Sample Input1
123456789 9876543218
Sample Output1
Easy
Sample Input2
229 390
Sample Output2
Hard
You have sub-netted your class C network 200.138.1.0 with a subnet mask of 255.255.255.252. Please list the following: number of networks, number of hosts per network, the full range of the first three networks, and the usable address range from those first three networks. Additionally, identify the broadcast addresses for each network.
an h1 element containing "Assignment 4"
an h2 element containing the name of your favourite sport or hobby
a p element with a description of the sport or hobby you chose (just a sentence or two)
2. Create a JavaScript file named script.js. Associate this file with your HTML file using the best
practices taught in class.
3. In the JavaScript file do the following:
create a variable that contains your name
console.log the value of this variable
include the following code in your JavaScript file. Don't worry about how it works for now,
we will cover this in the next module, but it will replace the text in the h2 element when
viewing the webpage. (Use the variable name that you created instead of myName.)
document.querySelector('h2').textContent = myName;
4. Open your HTML file in a web browser. Check the console for you output and the web page for
the replacement text on the page.
Write a program to compute the number of distinct shortest paths between two given vertices in an undirected graph with unit edge lengths. Your algorithm should run in linear time. Input Format: The input is a text file which describes the undirected graph G. The first line of the file specifies n, m, u and v, the number of vertices, the number of edges, and the two given vertices respectively. The next m lines specify the m edges of the graph, one line per edge. An edge is described by its end points (no edge weights are described since all the edges have unit length). If the number of vertices is n, assume that the vertices of the graph are numbered (0,1,..n-1). Output Format: Print the number of distinct shortest paths between vertices u and v. Sample Input (for the graph shown on the right): 6 10 5 0 0 1 0 2 1 2 1 3 1 4 2 3 2 4 3 4 3 5 4 5 Sample Output : 4
Given undirected weighted graph, write a program to find shortest paths from designated source vertex all other vertices graph using Dijkstra’s shortest path algorithm. Input Format: input is text file which describes undirected graph. first line file specifies n, m, s, number vertices, number of edges and source vertex respectively. next m lines specify m edges graph, one line per edge. edge is described by its end points followed by weight of that edge. If number of vertices is n, assume that vertices of graph are numbered (0,1,..n-1). Also assume that edge weights are non-negative. Output Format: Print shortest path from source vertex to each vertices in graph, along with length shortest path. Sample Input ( graph shown on right): 5 8 0 0 1 4 0 2 2 1 2 1 1 3 2 1 4 3 2 3 4 2 4 5 3 4 1 Sample Output : Shortest path to 0: 0 ; cost = 0 Shortest path to 1: 0, 2, 1; cost = 3 Shortest path to 2: 0, 2; cost = 2 Shortest path to 3: 0, 2, 1, 3; cost = 5 Shortest path to 4: 0, 2, 1, 4; cost = 6
Given a positive number, create an array with that number as a size and populate it with the items/names provided. Additionally, the program should print out the longest name in the array. Sample Run1 3 Apple Banana Kiwi Output1: Banana is the longest name