Create a file named A10.java. Place all your code in this file. Create a publicstatic ArrayList of integers named intList.
Define a public static method addNumber(int i) that adds ito your list.
Exercise 2
Create a publicstatic HashMap of integers,integers namedintMap.
Define a public static method addPair(int i,int j) that adds i,jto your HashMap (make ithe key and j the value).

Answers

Answer 1

Explanation:

The file named as A10.java has been attached to this response. It contains the source code for the exercises. The source code contains comments explaining important parts of the code.

A few things to note;

i. To add an item to an arraylist, the add() method is used. For example to add an integer 7 to the arraylist named intList, simply write;

intList.add(7);

ii. To add an item to a hashmap, the put() method is used. The put method receives two parameters which are the key and value respectively. The key is a form of identifier used to store or retrieve a particular value in a hashmap. To store an integer 8 with a key of 5 in a hashmap named intMap, for example, simply write;

intMap.put(5,8);


Related Questions

Suppose that the first goal in a GP problem is to make 3 X1 + 4 X2 approximately equal to 36. Using the deviational variables d1− and d1+, the following constraint can be used to express this goal.​

3 X1 + 4 X2 + d1− − d1+ = 36

If we obtain a solution where X1 = 6 and X2 = 2, what values do the deviational variables assume?

a. d1− = 0, d1+ = 10
b. d1− = 6, d1+ = 0
c. d1− = 5, d1+ = 5
d. d1− = 10, d1+ = 0

Answers

Answer:

d. d1− = 10, d1+ = 0

Explanation:

Given

3X1 + 4X2 +d1− − d1+ = 36

X1 = 6

X2 = 2

Required

Possible values of d1- and d1+

We have:

3X1 + 4X2 +d1− − d1+ = 36

Substitute values for X1 and X2

3 *6 + 4 * 2 + d1- - d1+ = 36

18 + 8 + d1- - d1+ = 36

Collect like terms

d1- - d1+ = 36 - 18 - 8

d1- - d1+ = 10

For the above equation to be true, the following inequality must be true

d1- > d1+

Hence,

(d) is correct

Because:

10 > 0

Saved In order to be used as a primary key, which of these characteristics must an attribute possess with respect to a single instance of the entity? Select all that apply. There must be a maximum of one attribute instance. There must be many instances of the attribute There must be at most one entity instance that each attribute instance describes. There must be at least one instance of the attribute. There must be zero or more instances of the attribute. Question 2 (2 points) True or false: A singular attribute is also known as a unique attribute. True False Question 3 (3 points) Saved Relationship names and types of relationship maxima or minima that each could have are listed below. Match each relationship in the list below to the type of relationship maxima or minima. Instructions: Choose your responses from the drop-down menus below. Response options cannot be used more than once. Minima is One-Zero 1 Person-Assigned Social SecurityNumber 4 Minima is Zero Zero 2 CubicleNumber-Assigned-to- Employee per shift 2 Maxima is One-Many 3. Birthdate-Recorded-for-a Person 1 Maxima is One One 4. Women-Bearing-Children Question 4 (2 points) Saved A ride-sharing app's discount system for riders is configured such that a ride discount is triggered only if at least two RiderlDs book a ride in the same Card at the same time. Which of the following is true of the relationship Ride Discount-is-Applicable?
The relationship minimum is Many-One.
The relationship minimum is Two-One.
The relationship maximum is One-Two.
The relationship minimum is One-Two.

Answers

Answer:

Saved In order to be used as a primary key, which of these characteristics must an attribute possess with respect to a single instance of the entity:

There must be a maximum of one attribute instance.

There must be many instances of the attribute.

There must be at most one entity instance that each attribute instance describes.

There must be at least one instance of the attribute.

A singular attribute is also known as a unique attribute. True

Saved Relationship names and types of relationship maxima or minima that each could have are listed below. True

Explanation:

In this lab, you complete a prewritten C++ program that computes the largest and smallest of three integer values. Instructions Two variables named largest and smallest are declared for you. Use these variables to store the largest and smallest of the three integer values. You must decide what other variables you will need and initialize them if appropriate. Your program should prompt the user to enter 3 integers. Write the rest of the program using assignment statements, if statements, or if else statements as appropriate. There are comments in the code that tell you where you should write your statements. The output statements are written for you. Execute the program by clicking the Run button at the bottom of the screen. Using the input of -50, 53, 78, your output should be: The largest value is 78 The smallest value is -50

Answers

Answer:

The program in C++ is as follows

#include <iostream>

using namespace std;

int main(){

   int n1, n2, n3, largest, smallest;

   cin>>n1>>n2>>n3;

   if(n1 >= n2 && n1>=n3){        largest = n1;    }

   else if(n2 >= n1 && n2>=n3){        largest = n2;    }

   else{        largest = n3;    }

   if(n1 <= n2 && n1<=n3){        smallest = n1;    }

   else if(n2 <= n1 && n2<=n3){        smallest = n2;    }

   else{        largest = n3;    }

   cout<<"Smallest: "<<smallest<<endl;

   cout<<"Largest: "<<largest<<endl;

   return 0;

}

Explanation:

Declare all variables

   int n1, n2, n3, largest, smallest;

Get input for the three numbers

   cin>>n1>>n2>>n3;

Check if n1 is the largest

   if(n1 >= n2 && n1>=n3){        largest = n1;    }

Check if n2 is the largest

   else if(n2 >= n1 && n2>=n3){        largest = n2;    }

Otherwise, n3 is the largest

   else{        largest = n3;    }

Check if n1 is the smallest

   if(n1 <= n2 && n1<=n3){        smallest = n1;    }

Check if n2 is the smallest

   else if(n2 <= n1 && n2<=n3){        smallest = n2;    }

Otherwise, n3 is the smallest

  else{        largest = n3;    }

Print the smallest

   cout<<"Smallest: "<<smallest<<endl;

Print the largest

   cout<<"Largest: "<<largest<<endl;

what are the physical aspect of a presentation​

Answers

Answer:

1. It has a clear objective.

2. It's useful to your audience.

3. It's well-rehearsed.

4. Your presentation deck uses as little text as possible.

5. Your contact information is clearly featured.

6. It includes a call-to-action.

Explanation:

Alex, a web designer, is assigned the task of creating a mobile device-friendly website for a leading fashion outlet called AllStyles. A desktop version of AllStyles's website already exists. Alex can refer to this desktop version of the website to create the mobile website design The desktop version of the website contains a long list of hyperlinks and this can obstruct the view of the main content when Viewed from a mobile device. Which of the following should Alex use to hide this long list of hypertext links so that it appears only in response to a tap of a major heading in the navigation list?
a. Navigator menus
b. Pulldown menus
c. Pop-up links
d. Header links

Answers

Answer: Pulldown menus

Explanation:

Pulldown menus refer to the graphical control element, that is identical to a list box, which enables user to be bake to select one value from a list.

They're regarded as the menu of options that will appear when an item is selected with a mouse. In this case, the item that the user selected will show at the top of the display screen, while the menu appears will show below it.

Therefore, Alex should use the pulldown menus to hide the long list of hypertext links so that it appears only in response to a tap of a major heading in the navigation list.

pleeeese help me for these questions

Answers

1 Account

2 online

3 access

4 password

5 internet

6 email

Write a single Python regular expression for each of the following. Note: For each problem, you must use only ONE regular expression.
Matches a string that has both the substring dog and cat in the string in either order. For instance, both of the following strings match: 'The dog chased the cat' and 'xxcatxxdogxx'.

Answers

Matches a string that has both the substring dog and car in the string in either order

Reverse Word Order: Write a program that reverses the order of the words in a given sentence. This program requires reversing the order of the words wherein the first and last words are swapped, followed by swapping the second word with the second to last word, followed by swapping the third word and the third to last words, and so on. Your program will ask the user for an input string and print out the resultant string where the order of the words is reversed. Please see the hints section for more details on an example algorithm. Assume a maximum C-string size of 1000 characters. Make sure your code works for any input number, not just the test cases. Your code will be tested on other test cases not listed here. Do Not Use Predefined Functions from the cstring Library. Please properly comment your code before submission.For this part of the assignment, name your source file as Reverse Word Order_WSUID.cpp. For example, if your user ID is A999B999 name your file as Reverse Word Order_A999B999.cpp. Sample Test Cases: Test Case 1: Input: London bridge has been abducted Output: abducted been has bridge London Test Case 2: Input: Hello World Output: World Hello Test Case 3: Input: Hello World, how are you? Output: you? Are how World, HelloTest Case 4: Input: I like toast Output: toast like l

Answers

Answer:

The program in C++ is as follows:

#include <bits/stdc++.h>

using namespace std;

int main(){

string sentence,word="";

getline (cin, sentence);

vector<string> for_reverse;

for (int i = 0; i < sentence.length(); i++){

 if (sentence[i] == ' ')  {

  for_reverse.push_back(word);

  word = "";  }

 else{    word += sentence[i];}  }

for_reverse.push_back(word);

sentence="";

for (int i = for_reverse.size() - 1; i > 0; i--){

 sentence+=for_reverse[i]+" ";}

sentence+=for_reverse[0];

cout<<sentence<<endl;

return 0;

}

Explanation:

This declares sentence and word as strings; word is then initialized to an empty string

string sentence,word="";

This gets input for sentence

getline (cin, sentence);

This creates a string vector to reverse the input sentence

vector<string> for_reverse;

This iterates through the sentence

for (int i = 0; i < sentence.length(); i++){

This pushes each word of the sentence to the vector when space is encountered

 if (sentence[i] == ' ')  {

  for_reverse.push_back(word);

Initialize word to empty string

  word = "";  }

If the encountered character is not a blank space, the character is added to the current word

 else{    word += sentence[i];}  }

This pushes the last word to the vector

for_reverse.push_back(word);  

This initializes sentence to an empty string

sentence="";

This iterates through the vector

for (int i = for_reverse.size() - 1; i > 0; i--){

This generates the reversed sentence

 sentence+=for_reverse[i]+" ";}

This adds the first word to the end of the sentence

sentence+=for_reverse[0];

Print the sentence

cout<<sentence<<endl;

The input to the function/method consists of two arguments.

a. True
b. False

Answers

Answer:

See Explanation

Explanation:

The function is not given. So, I will provide general explanation.

A function is defined as:

return-type function-name(argument-lists)

For instance, an int function that has 1 argument is:

int Myfunc(int num)

num is the argument of the function Myfunc

So, an example of a function with two arguments is:

int Myfunc(int num, string name)

So, examine the function in the complete question; then count the number of arguments to determine if the answer is true or false.

A computer never gets tired or bored while working for a long time _______​

Answers

Answer:

Diligence

Explanation:

The computer possess several qualities including tbe ability to be consistent with its task and accuracy of its output. When describing a person or machine that delivers so much over a long periodof time without being weary, bored or tired, such person or machine could be described as being Diligent. Depending on the task a computer is being used to execute, computer machines are usually being used in a non-stop manner. For instance, firms that works on shift basis may have 3 to 4 working shifts per day with each shift making use of the same computer used by the previous shift everyday for several number of days. Example are telecommunications customer service firms who work on a 24 hours basis.

is joining Together as a group to use a specific product more efficiently

Answers

[tex]\sf\purple{Collaborative \:consumption}[/tex] is joining together as a group to use a specific product more efficiently.

[tex]\bold{ \green{ \star{ \orange{Hope\:it\:helps.}}}}⋆[/tex]

which one is exit controllefd loop ?
1.while loop
2. for loop
3. do loop
4. none

Answers

Answer:

2 is the ans

Explanation:

bye bye, gonna go to studyy

Think about that the C, B and S parameters of a Cache. Think about what happens to compulsory, capacity, conflict misses, if only each of the following parameter changed (the other two are kept the same)?
(i) C is increased (S, B same)
(ii) S is increased (C, B Same)
(iii) B is increased (C, S Same)

Answers

Answer:

(i) C is increased (S, B same)

Explanation:

Cache are items which are stored in the computer at a hidden place. These are sometimes unwanted and they may hinder the speed and performance of the device. They exist to bridge speed gap.

When you have access to a multiuser computer system, what responsibilities do you have when selecting your password?

Answers

Answer:

The responsibilities you have are Use characters other than just AZ. If passwords are chosen from the letters AZ, there are only 26 possibilities for each character. Adding digits expands the number of possibilities to 36. Using both uppercase and lowercase letters plus digits expands the number of possible characters to 62

Explanation:

Hoped this helped you :3

What has happened (or is still happening) to make this speech occur? armageddon

Answers

Answer:

Are you talking about the bruce willis is superman basically? Because if so i don't think so because that is a future event that hasn't happened yet also that film sucks.

Explanation:

Write a c++ program to find;
(I). the perimeter of rectangle.
(ii). the circumference of a circle.

Note:
(1). all the programs must allow the user to make his input .
(2).both programs must have both comment using the single line comment or the multiple line comment to give description to both programs.​

Answers

Answer:

Perimeter:

{ \tt{perimeter = 2(l + w)}}

Circumference:

{ \tt{circumference = 2\pi \: r}}

Just input the codes in the notepad

solve the average of 4 numbers and display fail if grade is below 60​

Answers

Need a better discription of the question to finalize an answer.

In a paragraph, describe in detail a practical real-world example of where you would implement a singly-linked list and why a singly-linked list is best for this use. Do not list the properties of a singly-linked list....
Rather identify a real-world example or application. If you identify this through research, cite your source.

Answers

Answer:

travel

Explanation:

One real world example of a singly-linked list would be travel. Imagine that you want to take a trip to your nearest neighbor state. To do so you would need to take a 2 buses and a train, but you can't just take any or in any order you wish. You first need to take the first bus at your current location, get off at the train station, take that train to the final stop, get off and take the bus to the final destination. Meaning there is a sequence of connected events that you must follow in order to get to your destination and the same opposite sequence of events to get back. This is exactly like a singly-linked list.

Làm thế nào để hack mật khẩu trên 1 trang web

Answers

Heuwieieididbzhdysudududhhxydydy
Trang web Hacker mật khẩu
Password Hacker hoặc Cracker đề cập đến cá nhân cố gắng bẻ khóa từ, cụm từ hoặc chuỗi ký tự bí mật được sử dụng để truy cập vào dữ liệu được bảo mật. Hack mật khẩu thường được gọi là bẻ khóa mật khẩu. Trong trường hợp chính hãng, kẻ tấn công mật khẩu cố gắng khôi phục mật khẩu từ dữ liệu được truyền qua hoặc được lưu trữ trên máy tính.

Quản trị viên hệ thống có thể sử dụng hack mật khẩu như một chiến thuật phòng ngừa, để giúp người dùng hợp pháp lấy lại mật khẩu đã quên. Bên cạnh đó, nó cũng giúp họ dễ dàng theo dõi mật khẩu bị tấn công để sửa đổi chúng nhằm tăng tính bảo mật.

Tội phạm mạng và những kẻ lừa đảo trực tuyến hack mật khẩu để có được quyền truy cập vào một hệ thống an toàn. Mục đích của họ là độc hại và nó thường xoay quanh việc kiếm tiền thông qua các phương tiện bất hợp pháp.

Làm thế nào để Crack và Hack mật khẩu?
Về cơ bản, có hai phương pháp được sử dụng để hack mật khẩu - một là phương pháp vũ phu và phương pháp kia là bằng cách đoán.

Brute Force: Trong phương pháp brute force, một hacker có mật khẩu cố gắng nhập mọi tiềm năng. Hãy thử cWatch ngay hôm nay! trình tự mật khẩu để tìm ra mật khẩu. Cho đến nay, phương pháp này là phương pháp hiệu quả để kẻ tấn công mật khẩu kết luận về hàm băm mật khẩu, hoặc tính toán toán học hoặc thuật toán, được sử dụng để mã hóa hoặc mã hóa dữ liệu mật khẩu.

Đoán: Trong phương pháp đoán, một hacker mật khẩu có thể sử dụng thông tin cá nhân của chủ sở hữu mật khẩu để tìm ra mật khẩu. Ngày sinh, vật nuôi, người thân hoặc thông tin khác của chủ sở hữu mật khẩu đều được sử dụng để đoán mật khẩu chính xác.

Fill in the necessary blanks to list the name of each trip that does not start in New Hampshire (NH) Use the Colonial Adventure Tour Database listing found on the Canvas webpage under Databases or in the text.
SELECT TripName
FROM______
WHERE Trip____ ____NH:

Answers

Answer:

SELECT TripName

FROM AllTrips

WHERE Trip NOT LIKE ‘NH%'

Explanation:

Required

Fill in the blanks

The table name is not stated; so, I assumed the table name to be AllTrips.

The explanation is as follows:

This select the records in the TripName column

SELECT TripName

This specifies the table where the record is being selected

FROM AllTrips

This states the fetch condition

WHERE Trip NOT LIKE ‘NH%'

Note that:

The wild card 'NH%' means, record that begins with NHNot means opposite

So, the clause NOT LIKE 'NH%' will return records that do not begin with NH

Functions should contain only the code that performs a single task.
O True
O False

Answers

Answer:

false

Explanation:

function should contain more codes

Regarding the role played by the “victim” in deadlock resolution, give an example of such a deadlock in real life and explain your answers to these questions.

a. Describe how you might choose the victim to be removed and the consequences, both positive and negative, of that removal.

b. Describe the fate of the victim and the chances of eventually completing its processing.

c. Describe the actions required, if any, to complete the victim’s tasks. ​

Answers

Answer:

Here the answer is given as follows,

Explanation:  

The real-life situation of a deadlock resolution where a role is played by the victim is given as follows:  

Example: An example of such a situation are often a one-way lane where the flow of traffic is merely in a method. Thus, on just one occasion, the flow of traffic can enter one direction only. Each entrance/exit gate is often considered a resource. during this case, if two cars are coming from both the entrances and that they are often considered as two tasks, then one among the cars must copy or we will say hand over its resource in order that the opposite car gets the prospect to first cross the lane or we will say the opposite task gets executed.  

 a)  Victim: The steps which describe how a victim is chosen are given as follows :  

   The task which is terminated so as to interrupt things of deadlock is taken into account because of the victim.

There are often a variety of job pools that will be under a deadlock situation and therefore the victim is usually a low-priority task in order that the performance isn't affected that much and termination of this task doesn't cause any effect on the opposite jobs.

the main positive effect of selecting and terminating a victim is that things of deadlock are resolved and every one of the tasks can execute now.

The negative effect is that the task that's chosen because the victim is terminated and is executed at the previous. This whole process for choosing a victim then terminating it then restarting it again may consume some longer also.

b)  An easy deadlock priority is often set. this suggests that the victim’s task or the task is often terminated so as to interrupt the deadlock and other jobs can finish executing. After this, the task which is terminated are often later restarted and every one of the tasks can then execute without a deadlock.

 c) When employment gets terminated, the knowledge associated with it's stored. Are often This is often done in order that the work can be restarted again and therefore the information in it's not lost. Since the progress of the victim is stopped. Thus, the sole thanks to complete the victim’s task would be to start out it again. But before restarting the task, this must be considered that the victim’s task doesn't cause any deadlock within the system.  

Design traffic lights at an intersection of a city.  North and South (up and down) are going to be a main highway, East and West (right and left) will be a smaller cross street.  There will be no turn signals and no cross walks.  You only need to build/code one set of lights for each street (one set of green, yellow, and red for the highway, and another set for the cross street).  You do not need to build actual traffic lights or an intersection. 

Answers

Answer:

Explanation:

The following code is written in Java. In order to code this efficiently, I created a class for the trafficLights. The class contains the currentLight, and the streetType as variables and contains a constructore, getter and setter methods, and a method to turn to the next light in the sequence. Then I created 4 objects of TrafficLights for the highways and the streets.

class Brainly {

   public static void main(String[] args) {

       TrafficLights highwaySouth = new TrafficLights("Highway", "green");

       TrafficLights highwayNorth = new TrafficLights("Highway", "green");

       TrafficLights streetEast = new TrafficLights("Street", "yellow");

       TrafficLights streetWest = new TrafficLights("Street", "red");

   }

}

class TrafficLights {

   String streetType, currentLight;

   public TrafficLights(String streetType, String currentLight) {

       this.streetType = streetType;

       this.currentLight = currentLight;

   }

   public void nextLight() {

       if (this.currentLight == "green") {

           this.currentLight = "yellow";

       } else if (this.currentLight == "yellow") {

           this.currentLight = "red";

       } else {

           this.currentLight = "green";

       }

   }

   public String getStreetType() {

       return streetType;

   }

   public void setStreetType(String streetType) {

       this.streetType = streetType;

   }

   public String getCurrentLight() {

       return currentLight;

   }

   public void setCurrentLight(String currentLight) {

       this.currentLight = currentLight;

   }

}

After the explosion of the Union Carbide plant the fire brigade began to spray a curtain of water in the air to knock down the cloud of gas.a. The system of water spray pipes was too high to helpb. The system of water spray pipes was too low to helpc. The system of water spray pipes broked. The system of water spray pipes did not have sufficient water supply

Answers

Answer:

d. The system of water spray pipes did not have sufficient water supply

Explanation:

The Union Carbide India Ltd. was chemical factory situated at Bhopal that produces various pesticides, batteries, plastics, welding equipment, etc. The plant in Bhopal produces pesticides. In the year 1984, on the night of 2nd December, a devastating disaster occurred on the Bhopal plant which killed millions of people due to the leakage of the poisonous, methyl isocyanate. This disaster is known as Bhopal Gas tragedy.

Soon after the gas pipe exploded, the fire brigade started spraying water into the air to [tex]\text{knock down}[/tex] the cloud of the gases in the air but there was not sufficient amount of water in the water sprays and so it was not effective.

Thus the correct answer is option (d).

different between internet and email​

Answers

Answer:

The internet allows you to connect with people and information around the world. The internet is more broad and could include searching things up or message-based websites. Emails is more specific, with it being when you send someone a message (called an email) on a mail website (that allows you to get messages from other people, websites, etc.)

Explanation:

In my answer.

Explain in details:
(i) Deadlock
(ii) File manager
(iii) Process
(iv) Multiprogramming
(v) Software Classification
(vi) Virtual memory

Answers

Answer and Explanation:

Deadlock occurs when two operating systems on the same computer are hindering each other's execution, getting blocked, waiting for each one to run first. This can happen when a preemption has not occurred, when a mutual exclusion has occurred, or when one of the systems causes the other to not execute.

File manager is software that allows a computer user to create directories and organize files inside and outside of them.

Process is the term used to determine the functioning of computer software. When a software is started, it uses its own programming code to perform a specific activity.

Multiprogramming is the term used for the moment when an operating system allows the user to run more than one software at the same time. For this to happen, the computer needs to have a high processing capacity, to handle the effort of running several software simultaneously.

Software Classification is the process that determines the composition and different aspects that make up a software. In this way, it is possible to understand the usefulness and programming of this software.

Virtual memory is the use of secondary memory for caching. This allows the user to share files more securely and quickly, in addition to alleviating the problems that limited memory presents.

While saving a document to her hard drive, Connie's computer screen suddenly changed to display an error message on a blue background. The error code indicated that there was a problem with her computer's RAM. Connie's computer is affected by a(n) __________.

Answers

Answer:

The right answer is "Hardware crash".

Explanation:

According to the runtime error message, this same RAM on your machine was problematic. This excludes file interoperability or compliance problems as well as program error possibilities.Assuming implementation performance problems exist, the timeframe that would save the information would be typically longer, but there's still a lower possibility that the adequacy and effectiveness color will become blue but instead demonstrate warning would appear.

Thus the above is the right solution.

what's the difference between pseudo code and natural language​

Answers

Answer:

The pseudo-code describes steps in an algorithm or another system in plain language. Pseudo-Code is often designed for human reading rather than machine reading with structural conventions of a normal language of programming.

Natural languages consist of phrases, usually declarative phrases, with a sequence of information.

Explanation:

Pseudo-Code is often designed for human reading rather than machine reading with structural conventions of a normal language of programming. It usually omits information that is essential to the understanding of the algorithm by the machine, for example, variable declarations and language code.Easily human, but not machines, use the natural languages (like English).Natural languages also are creative. Poetry, metaphor, and other interpretations are permitted. Programming permits certain style differences, but the significance is not flexible.The aim of using pseudo-code is to make it easier for people to comprehensibly than standard programming language code and to describe the key principles of an algorithm efficiently and environmentally independently. It is usually used for documenting software and other algorithms in textbooks and scientific publications.

The following program generates an error. Why? #include #include using namespace std; class Arcade { public: Arcade(); Arcade(string name, int r); void Print(); private: string arcName; int rating; }; Arcade:: Arcade() { arcName = "New"; rating = 1; } Arcade:: Arcade(string name, int r) { arcName = name; rating = r; } void Arcade:: Print() { cout << "Name is: " << arcName << endl; cout << "Rating is: " << rating << " stars" << endl; } int main() { Arcade myArc(Games Ablaze, 5); myArc.Print(); }

Answers

Answer:

The object creation should be Arcade myArc("Games Ablaze",5);

Explanation:

Required

Why does the program generate an error?

The class definition is correctly defined and implemented;

The methods in the class are also correctly defined and implemented.

The error in the program is from the main method i.e.

int main() {  

       Arcade myArc('ames Ablaze, 5);  

       myArc.Print();  

   }

In the class definition;

Variable name was declared as string and variable rating was declared as integer

This means that, a string variable or value must be passed to name and an integer value or variable to rating.

Having said that:

Arcade myArc(Games Ablaze, 5); passes Games Ablaze as a variable to th function.

Game Ablaze is an incorrect string declaration in C++ because of the space in between Game and Ablaze

Also, no value has been assigned to the variable (assume the variable definition is correct).

This will definitely raise an error.

To correct the error, rewrite the object creation as:

Arcade myArc("Games Ablaze",5); where "Game Ablaze" is passed as string

Determine whether or not the following pairs of predicates are unifiable. If they are, give the most-general unifier and show the result of applying the substitution to each predicate. If they are not unifiable, indicate why. Assume that x, y, and z are variables, while other symbols are either predicates, constants, or functions.
a) P(B,A,B), P(x,y,z)
b) P(x,x), Q(A,A)
c) Older(Father(y),y), Older(Father(x),John).
d) Q(G(y,z),G(z,y)), Q(G(x,x),G(A,B)
e) P(f(x), x, g(x)), P(f(y), A, z)

Answers

Answer:

a) P(B,A,B), P(x,y,z)

=> P(B,A,B) , P(B,A,B}  

Hence, most general unifier = {x/B , y/A , z/B }.

b. P(x,x), Q(A,A)  

No mgu exists for this expression as any substitution will not make P(x,x), Q(A, A) equal as one function is of P and the other is of Q.

c. Older(Father(y),y), Older(Father(x),John)

Thus , mgu ={ y/x , x/John }.

d) Q(G(y,z),G(z,y)), Q(G(x,x),G(A,B))

=> Q(G(x,x),G(x,x)), Q(G(x,x),G(A,B))  

This is not unifiable as x cannot be bound for both A and B.

e) P(f(x), x, g(x)), P(f(y), A, z)    

=> P(f(A), A, g(A)), P(f(A), A, g(A))  

Thus , mgu = {x/y, z/y , y/A }.

Explanation:  

Unification: Any substitution that makes two expressions equal is called a unifier.  

a) P(B,A,B), P(x,y,z)  

Use { x/B}  

=> P(B,A,B) , P(B,y,z)  

Now use {y/A}  

=> P(B,A,B) , P(B,A,z)  

Now, use {z/B}  

=> P(B,A,B) , P(B,A,B}  

Hence, most general unifier = {x/B , y/A , z/B }  

b. P(x,x), Q(A,A)  

No mgu exists for this expression as any substitution will not make P(x,x), Q(A, A) equal as one function is of P and the other is of Q  

c. Older(Father(y),y), Older(Father(x),John)  

Use {y/x}  

=> Older(Father(x),x), Older(Father(x),John)  

Now use { x/John }  

=> Older(Father(John), John), Older(Father(John), John)  

Thus , mgu ={ y/x , x/John }  

d) Q(G(y,z),G(z,y)), Q(G(x,x),G(A,B))  

Use { y/x }  

=> Q(G(x,z),G(z,x)), Q(G(x,x),G(A,B))

Use {z/x}  

=> Q(G(x,x),G(x,x)), Q(G(x,x),G(A,B))  

This is not unifiable as x cannot be bound for both A and B  

e) P(f(x), x, g(x)), P(f(y), A, z)  

Use {x/y}  

=> P(f(y), y, g(y)), P(f(y), A, z)  

Now use {z/g(y)}  

P(f(y), y, g(y)), P(f(y), A, g(y))  

Now use {y/A}  

=> P(f(A), A, g(A)), P(f(A), A, g(A))  

Thus , mgu = {x/y, z/y , y/A }.

Other Questions
Act 4. Scene 5Juliet is extremely selfish for what she does"Find reasons to support this statement:Find quotations to support your reasons:"Juliet is just afraid and not thinking clearly."Find reasons to support this statement:Find quotations to support your reasons:"Juliet is justified in lying to her parents."Find reasons to support this statement:Find quotations to support your reasons:"Juliet just lacks proper guidance and advice."Find reasons to support this statement:Find quotations to support your reasons: Arla's family is on a tight budget but enjoys shopping for fresh groceries every week. They have a few grocery stores close to their home with transportation available, and Arla's mom keeps track of weekly ads in the papers they receive in the mail, along with any offers she sees online for specific brands. What would be the BEST option for Arla's family? A. Shopping at a big box store that requires a membership B. Shopping at a local upscale store for fresh food C. Shopping weekly sales to save money on fresh items D. Shopping with a delivery service to bring their food home TIME REMAINING01:55:49Which is the graph of f(x) = x2 - 2x + 3?22 3Mark this and retumSave and ExitNextSubmit Sodium fluoroacetate (NaOCHF) is a common poison used in New Zealand to control invasive species, such as rats. It can be prepared by the substitution of a C-Cl bond in sodium chloroacetate (NaOCHCl) for a C-F bond. What is the approximate enthalpy change for this substitution reaction on a 1.500 mole sample, based on the following bond energies?C-Cl = 339.0 kJ/molC-F = 485.0 kJ/mol Assignment Directions:Part 1:Draw or create an image of different water sources on Earth by using computer software or hand drawing. Show on your image how much each source contributes to the total amount of water on Earth.Part 2:Then, find out where the drinking water for your community comes from, which can be accomplished by computer research or by talking to someone at your local Chamber of Commerce.Part 3:Use your picture to design a radio or TV commercial to educate your community about where their drinking water comes from and the amount of freshwater that is available to all humans.Include at least three ways to conserve water in your commercial.Assignment Guidelines:Good use of creativityLogical presentation and easy to follow informationCorrectly describes each water source and its percentage of the total water on EarthCorrectly describes importance of not wasting water and includes three conservation techniques.Submission Requirements:An image/drawingInformation gathered regarding source of drinking waterCommercial about drinking waterWhen submitting written assignments, please remember to:Submit the assignment question(s) and your responses.Proofread for spelling, grammar, and punctuation.Remember complete sentence structure.Paragraphs need to have minimum of six sentences. One modern town that was originally built to serve the railroads was Orhan I was son of Osman I andbecame the first to be calledor leader of theOttoman Empire.A. SultanB. EmporerC. King Conquerer A car takes a full round of journey in a roundabout with constant speed, as the driver got confused with the route. Can we consider it as a uniform motion? Why? What is ironic about Midas wish? anyone?? hhee please An individual works downtown and pays $600 per month in rent for an apartment located 10 miles from her office. She has calculated that she spends 30 minutes per day driving each way to the office and it costs her $4 per day in gas and lost productivity. Using the framework of the bid-rent model, how much would she be willing to pay for an apartment downtown, assuming a 20 workday month?a. $440.b. $680.c. $520.d. $80. Guided PracticeType your answer and then click or tap Done.What is the contracted form of the words in bold?HAVE NOT IS BOLDThey have not told us anything. Find the equation for thefollowing parabola.Focus (0,5)Directrix y = -5A. y2 = 20%B. X2 = 5yC. X2 = 20D. y2 = 5x Why do you think Hitler did not make a land invasion of England ? Was it because navy of doing it or because he wanted to invade ( and destroy the Soviet Union Why do you think this ? The mean age of 5 peoplein a room is36 yearsA person enters the room.The mean age is now 36What is the age of the person whoentered the room? Great Britain had many colonies in North America. What was the purpose of these colonies according to the ideas of mercantilism? Recent incidents of food contamination have caused great concern among consumers. An article reported that 31 of 80 randomly selected Brand A brand chickens tested positively for either campylobacter or salmonella (or both), the leading bacterial causes of food-borne disease, whereas 61 of 80 Brand B brand chickens tested positive.Required:a. Does it appear that the true proportion of non-contaminated Perdue broilers differs from that for the Tyson brand? Carry out a test of hypotheses using a significance level 0.01 by obtaining a P-value. b. If the true proportions of non-contaminated chickens for the Perdue and Tyson brands are 0.50 and 0.25, respectively, how likely is it that the null hypothesis of equal proportions will be rejected when a 0.01 significance level is used and the sample sizes are both 80? Airline F leases all its aircraft under finance leases. Airline O leases all its aircraft under operating leases. Assuming that the two airlines report under US GAAP and are otherwise identical except for the mentioned lease classifications, which of the following comments is true?a. Airline O has lower rent expense reported on its income statement b. Airline F has a lower EBITDA margin c. None of the listed answers d. Airline O has more lease liabilities e. Airline O has less lease assets at the inception of the lease How many teaspoons of salt can be added in a glass of water? Question 1 (Essay Worth 10 points)(02.01;02.02 MC)The ratio of the number of cups of red paint to the number of cups of yellow paint that Garcia mixed to make a shade of orange paint is 4:1.Part A: Write a sentence to describe the number of cups of red paint that Garcia mixed with each cup of yellow paint. (4 points)Part B: How many cups of yellow paint should Garcia add to each cup of red paint to make the shade of orange? Explain your reasoning. (4 points)Part C: If Garcia purchased 6 cups of red paint for $42, what is the unit price per cup of red paint? (2 points)