Answer: <u>Bill Gate</u>, who is known as the king of computer programs
Hope this helps!
Answer:
The answer is "True".
Explanation:
The web page is also known as a home page when it collects more than one page, it is called website. In web page designing, it uses the HTML for design a page and is also available via the web or other networks.
- When we insert a URL address to the Web page, it means, it contains the text, graphics, and hyperlinks to other Web pages and files.
- It also displays all the data on the page, that's why the given statement is true.
Answer:
bears = {"Grizzly":"angry", "Brown":"friendly", "Polar":"friendly"}
for bear in bears:
if bears[bear] == "friendly":
print("Hello, "+bear+" bear!")
else:
print("odd")
Explanation:
A dictionary called bears is given. A dictionary consists of key-value pairs.
You need to check each key-value pairs in bears and find the ones that have "friendly" as value using a for loop and if-else structure. In order to access the values of the dictionary, use the dictionary name and the key (inside the loop, the key is represented as bear variable). If a key has a value of "friendly", print the greeting. Otherwise, print "odd".
Answer:
Here is the program for the given question
Explanation:
class StringSet
{
ArrayList<String> arraylist; //a reference variable of ArrayList of generic type String
//A no argument constructor.
public StringSet()
{
arraylist=new ArrayList<String>(); //instantiating the ArrayList object
}
//A mutator that adds a String newStr to the StringSet object.
void add(String newStr)
{
arraylist.add(newStr); // add(String) method to add string to the arraylist
}
//An accessor that returns the number of String objects that have been added to this StringSet object.
int size()
{
return arraylist.size(); // size() method which gives the number of elements in the list
}
//An accessor that returns the total number of characters in all of the Strings that have been added to this StringSet object.
int numChars()
{
int sum = 0;
for(String str:arraylist) //for-each loop; can be read as for each string in arraylist
{
sum+=str.length();
}
return sum;
}
//An accessor that returns the number of Strings in the StringSet object that have exactly len characters.
int countStrings(int len)
{
int count = 0;
for(String str:arraylist)
{
if(str.length() == len)
count++;
}
return count;
}
}