In this program, you will write a simple program that holds all of the states and their corresponding capitals in a Map.
PROGRAM MUST BE DONE IN JAVA
Your program must have the following features:
·This program will be a Java Console Application called StateCapitals.
·Create a Map to hold the
names of all the states and their corresponding capital
names.
(State name is the key, capital name is the value.)
·Load the HashMap with each
state/capital pair.
(This should be hard-coded.)
·Print all of the state names
to the screen.
(Hint: Get the keys from the map and then print each state name one
by one.)
·Print all of the capital
names to the screen.
(Hint: Get the values from the map and then print each capital name
to the screen one by one.)
·Print each state along with
its capital to the screen.
(Hint: Use the key set to get each value from the map one by one,
printing both the key and value as you go.)
Sample output (order may vary):
STATES:
=======
Alabama
Alaska
Arizona
Arkansas
…
…
CAPITALS:
=========
Montgomery
Juneau
Phoenix
Little Rock
…
…
STATE/CAPITAL PAIRS:
====================
Alabama - Montgomery
Alaska - Juneau
Arizona - Phoenix
Arkansas - Little Rock
In: Computer Science
Compare and contrast two difference cloud computing services (Amazon Web Service and Microsoft Azure). Explain the differences and the similarities and select your choice of providers if you had to make the decision for your business. Write up a comparison on the services offered (2 pages maximum). Once again, it is essential that you use your own words (do not just copy and paste from the Internet).
In: Computer Science
(1) Why do several functions in iostream and fstream have identical names? When is it advantageous to reuse function names?
(2) Describe the five-step process of file I/O. Explain how to use ifstream and ofstream to open and close input and output files. Illustrate the process with the skeleton program provided in this section.
Please describe in details.
In: Computer Science
Thoroughly discuss a real-life example where a Boyer-Moore string search could be used.
In: Computer Science
In: Computer Science
State if the given statements are true or false by writing your answers (T for ``true’’ and F for ``false’’) in the last column of the following table.
(1) |
Some Internet-based companies store lot of information about Internet users, raising privacy concerns. |
|
(2) |
There is a concern that online disseminators of content are not fairly compensating the creators of the content, like an author, a stunt performer, an athlete, an educator, and an artist. |
|
(3) |
The world’s top five most-valued companies are all car-manufacturing companies. |
|
(4) |
There is no company in the area of computing whose market value has been above one trillion US dollars for many years. |
|
(5) |
There is a manufacturing company whose market value exceeds one trillion US dollars. |
In: Computer Science
I need to create a linked list that contains a fixed arraylist. Each new entry is added to array list. If the arraylist is full, create a new arraylist and add to the linklist. In java please.
In: Computer Science
A) Suppose owls is a MATLAB array with 251 rows and 51 columns representing the number of owls counted in the 251 counties in Texas had over the years 1960-2010. Write code to define a MATLAB variable to find the median number of owls counted in each county.
B) Suppose cattle is a MATLAB array with 251 rows and 51 columns representing the number of cattle in the 251 counties in Texas had over the years 1950-2000. Write code to define a MATLAB variable that contains the median number of cattle counted each year.
C) Suppose the Texas Department of Public Health is tracking the number of tuberculosis deaths in an array (TBDeaths, 30 by 48), representing the number of new tuberculosis related deaths in the 30 least populous counties (in order low to high) in Texas over the years 1960-2017. Write code to define a MATLAB variable that contains the overall minimum number of TB deaths cases in these counties during the recording period.
D) Suppose the Texas Department of Motor Vehicles is tracking the number of car, truck and motorcycle (respectively) crashes in Texas over the years 2000 to 2019 in an array TXCrash (3 x 20).
Write code to define a MATLAB variable that contains the number of
truck crashes for the year 2019.
In: Computer Science
Telecommunication Governance 1:
Note:Very Important to add at least 4 bibliographical sources and must cover at least 3 pages of information.
Explain in detail, illustrate examples and applications:
Define and explain Risk Appetite and Risk Tolerance and Threshold, explain their importance in the establishment of a sound ERM plan.
In: Computer Science
#include<vector>
#include<iostream>
using namespace std;
void println(const vector<int>& v)
{
for (int x : v)
cout << x << " ";
cout << endl;
}
void println(const vector<string>& v)
{
for (const string& x : v)
cout << " "<< x
<< " ";
cout << endl;
}
int main()
{
vector<int> v0;
cout << "An empty vector of integers: ";
println(v0);
vector<int> v1(3);
cout << "A vector with three "
<< "value−initialized
integers: ";
println(v1);
vector<string> v2(0);
cout << "A vector with three empty "
<< "strings: ";
println(v2);
vector<int> v3(3, 17);
cout << "A vector with three 17’s: ";
println(v3);
vector<int> v4(v3);
cout << "A copy of the previous vector: ";
println(v4);
v4.front() = 1;
v4.back() = 23;
cout << "The last vector with its first "
<< "and last elements changed
to 1 "
<< "and 23: ";
println(v4);
Create a function append(v1, v2) that adds a copy of all the elements of vector v1 to the end of vector v2. The arguments are vectors of integers. Write a test driver
In: Computer Science
A Fibonacci sequence, is a sequence of numbers with the property that each number is the sum of the two preceding Fibonacci numbers, starting from 0 and 1. Fibonacci number are usually denoted by Fn, where Fn is the nth Fibonacci number. Thus Fn = 0, and Fn = 1, and Fn = Fn-1 + Fn-2, n ≥ 2. Here are the first few Fibonacci numbers: F0=0 (by definition) F1=1 (by definition) F2 = F1 + F0 = 1 + 0 = 1 F3 = F2 + F1 = 1 + 1 = 2 F4 = F3 + F2 = 2 + 1 = 3 F5 = F4 + F3 = 3 + 2 = 5 F6 = F5 + F4 = 5 + 3 = 8 F7 = F6 + F5 = 8 + 5 = 13 F8 = F7+ F6 = 13 + 8 = 21 Write a C or C++ program that computes and prints F0 through F8 , one number per line, using a loop. For initialization purposes, you may assume F0 = 0, and F1 = 1. Write a C or C++ program that computes and prints F8 through F2 (i.e., in reverse order), one number per line, using a loop. For initialization purposes, you may assume F8 = 21, and F7 = 13.
In: Computer Science
A mobile terminal residing in a foreign network uses its home address to communicate with a correspondent node using normal routing mechanisms. The firewalls that are located at the edge of foreign or home network often discard such packets. Explain clearly what causes the firewall to discard such packets at the foreign network and at the home network. Briefly explain the solution offered by Mobile IP to address this problem.
In: Computer Science
In: Computer Science
PLEASE USE R PROGRAMMING LANGUAGE TO ANSWER THESE EXAMPLES. Also please explain any important reasons/tips for how you coded. Thank you!
The Basic Examples:
a) If Statements: Write code that generates a random variable x uniformly between 0 and 1. If x is bigger than 0.6, square it; if x is less than 0.3, set it equal to 5, otherwise set x = 0.
b) Forloops: Write a program that makes a vector of all zeros of length 5.Then write a for loop that fills in this vector with the squares of the integers from 1 to 5. This for loop should iterate over the numbers 1 to 5, square each one, and enter the result in the vector. Show the results in your output/report.
c) Functions: Write a function that takes a number as an input and squares it (so the output is the square of the input number). Rewrite your code from part b) to use your new function, and run the updated code. Do your results match the results you got in part b)?
In: Computer Science
why the resource planning required for security policy
In: Computer Science