GIven an array A and B of the same length, create an array C, C[i] can be either A[i] or B[i], such that the MEX (Minimum Excluded Positive Integer) of C is minimized. Return the MEX of C. Given an algo in C++
Assume 1 <= length (A/B) <=10000
1 <= A[i], B[i] <=1e9

Answers

Answer 1

Here's an algorithm in C++ to solve the problem:

#include <iostream>

#include <vector>

#include <unordered_set>

using namespace std;

// Function to get the Minimum Excluded positive integer (Mex) from a vector of integers

int getMex(vector<int>& nums) {

  unordered_set<int> set; // Create an unordered set to store unique integers

  int mex = 1; // Initialize the Minimum Excluded positive integer to 1

  for (int num : nums) { // Iterate through the vector of integers

      set.insert(num); // Insert each integer into the set

      while (set.count(mex)) { // Check if the current mex is already present in the set

          mex++; // If it is present, increment the mex to find the next minimum excluded positive integer

      }

  }

  return mex; // Return the minimum excluded positive integer (mex)

}

// Function to minimize the Minimum Excluded positive integer (Mex) from two arrays A and B

int minimizeMex(vector<int>& A, vector<int>& B) {

  int n = A.size(); // Get the size of the arrays (assuming A and B are of the same size)

  vector<int> C(n); // Create an array C to store the minimum of A[i] and B[i]

  for (int i = 0; i < n; i++) {

      C[i] = min(A[i], B[i]); // Select the minimum between A[i] and B[i] and store it in C[i]

  }

  return getMex(C); // Call the getMex function to get the Minimum Excluded positive integer from array C

}

int main() {

  int n;

  cout << "Enter the length of arrays: ";

  cin >> n; // Get the size of the arrays from the user

  vector<int> A(n), B(n); // Create two vectors A and B to store the elements of the arrays

  cout << "Enter the elements of array A: ";

  for (int i = 0; i < n; i++) {

      cin >> A[i]; // Get the elements of array A from the user

  }

  cout << "Enter the elements of array B: ";

  for (int i = 0; i < n; i++) {

      cin >> B[i]; // Get the elements of array B from the user

  }

  int mex = minimizeMex(A, B); // Find the Minimum Excluded positive integer of the combined array C (minimum of A[i] and B[i])

  cout << "Minimum excluded positive integer of C: " << mex << endl; // Display the result

  return 0; // Indicate successful program execution

}

You can learn more about algorithm  at

https://brainly.com/question/24953880

#SPJ11


Related Questions

Arlo creates a rectangle on a worksheet, right-clicks the shape, and then clicks _____ on the shortcut menu so he can use the shape to run a macro.

a. View Macros

b. Assign Macro

c. Run Macro

d. Set as Macro

Answers

Arlo creates a rectangle on a worksheet, right-clicks the shape, and then clicks "Assign Macro" on the shortcut menu so he can use the shape to run a macro.The correct answer is option B.

"Assign Macro" is the correct option out of the provided choices (a, b, c, and d). This option allows Arlo to associate a macro with the rectangle shape he created.

By assigning a macro, Arlo can link a specific set of actions or commands to the shape, enabling him to execute the macro by interacting with the shape.

When Arlo selects "Assign Macro," a dialog box typically appears, presenting him with a list of available macros within the workbook. Arlo can then choose the desired macro from the list or create a new one. Once Arlo selects or creates the macro, it becomes associated with the rectangle shape. This means that whenever Arlo interacts with the shape, such as clicking on it, the assigned macro will execute, performing the predefined actions or commands.

By utilizing the "Assign Macro" option, Arlo can effectively use the shape as a trigger to initiate the desired macro, automating repetitive tasks and enhancing efficiency in his worksheet workflow.

For more such questions on worksheet,click on

https://brainly.com/question/30463017

#SPJ8

Arlo creates a rectangle on a worksheet, right-clicks the shape, and then clicks Assign Macro on the shortcut menu so he can use the shape to run a macro.

When he clicks on the Assign Macro option, a dialog box opens up which asks him to select a macro. Arlo can either choose a macro that is present in the current workbook, or he can use the browse option to select a macro from another workbook and assign it to the selected shape.

The macro must be defined before assigning it to the shape. In other words, the macro should be available in a module or sheet and must be saved in either a format for it to work.

To know more about shape visit:

https://brainly.com/question/21728646

#SPJ11

What can make an online interface difficult to use?​

Answers

Answer:

their is a lot miscomsuptions

Explanation:

The difficulty experienced by online interface users simply arises from the design principles associated with the structure of the interface.

The design of an online interface is best kept as simple as possible rather than a complicated user interface which becomes very difficult to navigate.

Another problem associated with design the use of overlapping textures or structures which often makes the user interface a whole lot more complicated.

Hence, the difficulty arising from using an online interface stems from the design.

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

You are given these tables to work with:
SUPPLIER(SUPNR, SUPNAME, SUPADDRESS, SUPCITY, SUPSTATUS)
SUPPLIES(SUPNR, PRODNR, PURCHASE_PRICE, DELIV_PERIOD)
PRODUCT(PRODNR, PRODNAME, PRODTYPE, AVAILABLE_QUANTITY)
PURCHASE_ORDER(PONR, PODATE, SUPNR)
PO_LINE(PONR, PRODNR, QUANTITY)
1. Display all supplier names (SupName) and their product names (ProdName), sort the results in alphabetical order on supplier name (SupName).
2. Display ONLY the supplier name (SupName) who has the most orders in Purchase_Order table.
3. Use a MINUS statement, list product numbers (ProdNR) that are in Product table but have never been ordered.

Answers

The provided SQL scenarios demonstrate how to display supplier names and their product names, identify the supplier with the most orders, and list product numbers that have never been ordered. These examples showcase the versatility and power of SQL in retrieving and manipulating data from relational databases.

The provided scenarios demonstrate various SQL statements and operations. The first scenario involves displaying supplier names (SupName) and their corresponding product names (ProdName) from joined tables, sorted alphabetically based on supplier name.

The second scenario focuses on displaying the supplier name with the most orders from the Purchase_Order table, utilizing the MAX function and subqueries.

Lastly, the third scenario employs a MINUS statement to list product numbers (ProdNR) from the PRODUCT table that have never been ordered, by subtracting the ordered products from the complete product list. These examples highlight the flexibility and power of SQL in retrieving and manipulating data from relational databases.

Learn more about SQL : brainly.com/question/25694408

#SPJ11

please can anyone tell me what is the is the correct answer there are 5 option to choose​

Answers

i dont know- i need the answer.

cyber law of nepal and it's provisions​

Answers

hope it helps .........

cyber law of nepal and it's provisions

PLS HURRY!! The newest Windows OS that provides a faster startup and redesigned Task Manager is called ____.

A. Windows Vista
B. Windows 7
C. Windows ME
D. Windows 8

Answers

Answer:

Windows 8

Explanation:

Hopefully I have answered your question!

Windows 8 was released on: October 26, 2012 a slower startup screen (Takes up to 5 Minutes, While Windows 7 takes about 30 seconds to about 1 Minute.) With a whole new redesign on the task manager.

the answer is windows 8

Research the history of Internet in computers

Answers

Answer:

This allowed different kinds of computers on different networks to "talk" to each other. ARPANET and the Defense Data Network officially changed to the TCP/IP standard on January 1, 1983, hence the birth of the Internet. All networks could now be connected by a universal language.

7.3.4: Find the Error

Answers

Answer:

my_string = "hello!"

# One of the two lines below will cause an error.

# Each line is an attempt to replace the first

# letter of myString with H. Comment out the

# line you think is incorrect.

# my_string[0] = "H"

my_string = "H" + my_string[1:]

print(my_string)

Explanation:

The numeric or alphanumeric error code is being used to identify the type of error. Following are the description of the error code in the given question:

Incorrect code:

my_string[0] = "H" // this line give the error that is "'str' object does not support item assignment".

Correct code:

my_string = "hello!"#defining the string variable that is "my_string"

my_string = "H" + my_string[1:]#using string variable that perform slicing and hold its value

print(my_string)#print my_string value

Code Explanation:

Defining the string variable that is "my_string".In the next line, the string variable is used that adds "H" to the first index value and performs slicing, and holds its value. Using the print method that prints the "my_string" variable value.

Output:

Please find the attached file.

Find out more about the error here:

brainly.com/question/13106116

7.3.4: Find the Error
7.3.4: Find the Error

PLEASE HELP! WILL GIVE BRAINLIEST

PLEASE HELP! WILL GIVE BRAINLIEST

Answers

Answer:

Explanation:find out

you can use ____ to convert two or more basic disks to dynamic disks

Answers

In Windows, you can use the Disk Management tool to convert basic disks to dynamic disks. Disk Management is a built-in Windows utility that allows users to manage hard disks, partitions, and volumes.

When you have two or more basic disks in Windows, you can use the Disk Management tool to convert them to dynamic disks. Converting a basic disk to a dynamic disk has a few benefits. First, you can create volumes that span multiple disks, which can help you make use of all the storage space you have. Second, you can use the Disk Management tool to create fault-tolerant volumes, such as mirrored volumes and striped volumes. Finally, dynamic disks can have more than four partitions, which can be useful if you need to create many partitions.

To convert two or more basic disks to dynamic disks, follow these steps:

1. Open Disk Management. You can do this by right-clicking on the Start button and selecting Disk Management from the menu that appears.

2. In Disk Management, locate the disks that you want to convert to dynamic disks.

3. Right-click on each basic disk and select Convert to Dynamic Disk.

4. Follow the prompts to complete the conversion process. Note that you may need to reboot your computer for the changes to take effect. When the conversion process is complete, you should see your disks listed as dynamic disks in Disk Management. You can then create volumes that span multiple disks or create fault-tolerant volumes as needed.

To know more about Windows visit:

https://brainly.com/question/33363536

#SPJ11

What is the speed of light and electromagnetic radiation in a vacuum?
186,000 feet/second
186,000 kilometers/second
186,000 meters/second
186,000 miles/second

Answers

Answer:

I'd say C 186,000 Meters/second

Light is fast! It can reach the universal speed limit — 186,000 miles per second. Light travels at 186000 feet per second.

write a rainfall class that stores the total rainfall for each of 12 months into an array of doubles

Answers

Answer:

class Rainfall {

public:

   // Constructor

   Rainfall();

   // Accessor functions

   double getTotal() const;

   double getAverage() const;

   double getMonthlyTotal(int month) const;

   double getMostRainfall() const;

   double getLeastRainfall() const;

   void print() const;

   // Mutator functions

   void setMonthlyTotal(int month, double rainfall);

private:

   static const int MONTHS_IN_YEAR = 12;

   double monthlyRainfall[MONTHS_IN_YEAR];

};

PLEASE HELP QUICK!!

Question: 15

True or False? You can strengthen the encryption of a Caesar cipher by shifting the letters twice (using

two keys).

Answers

The encryption of a caesar cipher cannot be strengthened by shifting the letters twice( using two keys). Thus, the given statement is false.

The caesar cipher is a simple technique for encrypting messages. The caesar cipher uses a substitution scheme, shifting the letters of the alphabet by a fixed number of spaces to get the encoded alphabet. A caesar cipher with shift 1 encodes A to B, M to N, Z to A, and so on. It is possible to make a caesar cipher more secure, but shifting the letters twice (using two keys) does not provide such strong encryption in caesar cipher.

That is why the given statement is false.

You can learn more about caesar cipher at

https://brainly.com/question/14754515

#SPJ4

Consider the following class declarations.public class Alpha{private int answer(){return 10;}}public class Beta{public double sample(){Alpha item = new Alpha();double temp = item.answer();return temp * 2.0;}}Which of the following best describes why an error occurs when the classes are compiled?A. The class Alpha does not have a defined constructor.B. The class Alpha must be declared as a subclass of Beta.C. The class Beta must be declared as a subclass of Alpha.D. The answer method cannot be accessed from a class other than Alpha.E. The result of the method call item.answer() cannot be assigned to a variable of type double.

Answers

The option that describes why an error occurs when the classes are compiled is D. The answer method cannot be accessed from a class other than Alpha.

What is a class declaration?

The class declaration component declares the class name as well as other attributes such as the superclass of the class and whether the class is public, final, or abstract. The class keyword and the name of the class that you are defining must be included at the very least in the class declaration.

In general, class declarations can include the following components in the following order: Modifiers such as public, private, and a variety of others will be encountered later. (However, keep in mind that the private modifier is only applicable to Nested Classes.) The name of the class, with the first letter capitalized by convention.

Because the answer() method is private, it can only be accessed within the Alpha class. Therefore, the correct option is D.

Learn more about computer on:

https://brainly.com/question/24540334

#SPJ1


Aiden visits a chat room online. He starts talking to one person about a movie. He doesn’t agree with the person’s opinions. He says mean things and makes fun of this person. How should Aiden have behaved?

Answers

Answer:

He should have politely disagreed with them and not escalated the situations and said mean things.

Explanation:

People often engage in conversation . Aiden should have politely disagreed with them and not increase the gravity of the situations and say mean things.

How do you deal with opinions you do not agree with?

Dissent is known to be the right way for one to express strong disagreement, often in terms with what people  think or say. One can do so by;

Do not make it personal. Try and Avoid putting down other people's opinion and beliefs. Listen to the view point of others.

learn more about Online from

https://brainly.com/question/14591988

question a technician that is new to 3d printers needs to call service for a malfunctioning printer. the technician explains that the problem is with what looks to be a print-head. which component does the tech report as a problem? a.extruder b.motion control c.build plate d.bed

Answers

The correct option is (A) i.e. Extruder, the technician explains that the problem is with what looks to be a print - head i.e. Extruder.

The technician reports the print head as the problematic component. In 3D printers, the print head, also known as the extruder, is responsible for melting the filament and depositing it layer by layer to create the 3D printed object. If there is an issue with the extruder, it can result in problems such as clogged nozzles, inconsistent filament flow, or improper filament melting.

These issues can lead to poor print quality, failed prints, or even damage to the printer. Identifying the extruder as the problem component helps the service team understand the specific area that needs troubleshooting or potential replacement to resolve the malfunctioning printer.

To know more about Extruder please refer:

https://brainly.com/question/30631842

#SPJ11

if you were 'looking inside' your computer and saw a bit pattern that looked like: 0010 what would that bit pattern be representing? pick the best answer below. some answers may be close, but only one is the best answer.

Answers

One and zero only make up a bit pattern. Any variable just is what it is. And a reference or pointer is. Put that explanation aside and consider it to be stating the obvious.

What amount of bit patterns are there?

N bits have a total of 2N possible patterns. This is important. You will lose a lot of time in this and subsequent courses if you let yourself become confused on it. Computer science frequently uses this number.

What purposes do bit patterns serve?

Number representation is one of the most popular uses of a bit-pattern. Arabic notation in base 10 is how we typically write numbers. We use the ten distinct symbols (0, 1, 2, 3, 4, 5, 6, 7, 8, and 9) in this system.

To know more about bit pattern visit :-

https://brainly.com/question/13014227

#SPJ4

A(n) event is an action taken by the user or a process, such as a user clicking a mouse or pressing a key on a keyboard.

Answers

Answer:

The answer is event

Explanation:

Answer:

event

Explanation:

got it right on edge

Evaluate each condition as to whether it is true or not.
You can join the Army if you are over 17 and healthy. Have you met those requirements if you are 16 and healthy?
You can earn a scholarship if you have an ACT over 30 or you are valedictorian of your high school. Have you eamed a scholarship if you have an ACT
of 34 but are not the valedictorian?

Answers

Answer:

For the first one you have not met those requirements because you are still 16, for the second one you have met those requirements because you can either have a score over 30 (which you have 34) or be a valedictorian

Explanation:

Above

write a program that asks length,breadth and height of a room and calculate its volume​

Answers

Answer:

cls

Input"enter length";l

Input"enter breadth";b

Input"enter height";h

v=l*b*h

print"the volume is";v

end

Explanation:

hope you got it

when setting image viewer preferences, how do you ensure that your changes do not impact users with a different windows login?

Answers

To access your information, select Start > Settings > Accounts. Select a file > Browse files under "Adjust your photo" to choose an already-existing image. Instead, if your device has a camera, choose Take a picture > Open camera to snap a fresh picture.

How can user permissions be disabled?

Click the user's name by going to Dashboard > User Management > Users. To remove a permission, select the Permissions view, then click the trash can icon next to it.

What Windows command-line programme is used to manage the permissions of the NTFS file system?

Windows comes with a built-in command-line utility called iCacls that reports on NTFS access permissions.

To know more about camera visit:-

brainly.com/question/29692195

#SPJ1

Does anyone know where i could watch the move
“little house: look back to yesterday” i cant find it ANYWHERE!!!!

Answers

Answer:

AMC Rosemary Square 12 and Apple The Gardens Mall and Muvico Theaters Automatic Ticketing and Rosemary Square and Apple Wellington Green and Walmart Supercenter

Explanation:

Help please this is my last assignment of the year

Help please this is my last assignment of the year

Answers

Answer:

the answer is in the website that are there

Which of the following tripeptides carries a net positive charge at pH7.0 ? I. Gln-Val-Ser II. Ala-Thr-Asn III. Pro-lle-Leu IV. Leu-Lys-Gly V. Arg-Glu-Met

Answers

The tripeptide that carries a net positive charge at pH 7.0 is Leu-Lys-Gly (IV).

At pH 7.0, the carboxyl group of glutamic acid (Glu) in Arg-Glu-Met (V) and the carboxyl group of aspartic acid (Asp) in Ala-Thr-Asn (II) are deprotonated, resulting in a net negative charge. On the other hand, the side chain of lysine (Lys) in Leu-Lys-Gly (IV) has an amino group that can accept a proton at pH 7.0, resulting in a net positive charge. Therefore, out of the options given, Leu-Lys-Gly (IV) is the tripeptide that carries a net positive charge at pH 7.0.

Here is a summary:

- Gln-Val-Ser (I) does not contain any charged amino acids and therefore does not carry a net positive charge at pH 7.0.

- Ala-Thr-Asn (II) contains aspartic acid (Asp), which has a deprotonated carboxyl group and carries a net negative charge at pH 7.0.

- Pro-Ile-Leu (III) does not contain any charged amino acids and therefore does not carry a net positive charge at pH 7.0.

- Leu-Lys-Gly (IV) contains lysine (Lys), which has an amino group that can accept a proton at pH 7.0, resulting in a net positive charge.

- Arg-Glu-Met (V) contains glutamic acid (Glu), which has a deprotonated carboxyl group and carries a net negative charge at pH 7.0

So, the answer is option IV

Learn more about tripeptide at:

https://brainly.com/question/31827580

#SPJ11

the domain name system (dns) converts ip addresses to domain names.
a. true
b. false

Answers

The given statement "the domain name system (DNS) converts IP addresses to domain names" is false because in fact, the DNS system performs the opposite function; it converts domain names to IP addresses. So, option b is correct.

The DNS is a hierarchical and distributed naming system that translates domain names (such as www.example.com) into IP addresses (such as 192.0.2.1) and vice versa.

It acts as a central directory for mapping human-friendly domain names to their corresponding IP addresses, which are numerical identifiers used by computers to locate and communicate with each other on a network.

When a user enters a domain name in a web browser or other network application, the DNS system is responsible for resolving that domain name to its associated IP address. This process involves querying DNS servers, starting from the top-level domain servers, to locate the authoritative name servers responsible for the specific domain.

Once the IP address is obtained, the network application can establish a connection with the corresponding server.

The purpose of DNS is to provide a more user-friendly way of accessing resources on the internet by using domain names instead of remembering complex IP addresses.

It simplifies the process of connecting to websites, sending emails, or accessing any other network service by translating the easily recognizable domain names to the underlying IP addresses.

In summary, the DNS system converts domain names to IP addresses, facilitating the translation between human-readable domain names and the numerical IP addresses used for network communication.

So, option b is correct.

Learn more about IP addresses:

https://brainly.com/question/14219853

#SPJ11

Consider the following incomplete code segment, which is intended to increase the value of each digit in a String by one. For example, if num is 12345, then the resulting String would be 23456.

String num = "12345";
int counter = 0;
String result = "";
while(/* Missing Loop Header */)
{
int newNum = Integer.valueOf(num.substring(counter,counter+1));
result+= (newNum + 1);
counter++;
}
System.out.println(result);

Which of the following should replace /* Missing Loop Header */ so that the code segment works as intended?

counter < num.length() - 1


counter <= num.length()


counter < num.length()


counter > num.length()


counter < num.indexOf(counter)

Answers

The instruction that should replace /* Missing Loop Header */ so that the code segment works as intended is (c)  counter < num.length()

Loops

The program is an illustration of loops (the while loop)

While loops are program statements that are used to perform repeated operations

For the string to return 23456, the while loop body must be repeated as long the counter is less than the length of the string num

Hence, the missing loop header is counter < num.length()

Read more about loops at:

https://brainly.com/question/15683939

1. What are some of the career ambitions and your future profession for information technology students at the University .


2. Write an introduction paragraph for a report on internships Simulation Workshop for a information technology student at the University.

Answers

Information technology students at the university often have career ambitions such as becoming software developers, cybersecurity experts, data analysts, IT consultants, system administrators, or project managers.

Information technology students at the university have a wide range of career ambitions and aspirations. Many students aspire to become software developers, where they can create innovative applications and solutions to meet the evolving needs of businesses and individuals. Others are interested in specializing in cybersecurity, aiming to protect digital systems and data from potential threats and ensuring the security of organizations. Data analysis is another popular career path, where students can leverage their skills in handling and interpreting large datasets to derive valuable insights for decision-making.

Learn more about career ambitions here:

https://brainly.com/question/14718568

#SPJ11

What is the first step when creating a 3-D range name?

Open the New Range window, and click 3-D.
Press the Shift key while selecting the new sheet .
Open the Name Manager, and click New.
Click a cell to insert the cell reference.

Answers

Answer:

Open the Name Manager, and click New.

Explanation:

State one criteria that makes a piece of malware a virus.

Answers

Answer: Self replication

Explanation: Malware is a catch-all term for any type of malicious software, regardless of how it works, its intent, or how it's distributed. A virus is a specific type of malware that self-replicates by inserting its code into other programs.

PLEASE HELP!!!
I was trying to create a superhero class code, but i ran into this error

File "main.py", line 3
def_init(self, name = "", strengthpts = 0, alterego = "", villain "", powers = "", motto = ""):
IndentationError: expected an indented block

Here is my actual code:
class superhero:

def_init(self, name = "", strengthpts = 0, alterego = "", villain "", powers = "", motto = ""):

# Create a new Superhero with a name and other attributes

self.name = name

self.strengthPts = strengthPts
self.alterego = alterego
self.powers = powers
self.motto = motto
self.villain = villain

def addStrengthPts(self, points):

# Adds points to the superhero's strength.

self.strengthPts = self.strengthPts + points



def addname(self):

if(self.name == "Dr.Cyber"):
print("My hero's name is Dr.cyber!")
elif(self.name == "Mr.cyber"):
print("My hero's name is Mr.cyber!")
elif(self.name == "Cyber Guy"):
print("My hero's name is Cyber Guy!")
else:
print("My hero doesn't have a name")



def addalterego(self):

if(self.alterego == "John Evergreen"):
print("Dr.Cyber's alter ego is John Evergreen")
elif(self.alterego == "John Silversmith"):
print("Dr.Cyber's alter ego is John Silversmith.")
elif(self.alterego == "Johnathen Grey"):
print("Dr.Cyber's alter ego is Johnathen Grey.")
else:
print("Dr.Cyber Does not have an alter ego")



def addpowers(self):

if(self.powers == "flight, super strength, code rewrighting, electronics control, psychic powers"):
print(fly. He is super strong. He can rewrite the genetic code of any object around him to whatever he wants.He can control surrounding electronics to do what he wants. He can move objects with his mind.")
else:
print(Fly. He can rewrite the genetic code of any object around him. he can move objects with his mind.")



def addmotto(self):

if(self.motto == "error terminated!"):
print("rewritting the code!")
else:
print("error eliminated!")



def addvillain(self):

if(self.villain == "The Glitch"):
print("Dr.Cyber's Arch nemisis is The Glitch.")
elif(self.villain == "The Bug"):
print("Dr.Cyber's Arch nemisis is The Bug.")
else:
print("Dr.Cyber has no enemies!")

def main():

newhero = superhero("Dr.Cyber", "John Evergreen", "fly. He is super strong. He can rewrite the genetic code of any object around him to whatever he wants.He can control surrounding electronics to do what he wants. He can move objects with his mind.", "The Glitch", "error terminated!", "0")

print("My Superhero's name is " + newhero.name + ".")

print(newhero.name + "'s alter ego is " + newhero.alterego + ".")

print(newhero.name + " can " + newhero.powers + ".")

print(newhero.name + "'s arch nemisis is " + newhero.villain + ".")

print("when " + newhero.name + " fights " + newhero.villain + ", he lets out his famous motto " + newhero.motto + ".")

print(newhero.name + " defeated " + newhero.villain + ". Hooray!!!")

print(newhero.name + " gains 100 strengthpts.")

main()

PLEASE ONLY SUBMIT THE CORRECT VERSION OF THIS CODE!!! NOTHING ELSE!!!

Answers

Answer:

you need to properly indent it

Explanation:

align your codes

Mark the other guy as brainliest, I'm just showing you what he meant.

I'm not sure if that's all that's wrong with your code, I'm just explaining what he meant.

Answer:

def_init(self, name = "", strengthpts = 0, alterego = "", villain "", powers = "", motto = ""):

# Create a new Superhero with a name and other attributes

self.name = name

self.strengthPts = strengthPts

self.alterego = alterego

self.powers = powers

self.motto = motto

self.villain = villain

def addStrengthPts(self, points):

 

   # Adds points to the superhero's strength.

   self.strengthPts = self.strengthPts + points

def addname(self):

   if(self.name == "Dr.Cyber"):

       print("My hero's name is Dr.cyber!")

   elif(self.name == "Mr.cyber"):

       print("My hero's name is Mr.cyber!")

   elif(self.name == "Cyber Guy"):

       print("My hero's name is Cyber Guy!")

   else:

       print("My hero doesn't have a name")

def addalterego(self):

   if(self.alterego == "John Evergreen"):

       print("Dr.Cyber's alter ego is John Evergreen")

   elif(self.alterego == "John Silversmith"):

       print("Dr.Cyber's alter ego is John Silversmith.")

   elif(self.alterego == "Johnathen Grey"):

       print("Dr.Cyber's alter ego is Johnathen Grey.")

   else:

       print("Dr.Cyber Does not have an alter ego")

def addpowers(self):

   if(self.powers == "flight, super strength, code rewrighting, electronics control, psychic powers"):

       print(fly. He is super strong. He can rewrite the genetic code of any object around him to whatever he wants.He can control surrounding electronics to do what he wants. He can move objects with his mind.")

   else:

       print(Fly. He can rewrite the genetic code of any object around him. he can move objects with his mind.")

def addmotto(self):

   if(self.motto == "error terminated!"):

       print("rewritting the code!")

   else:

       print("error eliminated!")

def addvillain(self):

   if(self.villain == "The Glitch"):

       print("Dr.Cyber's Arch nemisis is The Glitch.")

   elif(self.villain == "The Bug"):

       print("Dr.Cyber's Arch nemisis is The Bug.")

   else:

       print("Dr.Cyber has no enemies!")

def main():

   newhero = superhero("Dr.Cyber", "John Evergreen", "fly. He is super strong. He can rewrite the genetic code of any object around him to whatever he wants. He can control surrounding electronics to do what he wants. He can move objects with his mind.", "The Glitch", "error terminated!", "0")

   

   print("My Superhero's name is " + newhero.name + ".")

   print(newhero.name + "'s alter ego is " + newhero.alterego + ".")

   print(newhero.name + " can " + newhero.powers + ".")

   print(newhero.name + "'s arch nemisis is " + newhero.villain + ".")

   print("when " + newhero.name + " fights " + newhero.villain + ", he lets out his famous motto " + newhero.motto + ".")

   print(newhero.name + " defeated " + newhero.villain + ". Hooray!!!")

   print(newhero.name + " gains 100 strengthpts.")

main()

Other Questions
In some cases, organizations will use a(n) __________ to solicit ideas for projects when the knowledge requirements for the project are not available in the organization. Electron microscopes have a greater resolution compared to compound microscopes because they have ___________ wavelengths. Which of the following BEST summarizes a reason for the creation of the United States Constitution?A The direct effect on business by the rules in the Stamp ActB The limiting of economic opportunism by the passing of the Proclamation Line of 1763C The military governor put in place by the Intolerable ActsD The weaknesses written in the Articles of Confederation I need helppppp I forgot how to do this :( How has the way that we think about and study world history changed over time?Compare and contrast What is one of your goals that you would like to accomplish? what property is 9+-9=0 Mrs B invested $30,000, part at 5%, part at 8%. The total interest on the investment was $2100, how much did she invest at each rate?(Please show working) pleaseeee help!! fastThe volume of oxygen gas at 25oC is 10 m3. If the volume of the gas is doubled, what is its new temperature in oC?15 points a student working in a lab that studies rats was asked to genetically modify a rat that could tolerate dehydration using one of two methods: change the amount of vasopressin that the rat produces (increase or decrease) or change the amount of aldosterone that the rat produces (increase or decrease). what method would you choose and why? draw a feedback loop which shows how your genetic modification would be an advantage ( SOMEONE PLZ HELP!!!!!!!!! Blood type is inherited through multiple alleles. A are co dominant and o is recessive. If the father has type Ao blood, and the mother is Bo; what isthe chance do they for an O type offspring?1) 0%2)25%3)50%4)75% ___reasoning is reasoning from the general to the specific, whereas___ the general reasoning is reasoning from the specific toMultiple ChoiceA.Well-defined; ill-definedB.Il-defined; well-definedC.Deductive: InductiveD.Inductive; deductive According to the manufacturer of the candy Skittles, 20% of the candy produced are red. If we take a random sample of 100 bags of Skittles, what is the sampling distribution for proportion Elle was raised by a very conservative family in the remote town of Surigao, Sheearned her early education in this strictly norm-controlled community while shetrains to sing with the church choir. After earning her diploma in senior high, Ellewas convinced by her relatives to try her fate in the highly urbanized and densecity of Mandaluyong, Metro Manila. She wanted to try her luck to find work anddesired to enroll as well in a community college. In her new place people laughedat her for being nave and serious. She does not socialize with neighbors neitherdoes she interact with anybody as she cannot speak in Filipino. Her self-esteemwas very low during those times as she long foe her place and the company of herfriends the province. She feels sad, sick and hopeless most of the time.Point to Ponder:Is it right to consider Elle as an individual with a deficient self-esteem and self-image? Why? NEED HELP FAST for 25pts The test: As you read in Dr. Sattari's message, genetic researchers at Bay Medical Company have identified two gene versions for running ability: A1 and A2. A1 instructs for the ACTN3 protein. Researchers tested three runners to see what proteins they had in their cells.Evidence: For the running ability feature, runner 1 had only ACTN3 proteins in her cells.Based on the proteins that were found in runner 1s cells, what can you say about her genes? Explain your ideas using the following words: gene versions, heterozygous, and homozygous. A survey found that in a city, 18% of the population owned cars, 24% of thepopulation owned motorcycles, and 6% of the population owned both a car and amotorcycle. Find the probability that a randomly chosen member of the populationowns a car or a motorcycle.0.360.310.28O 3.0 The author supports the claim that doctors used Henrietta's cells without permission mainly by includingA. an official document with doctors' notes from the hospital where Henrietta Lacks was treatedB. a personal account from one of the doctors that treated Henrietta Lacks for cancerC. part of a letter from her correspondence with Henrietta Lacks's daughter D. a statement made by Henrietta Lacks's husband to a magazine 3. Which of the following artists is NOT considered an Indie-Rock artist/band? *Happy MondaysJoy DivisionDuran DuranNew Order