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 1

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


Related Questions

computer is an ............. machine because once a task is intitated computer proceeds on its own t ill its completion.​

Answers

Answer:

I think digital,versatile

computer is an electronic digital versatile machine because once a task is initiated computer proceeds on its own till its completation.

How are dates and times stored by Excel?​

Answers

Answer:

Regardless of how you have formatted a cell to display a date or time, Excel always internally stores dates And times the same way. Excel stores dates and times as a number representing the number of days since 1900-Jan-0, plus a fractional portion of a 24 hour day: ddddd. tttttt

Explanation:

mark me as BRAINLIEST

follow me

carry on learning

100 %sure

Dates are stored as numbers in Excel and count the number of days since January 0, 1900. Times are handled internally as numbers between 0 and 1. To clearly see this, change the number format of cell A1, B1 and C1 to General. Note: apparently, 42544 days after January 0, 1900 is the same as June 23, 2016

Examine the following output:
4 22 ms 21 ms 22 ms sttlwa01gr02.bb.ispxy.com [154.11.10.62]
5 39 ms 39 ms 65 ms placa01gr00.bb.ispxy.com [154.11.12.11]
6 39 ms 39 ms 39 ms Rwest.plalca01gr00.bb.ispxy.com [154.11.3.14]
7 40 ms 39 ms 46 ms svl-core-03.inet.ispxy.net [204.171.205.29]
8 75 ms 117 ms 63 ms dia-core-01.inet.ispxy.net [205.171.142.1]
Which command produced this output?
a. tracert
b. ping
c. nslookup
d. netstat

Answers

Answer:

a. tracert

Explanation:

Tracert is a computer network diagnostic demand which displays possible routes for internet protocol network. It also measures transit delays of packets across network. The given output is produced by a tracert command.

Write a method that prints on the screen a message stating whether 2 circles touch each other, do not touch each other or intersect. The method accepts the coordinates of the center of the first circle and its radius, and the coordinates of the center of the second circle and its radius.

The header of the method is as follows:

public static void checkIntersection(double x1, double y1, double r1, double x2, double y2, double r2)


Hint:

Distance between centers C1 and C2 is calculated as follows:
d = Math.sqrt((x1 - x2)2 + (y1 - y2)2).

There are three conditions that arise:

1. If d == r1 + r2
Circles touch each other.
2. If d > r1 + r2
Circles do not touch each other.
3. If d < r1 + r2
Circles intersect.

Answers

Answer:

The method is as follows:

public static void checkIntersection(double x1, double y1, double r1, double x2, double y2, double r2){

    double d = Math.sqrt(Math.pow((x1 - x2),2) + Math.pow((y1 - y2),2));

    if(d == r1 + r2){

        System.out.print("The circles touch each other");     }

    else if(d > r1 + r2){

        System.out.print("The circles do not touch each other");     }

    else{

        System.out.print("The circles intersect");     }

}

Explanation:

This defines the method

public static void checkIntersection(double x1, double y1, double r1, double x2, double y2, double r2){

This calculate the distance

    double d = Math.sqrt(Math.pow((x1 - x2),2) + Math.pow((y1 - y2),2));

If the distance equals the sum of both radii, then the circles touch one another

    if(d == r1 + r2){

        System.out.print("The circles touch each other");     }

If the distance is greater than the sum of both radii, then the circles do not touch one another

   else if(d > r1 + r2){

        System.out.print("The circles do not touch each other");     }

If the distance is less than the sum of both radii, then the circles intersect

   else{

        System.out.print("The circles intersect");     }

}

HELP ITS A TESTTT!!!Which symbol shows auto correct is in use?

A-a white light bulb
B-A green plus sign
C-A flashing red circle
D-A yellow lightning bolt

Answers

After careful consideration the answer to this problem looks to be D

Answer:

D

Explanation:

The compound known as butylated hydroxytoluene, abbreviated as BHT, contains carbon, hydrogen, and oxygen. A 1.501 g sample of BHT was combusted in an oxygen rich environment to produce 4.497 g of CO2(g) and 1.473 g of H2O(g). Insert subscripts below to appropriately display the empirical formula of BHT.

Answers

Answer:

C15H24O

Explanation:

n(C) = 4.497 g/44g/mol = 0.1022

Mass of C = 0.1022 × 12 = 1.226 g

n(H) = 1.473g/18 g/mol = 0.0823 ×2 moles = 0.165 moles

Mass of H = 0.0823 × 2 ×1 = 0.165g

Mass of O= 1.501 -(1.226 + 0.165)

Mass of O= 0.11 g

Number of moles of O = 0.11g/16g/mol = 0.0069 moles

Dividing through by the lowest ratio;

0.1022/0.0069, 0.165/0.0069, 0.0069/0.0069

15, 24, 1

Hence the formula is;

C15H24O

Answer

The formula is C1SH240

The following pseudocode describes how a widget company computes the price of an order from the total price and the number of the widgets that were ordered. Read the number of widgets. Multiple the number of widgets by the price per widget of 9.99. Compute the tax (5.5 percent of the total price). Compute the shipping charge (.40 per widget). The price of the order is the sum of the total widget price, the tax, and the shipping charge. Print the price of the order

Answers

Answer:

The program in Python is as follows:

widget = int(input("Widgets: "))

price = widget * 9.9

tax = price * 0.55

ship = price * 0.40

totalprice = price + tax + ship

print("Total Price: $",totalprice)

Explanation:

The question is incomplete, as what is required is not stated.

However, I will write convert the pseudocode to a programming language (in Python)

Get the number of widgets

widget = int(input("Widgets: "))

Calculate price

price = widget * 9.9

Calculate the tax

tax = price * 0.55

Calculate the shipping price

ship = price * 0.40

Calculate the total price

totalprice = price + tax + ship

Print the calculated total price

print("Total Price: $",totalprice)

The _________ attack exploits the common use of a modular exponentiation algorithm in RSA encryption and decryption, but can be adapted to work with any implementation that does not run in fixed time.
A. mathematical.
B. timing.
C. chosen ciphertext.
D. brute-force.

Answers

Answer:

chosen ciphertext

Explanation:

Chosen ciphertext attack is a scenario in which the attacker has the ability to choose ciphertexts C i and to view their corresponding decryptions – plaintexts P i . It is essentially the same scenario as a chosen plaintext attack but applied to a decryption function, instead of the encryption function.

Cyber attack usually associated with obtaining decryption keys that do not run in fixed time is called the chosen ciphertext attack.

Theae kind of attack is usually performed through gathering of decryption codes or key which are associated to certain cipher texts

The attacker would then use the gathered patterns and information to obtain the decryption key to the selected or chosen ciphertext.

Hence, chosen ciphertext attempts the use of modular exponentiation.

Learn more : https://brainly.com/question/14826269

Other Questions
tolong saya jawab yahhh World War 1 took place from ______________ to _____________, and was known during that time as the ___________________________ . How did Ethiopia respond to Italian attempts to colonize its territory in the19th century?A. It formed a close alliance with Italy that allowed African leaders toremain in power.B. It launched a successful military campaign to force Italy to give upits claim.C. It invited other European imperial powers to share control of itsterritory with ItalyO D. It organized an emigration campaign that led most of itspopulation to leave the country.SUBMIT- PREVIOUS Defined the total variation distance to be a distance TV(P,Q) between two probability measures P and Q. However, we will also refer to the total variation distance between two random variables or between two pdfs or two pmfs, as in the following.Compute TV(X,X+a) for any a(0,1), where XBer(0.5).TV(X,X+a) = ? PLEASE HELP MEplease anyone just please help me!!!! I AM SO CONFUSED AND HAVING A MENTAL BREAKDOWN THIS IS DUE IN 5 MINS AND I CANT AFFORD TO GET A BAD GRADE ON THIS PLEASEPLEASE HELP ME (please right in 7th grade language)Describe how the First Emperor of Qins ruling style compares to Alexander the Great in TWO paragraphs urrent Attempt in Progress Wildhorse Chemicals management identified the following cash flows as significant in its year-end meeting with analysts: During the year Wildhorse had repaid existing debt of $317,900 and raised additional debt capital of $645,200. It also repurchased stock in the open market for a total of $44,750. What is the net cash provided by financing activities What is the weight of one boxe of a 165 ounces Why did Appeasement of Hitler/Germany fail to prevent WW2? Rita did not care what her parents had said last night; she was glad things were changing. They might be willing to overlook the ratty textbooks and dingy classrooms at the old high school, but Rita was glad she and her classmates would be attending Somerset High in the fall. The first few days would be terrifying; Rita could barely imagine what she would wear or say. She knew people would protest outside, but she also knew she could prove herself among the white kids. She looked forward to her first new textbook, her first test, and her first A.What historical reality is represented in this fictional paragraph about the 1960s?political action taken over segregationyouths rebellion during this decadeeducational testing during this eramixed reactions to racial integration A 3-kg projectile is launched at an angle of 45o above the horizontal. The projectile explodes at the peak of its flight into two pieces. A 2-kg piece falls directly down and lands exactly 50 m from the launch point. Determine the horizontal distance from the launch point where the 1-kg piece lands. If a company purchases equipment costing $4,500 on credit, the effect on the accounting equation would be: Assets increase $4,500 and liabilities decrease $4,500. Liabilities decrease $4,500 and assets increase $4,500. Equity decreases $4,500 and liabilities increase $4,500. Assets increase $4,500 and liabilities increase $4,500. (Score for Question 3: of 9 points)3. How did the railroads impact Seattle, Tacoma, and Spokane during this time? Describe how each city was impacted.Answer:type your answer here Study the graph showing US public opinion from 1965 to 1970.A triple bar graph titled Was Sending Troops to Vietnam a Mistake? The x-axis is labeled Year from 1965 to 1970. The y-axis is labeled Percent of Responders from 0 to 90. The left bar is labeled yes. The middle bar is labeled no. The right bar is labeled no opinion. In 1965, over 20 percent say yes, 60 percent say no, and 15 percent have no opinion. In 1967, 40 percent say yes almost 50 percent say no, and 10 percent have no opinion. In 1970, over 50 percent say yes, over 30 percent say no, and 10 percent have no opinion.Which statement about the Vietnam War is supported by the data in the graph?The war was increasingly unpopular.The wars success led to greater support.The war was of little importance to most Americans.The wars support did not change drastically over time. PLEASEEEE HELP QUICKKKK A historian could best use this map to study which topic?1. O United Nations membership2. O Cold War confrontations3.Decolonization efforts4. O Genocide refugee camp sitesHelp!!! Shirts-2-Go sells t-shirts for a base price of $12 per shirt plus a fixed fee of $3 shipping and handling for the whole order. Shirts PLUS sells t-shirts for a base price of $8 per shirt plus a fixed fee of $23 shipping and handling for the whole order. Let x represent the number of shirts ordered and let y represent the total cost of the order.y = 12x + 3y = 8x + 23How many shirts would you have to purchase for the total cost to be the same at both companies? Perform the transformations can I get a walkthrough on these problems please? Jean-Jacques DessalinesFoi um lder na Revoluo Haitiana, proclamou a independncia do pas, em 1 de janeiro de 1804, sendo seu primeiro governante.Verdadeiro Falso Question 1Which of the following numbers is greater than 6 and less than 8?60O 78070