Answer:
C++.
Explanation:
#include <iostream>
#include <string>
using namespace std;
////////////////////////////////////////////////////////////
class Television {
string brand;
float screen_size;
bool powerOn;
int volume;
int channel;
public:
// Comments
Television(string brand, int screen_size) {
this->brand = brand;
this->screen_size = screen_size;
powerOn = false;
volume = 20;
channel = 2;
}
//////////////////////////////////////////
// Comments
int getVolume() {
return volume;
}
// Comments
int getChannel() {
return channel;
}
// Comments
string getManufacturer() {
return brand;
}
// Comments
float getScreenSize() {
screen_size;
}
///////////////////////////////////////////
// Comments
void setChannel(int channel) {
this->channel = channel;
}
// Comments
void power() {
if (!powerOn)
powerOn = !powerOn;
}
// Comments
void increaseVolume() {
volume = volume + 1;
}
// Comments
void decreseVolume() {
volume = volume - 1;
}
};
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;
}
}
Answer:
The DNS server has authority over the routing of the domain
Explanation:
Answer:
A
Explanation:
A system used for processing customer payments. A tool used to coordinate recruitment of new employees. A mobile app used by customers to place orders.