1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mariulka [41]
3 years ago
14

Assume the availability of a function named oneMore. This function receives an integer and returns one more than its parameter.

So, pass oneMore( 12) and it will return 13. DO NOT DEFINE this function-- just assume it is available. YOUR TASK: write an expression whose value is 5 but in your expression you can only use the integer literal 0. You can not use anything with the digits 1-9 and you cannot use any arithmetic operators like + - * /. But you can use 0 and you can make calls to the function oneMore.
Computers and Technology
1 answer:
jek_recluse [69]3 years ago
7 0

Answer:

oneMore(oneMore(oneMore(oneMore(oneMore(0)))))

Explanation:

  • As a function has been explained which when given an integer results as a next integer. oneMore(given-integer)= next integer
  • As we are restricted to use 0 only and can't use operators like + - * /.
  • We have to obtain a value 5
  • So doing step-by-step:

             (oneMore(0))=1

             (oneMore(oneMore(0)))=2

             (oneMore(oneMore(oneMore(0))))=3

             (oneMore(oneMore(oneMore(oneMore(0)))))=4

             oneMore(oneMore(oneMore(oneMore(oneMore(0)))))=5

You might be interested in
The compare_strings function is supposed to compare just the alphanumeric content of two strings, ignoring upper vs lower case a
Korolek [52]

Answer:

There is a problem in the given code in the following statement:

Problem:

punctuation = r"[.?!,;:-']"

This produces the following error:

Error:

bad character range

Fix:

The hyphen - should be placed at the start or end of punctuation characters. Here the role of hyphen is to determine the range of characters. Another way is to escape the hyphen - using using backslash \ symbol.

So the above statement becomes:

punctuation = r"[-.?!,;:']"  

You can also do this:

punctuation = r"[.?!,;:'-]"  

You can also change this statement as:

punctuation = r"[.?!,;:\-']"

Explanation:

The complete program is as follows. I have added a print statement print('string1:',string1,'\nstring2:',string2) that prints the string1 and string2 followed by return string1 == string2  which either returns true or false. However you can omit this print('string1:',string1,'\nstring2:',string2) statement and the output will just display either true or false

import re  #to use regular expressions

def compare_strings(string1, string2):  #function compare_strings that takes two strings as argument and compares them

   string1 = string1.lower().strip()  # converts the string1 characters to lowercase using lower() method and removes trailing blanks

   string2 = string2.lower().strip()  # converts the string1 characters to lowercase using lower() method and removes trailing blanks

   punctuation = r"[-.?!,;:']"  #regular expression for punctuation characters

   string1 = re.sub(punctuation, r"", string1)  # specifies RE pattern i.e. punctuation in the 1st argument, new string r in 2nd argument, and a string to be handle i.e. string1 in the 3rd argument

   string2 = re.sub(punctuation, r"", string2)  # same as above statement but works on string2 as 3rd argument

   print('string1:',string1,'\nstring2:',string2)  #prints both the strings separated with a new line

   return string1 == string2  # compares strings and returns true if they matched else false

#function calls to test the working of the above function compare_strings

print(compare_strings("Have a Great Day!","Have a great day?")) # True

print(compare_strings("It's raining again.","its raining, again")) # True

print(compare_strings("Learn to count: 1, 2, 3.","Learn to count: one, two, three.")) # False

print(compare_strings("They found some body.","They found somebody.")) # False

The screenshot of the program along with its output is attached.

4 0
3 years ago
How are stop motion special effects in animated films created
bekas [8.4K]
Just press on the slow motion button I think
7 0
3 years ago
As a producer you are willing to supply the most goods at the highest price this is because the highest price earns you the
aleksandrvk [35]

Answer:

most money

Explanation:

common sense

8 0
3 years ago
Which connection configuration offers faster speeds, higher security, lower latencies, and higher reliability?
Oliga [24]

Answer:

ExpressRoute

Explanation: ExpressRoute is an Azure service that allows a user to create a private connection with other datacenters /infrastructures. It gives an enterprise the opportunities to effectively extend and expand its networks into cloud services offered by Microsoft cloud, it can also be described as a cloud Integration option that can be used by a private network to plug-in into a Microsoft cloud services.

7 0
3 years ago
If the authenticator is encrypted with the sender's private key, it serves as a signature that verifies origin, content, and seq
brilliants [131]

Answer:

A. True.

Explanation:

Authentication in computer technology can be defined as the process of verifying the identity of an individual or electronic device. Authentication work based on the principle (framework) of matching an incoming request from a user or electronic device to a set of uniquely defined credentials.

Basically, authentication ensures a user is truly who he or she claims to be, as well as confirm that an electronic device is valid through the process of verification

Digital certificates, smart cards, picture passwords, and biometrics are used to perform an authentication.

Hence, if the authenticator is encrypted with the sender's private key, it serves as a signature that verifies origin, content, and sequencing.

<em>This simply means that, when a user enters his or her private key (password); the authenticator matches the private key to the uniquely defined credentials. Permission and access is granted by the authorization system right after a successful authentication. </em>

8 0
3 years ago
Other questions:
  • Most LO/TO hazards occur under the following circumstances, EXCEPT:
    6·2 answers
  • Type the correct answer in the box. Spell all words correctly.
    13·1 answer
  • What kind of company would hire an Information Support and Service employee?
    14·2 answers
  • Which of the following things could you do in order to tell if a pair of colors has strong contrast? A. Look at the colors on th
    12·1 answer
  • Which type of account is typically the MOST liquid?
    15·1 answer
  • What is motivation and state the two forms​
    14·1 answer
  • Describe two circumstances where access services might get implemented by organizations please.​
    9·1 answer
  • Which componet is the smallest unit in a spreadsheet
    15·1 answer
  • Need help with python coding
    12·2 answers
  • Identify a characteristic that is a disadvantage of cloud-based hosting.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!