Write a function gcdRecur(a, b) that implements this idea recursively. This function takes in two positive integers and returns one integer.
''def gcdRecur(a, b):
'''
a, b: positive integers
returns: a positive integer, the greatest common divisor of a & b.
'''
# Your code here
if b == 0:
return a
else:
return gcdRecur(b, a%b)
#Test Code
gcdRecur(88, 96)
gcdRecur(143, 78)
© 2021 GitHub, Inc.

Answers

Answer 1

Answer & Explanation:

The program you added to the question is correct, and it works fine; It only needs to be properly formatted.

So, the only thing I did to this solution is to re-write the program in your question properly.

def gcdRecur(a, b):

   if b == 0:

       return a

   else:

       return gcdRecur(b, a%b)

gcdRecur(88, 96)

gcdRecur(143, 78)


Related Questions

Which support function under Tech Mahindra is governing data privacy and protection related requirements

Answers

Answer:

Privacy Policy

Explanation:

PRIVACY POLICY is the support function under Tech Mahindra that is governing data privacy and protection-related requirements.

Given that support functions are functions which assist and in a way contribute to the company goal.

Other support functions are human resources, training and development, salaries, IT, auditing, marketing, legal, accounting/credit control, and communications.

The above statement is based on the fact that the Privacy Policy clarifies all the data protection rights, such as the right to object to some of the production processes that TechM may carry out.

Explain how you would find a book on a given subject in the library.

Answers

Answer:

In case I am looking for a specific book in a library, the way in which I would try to find it would be through consulting the library guide, or through inspection of the different books of the specific sector with which the book I'm looking for is listed, or by asking the library staff to help me with my search.

Suppose you have some List of S List of Strings called List and a String prefix. Write a method that removes all the Strings from list that begin with prefix. public void removePrefixStrings(List-String- list, String prefix) 7. What is the time complexity of this algorithm?

Answers

Answer:

public void removePrefixStrings(List<String> list , String prefix) {

if(list==null || list.size()==0)

return;

for(int i=0; i<list.size();) {

if(list.get(i).startsWith(prefix))

list.remove(i);

else

++i;  

}  

}  

Time Complexity: If the prefix is the same as String length, Then finding all prefix match will take n *n = n2

Then removal is also n  

So the total time complexity is O(n3)

When an external device becomes ready to be serviced by the processor the device sends a(n)_________ signal to the processor.

Answers

when an external device becomes ready to be serviced by the processor the device sends a(n) interrupt signal to the processor

You work as the IT Administrator for a small corporate network you need to configure configure the laptop computer in the Lobby to use the corporate proxy server. The proxy server is used to control access to the internet. In this lab, your task is to configure the proxy server settings as follows: Port: 9000

Answers

Answer:

okay if I am it administration I will port 10000

To configure the computer in the lobby to use the corporate proxy server, you will need to follow these steps:

Settings > Networks&Internet > Proxy > Manual Proxy Setup > Address & proxy > save

What is Proxy Server?

A proxy server is a device or router that acts as a connection point between users and the internet.

Proxy Server settings would be the same for both Wifi and Ethernet connections, explaining about the configuration in Windows Operating System.

Open the internet browser on the laptop and go to the settings or preferences page. The exact location of the proxy settings will vary depending on the browser you are using.

In the settings or preferences page, look for the "Proxy" or "Network" section.

In the proxy settings, select the option to use a proxy server.

Enter the address of the corporate proxy server in the "Server" or "Address" field.

Enter the port number "9000" in the "Port" field.

Save the changes and close the settings or preferences page.

Test the proxy server configuration by attempting to access a website. If the configuration is correct, the laptop should be able to access the internet through the proxy server.

Settings > Networks&Internet > Proxy > Manual Proxy Setup > Address & proxy > save

To learn more about the Proxy Server settings click here:

https://brainly.com/question/14403686

#SPJ12

Prime numbers can be generated by an algorithm known as the Sieve of Eratosthenes. The algorithm for this procedure is presented here. Write a program called primes.js that implements this algorithm. Have the program find and display all the prime numbers up to n = 150

Answers

Answer:

Explanation:

The following code is written in Javascript and is a function called primes that takes in a single parameter as an int variable named n. An array is created and looped through checking which one is prime. If So it, changes the value to true, otherwise it changes it to false. Then it creates another array that loops through the boolArray and grabs the actual numberical value of all the prime numbers. A test case for n=150 is created and the output can be seen in the image below highlighted in red.

function primes(n) {

   //Boolean Array to check which numbers from 1 to n are prime

   const boolArr = new Array(n + 1);

   boolArr.fill(true);

   boolArr[0] = boolArr[1] = false;

   for (let i = 2; i <= Math.sqrt(n); i++) {

      for (let j = 2; i * j <= n; j++) {

          boolArr[i * j] = false;

      }

   }

   //New Array for Only the Prime Numbers

   const primeNums = new Array();

  for (let x = 0; x <= boolArr.length; x++) {

       if (boolArr[x] === true) {

           primeNums.push(x);

       }

  }

  return primeNums;

}

alert(primes(150));

hãy giúp tôi giảiiii​

Answers

Answer:

fiikslid wugx uesbuluss wuz euzsbwzube

Question: Name the person who originally introduced the idea of patterns as a solution design concept.

Answers

Answer:

architect Christopher Alexander is the person who originally introduced the idea of patterns as a solution design concept.

The person who originally introduced the idea of patterns as a solution design concept named as Christopher Alexander who was an architect.

What is architecture?

Architecture is referred to as an innovative technique or artwork based on buildings or physical structures that aims at creating cultural values for upcoming generations to understand the importance of history.

The external layout can be made to best support human existence and health by using a collection of hereditary solutions known as the "pattern language." It creates a set of helpful relationships by combining geometry and social behavior patterns.

Christopher Alexander, a British-American engineer and design theorist of Austrian heritage, is renowned for his several works on the design and construction process introduced the idea of patterns as a solution design concept.

Learn more about pattern language architecture, here:

https://brainly.com/question/4114326

#SPJ6

1) Declare an ArrayList named numberList that stores objects of Integer type. Write a loop to assign first 11 elements values: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024. Do not use Math.pow method. Assign first element value 1. Determine each next element from the previous one in the number List. Print number List by using for-each loop.

Answers

Answer:

Explanation:

The following is written in Java and uses a for loop to add 10 elements to the ArrayList since the first element is manually added as 1. Then it calculates each element by multiplying the previous element (saved in count) by 2. The program works perfectly and without bugs. A test output can be seen in the attached image below.

import java.util.ArrayList;

class Brainly {

   public static void main(String[] args) {

       ArrayList<Integer> numberList = new ArrayList<>();

       numberList.add(0, 1);

       int count = 1;

       for (int i = 1; i < 11; i++) {

           numberList.add(i, (count * 2));

           count = count * 2;

       }

       for (Integer i : numberList) {

           System.out.println(i);

       }

   }

}

What does the AVERAGE function calculate? the total sum of a list of values the arithmetic mean of a list of values the total number of values in a list the percentage of values in a list

Answers

Answer:

B) the arithmetic mean of a list of values

Explanation:

on Edge

The Average function calculates the arithmetic mean of a list of values. Therefore, option B is the correct option.

What is the average?

In its most general definition, an average can be considered as the representative number or figure from the whole list. The average of a list containing multiple values is obtained by adding all the values and dividing them up by the total number of values.

The ultimate objective of calculating the average is to discover the value that represents the whole list. Average is also known as mean, and it works as a central value in the list, which is comprehensive in nature. It works as an approximate or rough estimate, which helps us in making decisions in daily life.

Thus, the average function calculates the arithmetic mean of a list of values. Therefore, option B is the correct option.

To learn more about the average, visit the link below:

https://brainly.com/question/11265533

#SPJ2

What should businesses do in order to remain competitive under the current Cloud
landscape?

Answers

Answer:

Cloud Landscape

They must evangelize the benefits of cloud computing to company executives in order to assist them in developing and extracting business benefits that will give them a competitive advantage and increase profits

Explanation:

The most successful organisations carefully plan out a multiyear effort to improve their cloud adoption, focusing on multiple streams of work across several stages of maturity.

Cloud computing governance is difficult even when only one cloud provider is involved, and it becomes even more difficult as organisations move toward multi cloud.

Continuous workload placement analysis involves reassessing workloads at a regular cadence, evaluating whether the current execution venue sufficiently meets the organization’s needs and if migrating to an alternative model provides higher value without adding significant risk to the organization’s operations

They must evangelize the benefits of cloud computing to company executives in order to assist them in developing and extracting business benefits that will give them a competitive advantage and increase profits.

In this question, the response is "Cloud Landscape" which can be defined as follows:

The organizations should adopt these new technologies to benefit from the digital transformation offered by the cloud.New enterprises were embracing cloud computing management strategies, placing established companies at risk.In the multi-year efforts for improving cloud security were meticulously planned by even the most successful enterprises. In several contributing to higher at various maturity levels are addressed.The multi-cloud plan enables governance of cloud computing increasingly challenging, even and there is only one cloud service provider involved in the agreement.  

Learn more:

cloud computing: brainly.com/question/16026308

In the revised version of the library system with Book and Periodical, Question 16 options: a) Book is a subclass of Periodical b) Periodical is a subclass of Book c) Book and Periodical are subclasses of LoanableItem d) Book and Periodical implement LoanableItem

Answers

Answer:

c. Book and Periodical are subclasses of LoanableItem

Explanation:

Books are kept in library in a periodical manner. Both classes are not superior, they are subclasses of LoanableItem. Library uses common guide which makes it easy to find a book.

In cell K8, create a formula using the SUM function that calculates the total of the range D17:D20 and subtracts it from the value in cell J8.

Answers

Answer:

so like what are you asking for so i can help u just tell me what u need and i will help u :)

Explanation:

Write a program that asks a user to enter a date in month day year format (for example 10 12 2016) and displays the day of the week for that date, in this case, Wednesday.

Answers

Answer and Explanation:

Using javascript:

function dayof_theweek(){

var TodayDate = window. prompt("enter today's date in the format 'year, month, day' ");

var Datenow=new date(TodayDate);

var Dayofweek=Datenow.getday();

var Days=["monday","Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];

if(Dayofweek==indexOf(Days[Dayofweek]))

{

document.createTextnode(Days[Dayofweek]);

}

}

The program above uses a date object which uses the method getday to get the day of the week(get day returns an integer from 0 to 6).we then use a comparison operator == to test the condition that returned value Dayoftheweek is same with the index of the array Days and then print to a html document. The program may need improvements such as the fact that errors may arise when proper input isn't given, and therefore must be handled.

ITING THE ANSWER
1. According to Turner and Wilson (2018), Information Literacy consists of
tasks EXCEPT...
A applying previous knowledge.
C. finding appropriate information
B. determining information need.
2. Outlining your problem, developing research questions, selecting keywords a
developing concept charts are activities during...
D. using information ethically
A. communicating information.
B. determining information need.
C. evaluating search results.
D. finding appropriate resources,
3. Asking questions such as what, why, where and how is an effective way to
A. craft your research questions.
B. develop good keywords
C. find good information
D. understand your topic,
4. In asking "what" questions, you intend to find...
A. answers and solutions.​

Answers

Answer:

Answer my first question

The Marietta Country Club has asked you to write a program to gather, then display the results of the golf tournament played at the end of March. The Club president Mr. Martin has asked you to write two programs.
The first program will input each player's first name, last name, handicap and golf score and then save these records in a file named golf.txt (each record will have a field for the first name, last name, handicap and golf score).
The second program will read the records from the golf.txt file and display them with appropriate headings above the data being displayed.
If the score is = Par, then display 'Made Par'
If the score is < Par, then display 'Under Par'
If the score is > Par, then display 'Over Par'
There are 16 players in the tournament. Par for the course is 80. The data is as follows:
Andrew Marks 11.2 72
Betty Franks 12.8 89
Connie William 14.6 92
Donny Ventura 9.9 78
Ernie Turner 10.1 81
Fred Smythe 8.1 75
Greg Tucker 7.2 72
Henry Zebulon 8.3 83
Ian Fleming 4.2 72
Jan Holden 7.7 84
Kit Possum 7.9 79
Landy Bern 10.3 93
Mona Docker 11.3 98
Kevin Niles 7.1 80
Pam Stiles 10.9 87
Russ Hunt 5.6 73

Answers

Answer:

Explanation:

The following program is written in Python. It creates two functions, one for writting the players and their scores to the file, and another function for reading the file and outputting whether or not they made Par. The functions can be called as many times that you want and the writeFile function allows for 16 inputs to be made when called. A test case has been provided with all of the players mentioned in the question. The output can be seen in the attached image below.

def writeFile():

   file = open('output.txt', 'w')

   for x in range(16):

       firstName = input("Enter First Name:")

       lastName = input("Enter Last Name:")

       handicap = input("Handicap:")

       score = input("Score:")

       file.write(str(firstName) + " " + str(lastName) + " " + str(handicap) + " " + str(score) + "\n")

   file.close()

def readFile():

   file = open('output.txt', 'r')

   for line in file:

       lineArray = line.split(" ")

       if int(lineArray[-1]) < 80:

           print(str(lineArray[0]) + " " + str(lineArray[1]) + " Under Par" )

       elif int(lineArray[-1]) == 80:

           print(str(lineArray[0]) + " " + str(lineArray[1]) + " Made Par")

       else:

           print(str(lineArray[0]) + " " + str(lineArray[1]) + " Over Par")

   file.close()

writeFile()

readFile()

Write a program using a dictionary that reads in a single positive digit number [0 - 9] from the user at the keyboard. Your program will then be able to look up the digit key in the dictionary and print the digit value spelled out. If the user types in a number that is either more than one digit, negative, or a non int value, re-prompt the user for valid input. First, before demonstrating your test cases, print out a display copy of the key:value pairs in your dictionary in sorted order. Deliverable: yournameLab4.py Your source code solution and a copy of the run pasted into your source submission file. Be sure to comment out your run so that your .py file will still run in the grader test bed. Validate user input is a single positive digit [0 - 9].

Answers

Answer:

The program in Python is as follows:

dict = {0:"Zero",1:"One",2:"Two",3:"Three",4:"Four",5:"Five",6:"Six",7:"Seven",8:"Eight",9:"Nine"}

num = input("Number: ")

while(num.isdigit() == False or int(num)<0 or int(num)>9):

   num = input("Number: ")

print(dict)    

print(dict[int(num)])

Explanation:

#This initializes the dictionary

dict = {0:"Zero",1:"One",2:"Two",3:"Three",4:"Four",5:"Five",6:"Six",7:"Seven",8:"Eight",9:"Nine"}

#This gets input from the user

num = input("Number: ")

#This loop is repeated until the user enters a valid input

while(num.isdigit() == False or int(num)<0 or int(num)>9):

   num = input("Number: ")

#This prints the dictionary

print(dict)    

#This prints the value of the key

print(dict[int(num)])

See attachment for sample run

describe what happens at every step of our network model, when a node on one network establishes a TCP connection with a node on another network. You can assume that the two networks are both connected to the same router.

Answers

Answer:

Each node on the network has an addres which is called the ip address of which data is sent as IP packets. when the client sends its TCP connection request, the network layer puts the request in a number of packets and transmits each of them to the server.

2.13 LAB: Branches: Leap Year
A year in the modern Gregorian Calendar consists of 365 days. In reality the earth takes longer to rotate around the sun. To account for the
difference in time every 4 years a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The
requirements for a given year to be a leap year are:
1) The year must be divisible by 4
2) If the year is a century year (1700 1800. etc.), the year must be evenly divisible by 400
Some example leap years are 600712 and 2016
Wirte a program that takes n a year and determines whether that year is a leap year.
Exif the inputs
1712

Answers

Answer:

The program in Python is as follows:

year = int(input("Enter a year: "))

print(year,end=" ")

if year % 4 == 0:

  if year % 100 == 0:

      if year % 400 == 0:           print("is a leap year")

      else:           print("is not a leap year")

  else:       print("is a leap year")

else:   print("is not a leap year")

Explanation:

This gets input for year

year = int(input("Enter a year: "))

This prints year, followed by a blank

print(year,end=" ")

If year is divisible by 4

if year % 4 == 0:

If yes, check if year is divisible by 100

  if year % 100 == 0:

If yes, check if year is divisible by 400; print leap year if true

      if year % 400 == 0:           print("is a leap year")

print not leap year if year is not divisible by 400

      else:           print("is not a leap year")

print leap year if year is not divisible by 100

  else:       print("is a leap year")

print leap year if year is not divisible by 4

else:   print("is not a leap year")

Answer:

def is_leap_year(user_year):    

   if(user_year % 400 == 0):        

       return True          

   elif user_year % 100 == 0:        

       return False        

   elif user_year%4 == 0:        

       return True          

   else:        

       return False

if __name__ == '__main__':    

   user_year = int(input())    

   if is_leap_year(user_year):        

       print(user_year, "is a leap year.")

   else:        

       print(user_year, "is not a leap year.")

Explanation:

IN C++
A. Create an abstract base class called Currency with two integer attributes, both of which are non-public. The int attributes will represent whole part (or currency note value) and fractional part (or currency coin value) such that 100 fractional parts equals 1 whole part.
B. Create one derived class - Money - with two additional non-public string attributes which will contain the name of the currency note (Dollar) and currency coin (Cent) respectively. DO NOT add these attributes to the base Currency class.
C. In your base Currency class, add public class (C++ students are allowed to use friend methods as long as a corresponding class method is defined as well) methods for the following, where appropriate:
Default Construction (i.e. no parameters passed)
Construction based on parameters for all attributes - create logical objects only, i.e. no negative value objects allowed
Copy Constructor and/or Assignment, as applicable to your programming language of choice
Destructor, as applicable to your programming language of choice
Setters and Getters for all attributes
Adding two objects of the same currency
Subtracting one object from another object of the same currency - the result should be logical, i.e. negative results are not allowed
Comparing two objects of the same currency for equality/inequality
Comparing two objects of the same currency to identify which object is larger or smaller
Print method to print details of a currency object
All of the above should be instance methods and not static.
The add and subtract as specified should manipulate the object on which they are invoked. It is allowed to have overloaded methods that create ane return new objects.
D. In your derived Money class, add new methods or override inherited methods as necessary, taking care that code should not be duplicated or duplication minimized. Think modular and reusable code.
E. Remember -
Do not define methods that take any decimal values as input in either the base or derived classes.
Only the print method(s) in the classes should print anything to console.
Throw String (or equivalent) exceptions from within the classes to ensure that invalid objects cannot be created.
F. In your main:
Declare a primitive array of 5 Currency references (for C++ programmers, array of 5 Currency pointers).
Ask the user for 5 decimal numbers to be input - for each of the inputs you will create one Money object to be stored in the array.
Once the array is filled, perform the following five operations:
Print the contents of the array of objects created in long form, i.e. if the user entered "2.85" for the first value, it should be printed as "2 Dollar 85 Cent".
Add the first Money object to the second and print the resulting value in long form as above.
Subtract the first Money object from the third and print the resulting value in long form as above.
Compare the first Money object to the fourth and print whether both objects are equal or not using long form for object values.
Compare the first Money object to the fifth and print which object value is greater than the other object value in long form.
All operations in the main should be performed on Currency objects demonstrating polymorphism.
Remember to handle exceptions appropriately.
There is no sample output - you are allowed to provide user interactivity as you see fit.

Answers

Answer:

I only do Design and Technology

sorry don't understand.

I have a Dell laptop and last night it said that it needed to repair it self and asked me to restart it. So I did but every time I turn it on it shuts itself down. I had a problem exactly like this before with my old computer, was not a Dell though, and I ended up having to have it recycled. This computer I have now is pretty new and I really don't want to have to buy a new computer. What should I do to fix this problem? Please help, I'm a college student almost ready to graduate and all of my classes are online. I'm starting to panic. Thanks for helping me figure this situation out.

Answers

The same thing happened with my HP laptop but my dad refresh the laptop before restating it worked

Write the correct statements for the above logic and syntax errors in program below.

#include
using namespace std;
void main()
{
int count = 0, count1 = 0, count2 = 0, count3 = 0;
mark = -9;
while (mark != -9)
{
cout << "insert marks of students in your class, enter -9 to stop entering";
cin >> mark;
count++;

if (mark >= 0 && mark <= 60);
count1 = count1 + 1;
else if (mark >= 61 && mark <= 70);
count2 = count2 + 1;
else if (mark >= 71 && mark <= 100);
count3 = count3 + 1;
}
cout <<"Report of MTS3013 course" << endl;
cout <<"Mark" << count << endl << endl;
cout << "0-60" << "\t\t\t\t" << count1 << endl;
cout << "61-70" << "\t\t\t\t" << count2 << endl;
cout << "71-100" << "\t\t\t\t" << count3 << endl<< endl << endl;
cout << "End of program";
}

Answers

Mark is gonna be the answer for question 1

What are some of the advantages and disadvantages of connection-oriented WAN/Man as opposed to connection-less?

Answers

Answer and Explanation:

Connection oriented WAN/MAN as opposed to connection less network is a type of wide area network that requires communicating entities in the network to establish a dedicated connection for their communication before they start communicating. This type of network will use these established network layers only till they release it, typical of telephone networks.

Advantages include:

Connection is reliable and long.

Eliminates duplicate data issues.

Disadvantages include:

Resource allocation while establishing dedicated connection slows down speed and may not fully utilize network resources.

There are no plan B's for network congestion issues, albeit occurring rarely with this type of network.

Select the correct answer.
What testing approach does a development team use when testing the developed code rather than just the functionality of the code?
A.
white box testing
B.
black box testing
C.
acceptance testing
D.
usability testing

Answers

Answer:

D. usability testing

Explanation:

A software can be defined as a set of executable instructions (codes) or collection of data that is used typically to instruct a computer how to perform a specific task and to solve a particular problem.

A software development life cycle (SDLC) can be defined as a strategic process or methodology that defines the key steps or stages for creating and implementing high quality software applications. There are seven (7) main stages in the creation of a software and these are;

1. Planning.

2. Analysis and requirements.

3. Software design and prototyping.

4. Development (coding).

5. Integration and testing

6. Deployment.

7. Operations and maintenance.

Usability testing is a testing technique used by a software development team to test a developed code rather than just the functionality of the code.

The main purpose of usability (user experience) testing is to determine how easy, user-friendly or difficult it is for end users (real people) to use a software application or program.

Select the correct statement(s) regarding PONS. a. only MMF cables can be used, since MMF enables greater data capacities compared to SMF b. PONS systems require active amplifiers, since high frequency signals attenuate quickly over distance c. PONS systems use passive devices between OLT and ONT d. all are correct statements

Answers

Answer:

The correct statement regarding PONS is:

c. PONS systems use passive devices between OLT and ONT

Explanation:

PON means Passive Optical Network. Based on fiber-optic telecommunications technology, PON is used to deliver broadband network access to individual end-customers.  It enables a single fiber from a service provider to maintain an efficient broadband connection for multiple end-users (homes and small businesses).  OLT means Optical Line Terminal, while ONT means Optical Network Terminal.  They provide access to the PON.

Consider a system with seven processes: E, F, G, H, I, J, K and six resources: U, V, W, X, Y, Z. Process E holds U and wants V. Process F holds nothing but wants W. Process G holds nothing but wants V. Process H holds X and wants V and W. Process I holds W and wants Y. Process J holds Z and wants V. Process K holds Y and wants X. Is this system deadlocked?

a. Yes
b. No

Answers

Answer:

a. Yes

Explanation:

System is deadlock due to process HIK. Process H holds X and wants V and W. Process I holds W and wants Y. Process K holds Y and wants X. The system will become deadlock due to these three different processes.

what is example of application of machine learning that can be imposed in eduction. (except brainly.)

Answers

Answer:

Machine Learning Examples

Recommendation Engines (Netflix)

Sorting, tagging and categorizing photos (Yelp)

Self-Driving Cars (Waymo)

Education (Duolingo)

Customer Lifetime Value (Asos)

Patient Sickness Predictions (KenSci)

Determining Credit Worthiness (Deserve)

Targeted Emails (Optimail)

If one wish to create a loop such that it will continuously add time elapsed between two functions with variable computation time until 1 hour is passed, what type of loop would be best

Answers

"Between two functions" not sure of what you mean there but here's a quick way to execute a function for an hour

Answer and Explanation:

var interval=setInterval(function(){

var i=0;

for (i=0; i <=60; i++){

for (i=0; i <70; i++){

console.log(i); }

}}, 60000);

Study the following two class interfaces: class Question { public: Question(); void set_text(string new_text); void set_answer(string new_answer); void display() const; private: string text; string answer; }; class ChoiceQuestion : public Question { public: ChoiceQuestion(); void set_text(string new_text); }; Which member function from the Question class is overridden in the ChoiceQuestion class?

Answers

Answer:

The question function

Explanation:

The ChoiceQuestion function inherits from the Question class and should have it's functions and attributes as it is now a child of the Question class. It however overides the Question class function where it sets the ChoiceQuestion class function in the first function definition of the ChoiceQuestion class definition. This allows the child class to have it's own functions as well have access to the attributes and functions of the parent class.

We have an N x N square grid.


We will paint each square in the grid either black or white.

If we paint exactly A squares white, how many squares will be painted black?

A and N are integers,

Print the number of squares that will be painted black.
C++

Answers

Answer:

The solution in C++ is:

#include <iostream>

using namespace std;

int main(){

   int N, A;

   cout<<"Grids: ";    cin>>N;

   cout<<"White: ";    cin>>A;

   cout<<"Black: "<<N * N - A;

   return 0;

}

Explanation:

This declares N and A, as integers

   int N, A;

This gets inputs for N

   cout<<"Grids: ";    cin>>N;

This gets inputs for A, (the white grids)

   cout<<"White: ";    cin>>A;

This calculates and prints the number of black grids

   cout<<"Black: "<<N * N - A;

PS

From the question, we understand that the grid is N by N square grids.

This means that:

[tex]Total = N * N[/tex]

So, the number of black grids is:

[tex]Black = Total - A[/tex]

Other Questions
On an electricity bill of $40.80, Mrs.Miller pays only $38.76 because she paysbefore a certain date. What percentdiscount is Mrs. Miller allowed? P Company owns 90% of the outstanding common stock of S Company. On January 1, 2015, S Company sold land to P Company for $578,000. S Company originally purchased the land for $427,400. On January 1, 2016, P Company sold the land purchased from S Company to a company outside the affiliated group for $676,100. Calculate the amount of gain on the sale of the land that is recognized on the books of P Company in 2016. Why was Carnegie Steel considered a vertical monopoly?The company controlled every step of steel production, from raw materials to distribution.The company controlled all the steel plants in the country.The company became the only source of steel after competitors went out of business.The company was able to produce more steel than any other steel company in the world. The null hypothesis and the alternate hypothesis are: H0: The frequencies are equal. H1: The frequencies are not equal. Category f0 A 10 B 30 C 30 D 10 State the decision rule, using the 0.05 significance level. (Round your answer to 3 decimal places.) Compute the value of chi-square. (Round your answer to 2 decimal place.) What is your decision regarding H0 I need help solving this problem Azure, a C corporation, reports the following: Pretax book income is $543,000. Depreciation on the tax return is $20,000 greater than depreciation on the financial statements. Rent income reportable on the tax return is $36,000 greater than rent income per the financial statements. Fines for pollution appear as a $10,000 expense in the financial statements. Interest earned on municipal bonds is $25,000. What is Azure's taxable income purchased heavy equipment by giving the seller a $30,000 cash down payment and a 5-year interest-bearing note for the $170,000 balance of the price. Compute Pettit's book basis and tax basis in the equipment Which details directly characterize Dr. Lanyon? Check all that apply. The solemn butler knew and welcomed him . . . . . . he was subjected to no stage of delay, but ushered direct from the door to the dining-room . . . This was a hearty, healthy, dapper, red-faced gentleman . . . . . . he sprang up from his chair and welcomed him with both hands. The geniality, as was the way of the man, was somewhat theatrical to the eye . . . Suppose an annuity pays 6% annual interest, compounded semi-annually. You invest in this annuity by contributing $4,500 semiannually for 6 years. What will the annuity be worth after 6 years? Por que los derechos son una construccion 2. Nitric oxide contains 46.66% nitrogen and 53.34% oxygen. Water contains 11.21% hydrogen and 88.79% oxygen. Ammonia contains 17.78% hydroger and 82.22% nitrogen. Use these data to verify the law of reciprocal proportions. Michael invest $P at a rate of 3.8% per year compounded interest. After 30 years the value of this investment is $1,469. Calculate the value of P. "Red rust is one of the destructive diseases in tea plants which results adverse effect on tea yield. It is caused by a type of algae." Which discipline of Biology is related to explain the above statement? a. Mycology b. Agronomy c. Pathology d. Phycology Please help me with this Write each question as a single logarithm (Picture attached) first answer gets marked brainliest!!! Triathlon Cycles specializes in producing touring bicycles but has recently Activity Cost pool Mountain Bicycle Touring Bicycle Direct materials per unit $1,000 $2,200 Total direct labor cost $300 $700 Total manufacturing overhead $75,000 $180,000 Number of units 200 units 400 units1. What is the manufacturing overhead allocated to each mountain bicycle?2. What is the total manufacturing costs of one touring bicycle? Q: How wasAmericaimpacted by industrialgrowth and organized labor? A research center conducted a telephone survey of 2,000 adults to learn about the major economic concerns for the future. The survey results showed that 1,620 of the respondents think the future health of Social Security is a major economic concern. (a) What is the point estimate of the population proportion of adults who think the future health of Social Security is a major economic concern Travis makes and sells fishing lures. Hehas 56 fishing lures that he is putting intoboxes. Each box can hold 5 fishing lures.How many boxes can Travis fillcompletely?