how many sub-problems are formed by the recursive algorithm at each recursive call? provide the answer based on the recurrence relation

Answers

Answer 1

The following describes the general structure of recursive algorithms: When you can no longer break the problem down any further, solve each of the smaller sub-problems separately, then combine them to create the overall solution to the original problem.

Recursive Algorithm Rules:

For an algorithm to be classed as recursive it must follow several rules, shown below:

must have a base casemust change its state and move towards the base casemust call itself recursively

The running time for a recursive algorithm is most easily expressed by a recursive expression because the total time for the recursive algorithm includes the time to run the recursive call(s). A recurrence relation defines a function by means of an expression that includes one or more (smaller) instances of itself

To learn more about Recursive Algorithm, visit:https://brainly.com/question/25500569

#SPJ4


Related Questions

One technique for coping with stress, known as _____, is to avoid thinking about or experiencing the situation that makes you stressed and to convince yourself to think positive thoughts instead.

Answers

One technique for coping with stress, known as Stress reliving is to avoid thinking about or experiencing the situation that makes you stressed and to convince yourself to think positive thoughts instead.

What is stress?

Young people frequently have trouble learning how to handle stress. When stress is related to a catastrophic occurrence, such as a natural disaster, a family loss, school shootings, or community violence, youth can become especially overwhelmed.

Young people might feel better with stability and support from parents, carers, and instructors. When frightening or stressful situations occur in a child's life, worry is only natural.

By discussing these incidents with your kids, you can help them put frightening information into a more realistic context. Keep an eye on what your kids see and hear about stressful situations that occur in their life.

Therefore, One technique for coping with stress, known as Stress reliving is to avoid thinking about or experiencing the situation that makes you stressed and to convince yourself to think positive thoughts instead.

To learn more about stress, refer to the link:

https://brainly.com/question/25632718?

#SPJ1

there are applications of decision trees where the outcome variable is binary. the decision trees generated in these applications are called '

Answers

Real-world applications of the decision tree tool include engineering, civil engineering, law, and business. Categorical variable and continuous variable decision trees are the two categories into which decision trees may be split.

What are some uses for decision trees?Effective non-linear data management is accomplished using decision trees. Real-world applications of the decision tree tool include engineering, civil engineering, law, and business. Categorical variable and continuous variable decision trees are the two categories into which decision trees may be split.As non-leaf nodes always have two children (i.e., queries can only have yes/no responses), the CART algorithm only creates binary trees. Other Tree methods, such as ID3, on the other hand, can create Decision Trees with nodes having more than two children.Decision trees can be used in situations when the result variable is categorical. These apps create decision trees they refer to as "BLANK" trees.The DecisionTreeClassifier's entire tree structure is a binary tree, as can be shown from this sklearn page or my experiment. Each Decision TreeClassifier node can only have zero, one, or two child nodes, depending on the criterion—entropy or gini.    

To learn more about Decision trees refer to:

https://brainly.com/question/26675617

#SPJ4

Hugo has been asked to create a detailed plan for the series of
steps it will take to bring a new app to market. What role is he
playing on his team?
A caretaker
B taskmaster
C proceduralist
D director

Answers

Answer:

His role in the team is C. proceduralist

__________ requires that controls are put in place to secure the corporate network, prevent unauthorized access to systems and data, and ensure data integrity and availability in the event of a disaster or other disruption of service.

Answers

The 'Sarbanes-Oxley (SOX) Act' requires that controls are to be placed in order to secure the corporate network, prevent unauthorized access to data and systems, and ensure data availability and integrity in the event of a disaster or other disruption of services.

The 'Sarbanes-Oxley (SOX) Act' is a law the U.S. Congress passed in 2002 aimed at protecting investors from fraudulent financial reporting by corporations. The 'Sarbanes-Oxley (SOX) Act' mandated strict reforms to existing securities policies and regulations and imposed tough new penalties on lawbreakers.

You can learn more about Sarbanes-Oxley (SOX) Act at

https://brainly.com/question/28484220

#SPJ4

Which statement describes junction tables?

a. They create a many-to-many relationship, and they link two tables.
b. They create a one-to-one relationship, and they create orphaned data.
c. They link two tables, and they must exclude all nonkey fields.
d. They contain primary key fields of both tables, and they create a one-to-one relationship.

Answers

The statement that describes junction tables is options:

c. They link two tables, and they must exclude all non key fields.

d. They contain primary key fields of both tables, and they create a one-to-one relationship.

What does a database junction table do?

The primary key columns of the two tables you want to relate are contained in a junction table. Then you establish a connection between the junction table's matching columns and each of those tables' primary key columns. The title author table in the pubs database is a junction table.

Note that when there is something that could be replicated over numerous entires, such a date or a time, the junction table should be utilized to get your data to the lowest degree of normalization possible.

Learn more about tables from

https://brainly.com/question/12151322
#SPJ1

write a function called tokenizetelnum that inputs a telephone number as a string in the form (555) 555-5555. the function should use function strtok to extract the area code as a token, the first three digits of the phone number as a token and the last four digits of the phone number as a token. the seven digits of the phone number should be concatenated into one string. the function should convert the area-code string to int and convert the phone-number string to long. both the area code and the phone number should be printed.

Answers

We should write the C program to calculate this.

What is Function in c?

The fundamental building blocks of a C program are functions. A function is a collection of instructions denoted by a set of curly brackets () that accept inputs, perform calculations, and output the results. C programming supports modularity and reuse by enabling many calls to a same function.

The input/output header file, Stdio.h, contains all of...

Stdarg.h: This header file contains all of the different...

Conio.h: The console I/O file is what it is, and it has line breaks.

Code for the Problem:

#include<stdio.h>

#include <string.h>

void tokenizeTelNum (char *c){

   char *p;

   char arr[3];

   p = strtok (c,"-");

   // converting token string to int

   int num = (p[1]-48);

   num = num * 10 + (p[2]-48);

   num = num * 10 + (p[3]-48);

   p = strtok (c,"-");

   p = strtok (c,"-");

   

   // converting phone string to int

   long phone = (p[10]-48);

   phone = phone * 10 + (p[11]-48);

   phone = phone * 10 + (p[12]-48);

   phone = phone * 10 + (p[13]-48);

   

   printf("Toaken : %d\n",num);

   printf("Phone : %ld\n",phone);

}

int main(){

int arr[100];

printf("Enter number");

scanf("%s",arr);

tokenizeTelNum(arr);

return 0;

}

Output:

Enter number(555)-123-9875

Token : 555

Phone : 9875

Learn more about C Programs click here:

https://brainly.com/question/26535599

#SPJ4

jermaine is a security administrator for his company. he is developing a defense against attacks based on network-mapping methods. he prevents the internet control message protocol (icmp) from operating to stop attackers from using ping packets to discover the network layout, but he must also guard against operating system fingerprinting since many attacks are tailored to specific operating systems. what must jermaine be concerned about? group of answer choices

Answers

Since Jermaine is a security administrator for his company, The thing that is Jermaine be concerned about is Nmap ("Network Mapper").

What is the purpose of Network Mapper?

An open source tool for network exploration and security audits is called Nmap (short for "Network Mapper"). Although it functions perfectly against a single host, it was created to quickly scan huge networks.

Gordon Lyon developed the network scanner known as Nmap. Nmap sends packets and examines the answers to find hosts and services on a computer network. For probing computer networks, Nmap offers a variety of functionalities, including as host discovery, service detection, and operating system detection.

Note that Nmap ("Network Mapper") ("Network Mapper") is a security scanner for hacking and network research. It enables you to compile a "map" of the network by revealing hosts, ports, and services on a computer network.

Learn more about security administrator from

https://brainly.com/question/29222024
#SPJ1

you are using a spreadsheet to keep track of your newspaper subscriptions. you add color to indicate if a subscription is current or has expired. which spreadsheet tool changes how cells appear when values meet each expiration date?

Answers

Many spreadsheet software provide a tool called conditional formatting that enables you to apply special formatting to cells that satisfy particular criteria.

How to Using conditional formatting in Excel?The steps shown below can be used to add conditional formatting to an Excel workbook.Open an Excel workbook or make one.Choose the desired cell range. Using Ctrl+A, you may also select the entire worksheet.Choose New Rule from the Conditional Formatting drop-down menu after choosing the Home tab.Choose the type of rule you wish to create under Select a Rule Type in the New Formatting Rule dialogue.Select the desired Format Style under "Edit the Rule Description," then choose or type the prerequisites for the Rule Type and Format Style you've chosen.To save and apply the rule to the chosen cells, click OK.

To Learn more About conditional formatting Refer To:

brainly.com/question/25051360

#SPJ4

What is the difference between turn-based game mode and point-based game mode?

A.
Turn-based game mode involves players taking turns completing tasks; point-based game mode involves players accumulating points to get a high score.

B.
Turn-based game mode involves players racing against another player; point-based game mode involves players taking turns completing a task.

C.
Turn-based game mode involves movement; point-based game mode involves strategy.

D.
Turn-based game mode involves trying to capture the opponent’s flag; point-based game mode involves trying to gain control over a certain area.

Answers

Turn-based game modes involve the player taking turns completing tasks and Point-based game mode involves players accumulating points to get a high score.

What does it mean if a game is turn-based game modes?

A turn-based strategy (TBS) game is a sort of strategy game where players alternate turns. These games are typically wargames, particularly strategic wargames. As opposed to real-time strategy (RTS), which allows for simultaneous play by all players.

What are the control points in game control?

The Oldest House's leylines and meridians are its Control Points, where The Board ties themselves to the structure to get access.

A game mode is a unique setup that alters gameplay and has an impact on other game mechanics. A game with multiple play modes will present various settings in each one, altering how a certain game mechanic is used.

Hence, the difference between game modes is given.

To learn more about the Game from the given link

https://brainly.com/question/908343

#SPJ1

write a sql select command that displays the course code, course title, and instructor for all courses in the course list table.

Answers

A sql select command that displays the course code, course title, and instructor for all courses in the course list table will be SELECT course_code, course_title, instructor FROM course_list;

What is SQL?

SQL, or Structured Query Language, is a programming language developed for managing data in a relational database management system (RDBMS) or stream processing in a relational data stream management system (RDSMS). It is especially beneficial when dealing with structured data, which includes relationships between entities and variables. SQL has two major advantages over previous read-write APIs like ISAM and VSAM. It first introduced the concept of accessing multiple records with a single command.

To learn more about SQL
https://brainly.com/question/25694408

#SPJ4

______________ is not an example of antivirus software.

Answers

Option A:  Windows 7 is not an example of antivirus software.

Describe antivirus software with certain examples.

A computer system can be kept secure and free of viruses and other malware with the aid of antivirus software. McAfee, Kapersky, Norton, and other well-known brands are a few examples of antivirus software.

Note that a program called an antivirus product is made to find and get rid of viruses and other types of dangerous software from your laptop or computer. Malicious software, sometimes known as malware, is computer code that can damage your laptops and desktops as well as the data they contain.

Learn more about  antivirus software from

https://brainly.com/question/17209742
#SPJ1

Which of the following is not an example of anti-virus software?

a. Windows 7

c. MCAfee

b. Norton Antivirus

d. Smart cop​

how is a microprocessor different from an integrated circuit? a. microprocessors are the size of your thumb and integrated circuits are the size of your hand. b. microprocessors are faster, smaller and less expensive than integrated circuits. c. microprocessors control the flow of electrons and integrated circuits control the flow of protons. d. microprocessors include tape and disk storage whereas integrated circuits are part of an operating system.

Answers

The way that microprocessor is different from an integrated circuit is option  b. microprocessors are faster, smaller and less expensive than integrated circuits.

What distinguishes a microprocessor from an integrated circuit?

The brain of an electronics circuit is a microprocessor. An integrated circuit is a microprocessor, but not all integrated circuits are microprocessors. The microprocessor is a clever piece of integrated circuitry, similar to Professor X. It creates the brain of circuits that need computing power.

Therefore, Any type of small electronic device known as a microprocessor is equipped with the arithmetic, logic, and control circuitry required to carry out the operations of a central processing unit in a digital computer.

Learn more about microprocessor from

https://brainly.com/question/29243062
#SPJ1

if a router communicates path information by transmitting a copy of its routing table to its neighbor nodes, which routing algorithm is it using?

Answers

If a router communicates path information by transmitting a copy of its routing table to its neighbor nodes, which routing algorithm is it using distance-vector

What is distance-vector?Distance is the only metric used in distance-vector routing technologies. The distance between the router holding the packet and the router connected to the target network is typically stated in terms of the number of routers.In data networks, a distance-vector routing protocol chooses the most efficient path for data packets depending on distance. One router counts as one hop in distance-vector routing methods, which calculate distance based on the number of routers a packet must travel. As an illustration, neighbors B and C will share their routing tables with neighbors A, and vice versa. Step 2:The router modifies its local table to send packets to the neighbor if the path via a neighbor has a lower cost.

To learn more about distance-vector refer to:

https://brainly.com/question/2840850

#SPJ4

the blank compares your entry against its database and returns the result, a list of sites on that topic

Answers

Briefly-
Search engine

Which of the following is NOT true about conditions? 1.They are boolean expressions 2.They always produce the value True or False 3.You can only have one condition per conditional 4.They come between the keyword and colon in a conditional clause

Answers

4. They come between the keyword and the colon in a conditional clause is not true about a condition.

Define a condition in programming.

Programmers write a condition, which are statements that assess whether a program's actions are true or untrue. The if-then-else clause enables a condition execution dependent on the result of an expression evaluation.

A password is a fantastic illustration of a condition in programming. Passwords are "if, then" logic statements, allowing access to the application

Case/Switch statements are a sort of selection control mechanism and a condition statement can also be implemented inside the many switch case statements that let the value of a variable or expression alter the search and map-based control flow of a program's execution.

To learn more about a condition, use the link given
https://brainly.com/question/26134656
#SPJ9

Which kinds of sites are not credible because anyone can change the information on them?.

Answers

Answer:

Yes

Explanation:

Non-credible websites may have poor design, broken links, and grammar and spelling errors. They may lack author, date, and/or source information. They will not be associated with credible institutions, organizations, or entities. They may contain unbelievable or incorrect information.

what cloud computing service provides raw compute, storage, and network resources that are organized similarly to physical data centers?

Answers

IaaS (infrastructure as a service) is a cloud service model that provides organizations and individuals with on-demand access to infrastructure resources like compute, storage, networking, and virtualization through the cloud.

What is IaaS (infrastructure as a service)?

IaaS is a business model that provides internet-based pay-as-you-go access to IT infrastructure like compute, storage, and network resources. IaaS allows you to configure and request the resources you need to run your IT systems and applications.

While the IaaS provider is in charge of upkeep of the physical infrastructure, you are in charge of deploying, maintaining, and supporting your applications. You can manage your IT resources with flexibility and economy thanks to infrastructure as a service.

Why is Infrastructure as a Service important?

IaaS allows you to scale your compute capacity while spending less on IT. In the past, businesses owned and cared for their own computing equipment in a data center on-site.

However, this frequently required a sizable initial outlay to manage sporadic spikes in workload. For instance, during the holiday season, application traffic for an e-commerce company increases by three times. They need to buy more server machines to handle this traffic, but they sit idle the rest of the year.

To know more about IaaS (infrastructure as a service), visit: https://brainly.com/question/25618651

#SPJ4

you are troubleshooting a friend's computer and your diagnostic software reports a problem with the mft. what file system is your friend's computer using?

Answers

The file system that the friend's computer using is NTFS.

What is file system?In a computer, the way files are named and organized logically both for storage and retrieval is known as a file system, also written as filesystem. Without the need for a file system, data would not be isolated into distinct files and be challenging to locate and recover.Windows file systems. Microsoft Windows uses two main file systems: NTFS, which is the default file format for most contemporary iterations of this OS, and FAT, which has been inherited from the original DOS and has the later extension exFAT.File storage, which is also known as file-level storage or file-based storage, is a hierarchical storage system used to organize and store data on a network-attached storage (NAS) device or on a computer hard drive.

To learn more about file system refer to :

https://brainly.com/question/1226264

#SPJ4

a student is looking to add memory in order to speed up a tower computer. which type of memory module should the student be looking for?

Answers

He should use DIMM memory module in order to speed up a tower computer because Motherboards in tower computers accept dual inline memory modules (DIMMs) in the memory expansion slots. A motherboard supports a particular type of DIMM such as a DDR3 or DDR4 module.

What is DIMM Memory?

Dual In-Line Memory Modules, or DIMMs, are a kind of computer memory that plugs into the motherboard's memory slots. While SIMMs (Single In-Line Memory Modules), the predecessor of DIMMs, are 32-bit and require installation in matched pairs to achieve 64-bit data paths, DIMMs are natively 64-bit devices. This makes it possible for one DIMM to transfer data twice as quickly as one SIMM.

Dynamic random access memory (DRAM), the most popular form of primary memory, is found in DIMM memory chips. The CPU's cache memory layer is built using static RAM, which is more expensive and faster. A memory cell, which in DRAM is a single bit represented by a transistor and capacitor, is made. Each data bit is kept in a separate memory cell by the DIMM, which is mounted on a motherboard.

To learn more about RAM, visit:

https://brainly.com/question/13748829

#SPJ4

Discuss any four digital elements​

Answers

Answer:

Four digital elements of what actually? Particularly?

Explanation:

what is the true reason #ortnite made their game

A. to be a simulation of a war that happened on an island

B. for teen entertainment

C. to brainwash kids who are gullible so that they wont do their schoolwork

D. to be a collecting game







































P.S. the answer is A

Answers

Answer:

A

Explanation:

given int m[5][5]; what is memory address that corresponds to the cell m[1][1] if the base address of m is 1256 and an int occupies 4 bytes?

Answers

The memory address will be 1280 for given int m[5][5] to the cell m[1][1] if the base address of m is 1256 and an int occupies 4 bytes.

What Does Memory Address Mean?

A memory address is a one-of-a-kind identifier used by a device or CPU to track data. This binary address is defined by an ordered and finite sequence that allows the CPU to track each memory byte's location.

Bytes are assigned to memory addresses in modern computers, which are binary numbers assigned to random access memory (RAM) cells that hold up to one byte. Data larger than one byte is sequentially segmented into multiple bytes, each with its own address.

Data buses are used by hardware devices and CPUs to track stored data.

Data and programs must be stored in specific memory address locations prior to CPU processing.

To learn more about Memory Address, visit: https://brainly.com/question/28565988

#SPJ4

although all the solutions in today's lab are hazardous, the one particularly dangerous to the eyes is

Answers

The solutions in today's lab are hazardous, the one particularly dangerous to the eyes is NaOH.

What is Hazardous?

Anything that has the potential to be harmful is a hazard. Risk is the likelihood that something bad will happen if you are exposed to a hazard. Hazardous substances are those that exhibit one or more of the following properties: are combustible, corrosive, poisonous, or reactive.

Sodium hydroxide is severely corrosive and irritating. Any tissue that it comes into contact with could suffer from severe burns and long-lasting damage. Proteins can be hydrolyzed by sodium hydroxide, which can result in eye burns and long-term eye damage.The larynx may expand after inhaling sodium hydroxide, and the lungs may fill with fluid.The first signs of ingesting sodium hydroxide are stridor, vomiting, drooling, and abdominal pain. Consumption may result in shock and gastrointestinal tract perforation.The health effects of sodium hydroxide are caused by its corrosive properties rather than by its systemic toxicity.

Sodium hydroxide is severely corrosive and irritating. Any tissue that it comes into contact with could suffer from severe burns and long-lasting damage. Proteins can be hydrolyzed by sodium hydroxide, which can result in eye burns and long-term eye damage.

Learn more about NaOH click here:

https://brainly.com/question/13041783

#SPJ4

Create a poster concerning or showing the different principles of community action initiative.

Answers

To produce a poster depicting the various ideas of the community action programme, more research on these principles is required, which according to Putnam (2000) are related to:

Work as oneSocial justiceSustaining communitiesLearningPersonal determinationReflective practiceParticipation

How do you make a poster?

This mode of communication must include visual information and be shown in public locations. It is typically used to transmit political or artistic information. An effective poster should be based on a graphic project that includes a design that displays information in a clear and objective manner.

As a result, before writing a poster on the various principles of the community action programme, you may wish to conduct more study on those that are most important to the present needs of your community.

To learn more about poster
https://brainly.com/question/26066389

#SPJ4

Tamika is working on her GDD and explaining one of the four elements of her game by giving details about how the game is physically played and what equipment is necessary to play the game. Which element is Tamika working on?

A.
obstacles

B.
operation

C.
objective

D.
outcome

Answers

Tamika is continuing to work on her GDD and explaining one of her game's four elements. Tamika is working on the operation element. B is the correct answer.

What is GDD?

A game design document (GDD) is software that acts as a blueprint for developing your game.

It aids in the definition of your game's parameters and establishes the overall course of the endeavor, keeping the team on the same page.

A Game Design Document, or GDD for short, can be used to track the main themes, aesthetics, features, mechanics, and ideas of your game project.

Tamika is working on her GDD while attempting to explain one of her game's four aspects. Tamika is focusing on the operational aspect.

Thus, the correct option is B.

For more details regarding GDD, visit:

https://brainly.com/question/29243959

#SPJ1

describe the types of rules that would be needed for a rule-based intrusion detection system to detect a smurf attack.

Answers

The types of rules that would be needed for a rule-based intrusion detection system to detect a smurf attack are Network Intrusion Detection System, Network Node Intrusion Detection System and Host Intrusion Detection System.

What is a smurf attack?

A Smurf attack is a type of distributed denial of service (DDoS) attack that disables computer networks. The Smurf program accomplishes this by taking advantage of flaws in the Internet Protocol (IP) and Internet Control Message Protocol (ICMP).

The following are the steps in a Smurf attack:

First, the malware generates a network packet with a forged IP address, a process known as "spoofing."An ICMP ping message is included in the packet, asking network nodes that receive it to respond.These responses, known as "echoes," are then sent back to network IP addresses, creating an infinite loop.

To learn more about Smurf attack, visit: https://brainly.com/question/9473592

#SPJ1

felicia is a network engineer deploying a virtual private network (vpn) solution. the vpn operates using secure shell (ssh). when asked by a new help desk tech about which layer of the osi model it employs, how does felicia answer?

Answers

Felicia will tell that she uses the OSI model's 7th layer when deploying a virtual private network (VPN) that uses secure shell (SSH).

What Is the OSI Model?

The Open Systems Interconnection (OSI) model defines seven layers through which computer systems communicate over a network. It was the first standard model for network communications, and it was adopted in the early 1980s by all major computer and telecommunications companies.

The modern Internet is based on the simpler TCP/IP model rather than the more complex OSI model. The OSI 7-layer model, on the other hand, is still widely used because it helps visualize and communicate how networks work, as well as isolate and troubleshoot networking problems.

OSI was introduced in 1983 by representatives from major computer and telecommunications companies, and it was adopted as an international standard by ISO in 1984.

7th Layer (Application Layer)

End-user software such as web browsers and email clients use the application layer. It provides protocols that enable software to send and receive data as well as present meaningful data to users. The Hypertext Transfer Protocol (HTTP), File Transfer Protocol (FTP), Post Office Protocol (POP), Simple Mail Transfer Protocol (SMTP), and Domain Name System are all examples of application layer protocols.

To know more about the VPN, visit: https://brainly.com/question/16632709

#SPJ1

which is true? question 10 options: a) the fileoutputstream class includes println( ) b) a printwriter object should be closed using close( ) c) a printwriter constructor requires an outputstream object d) a fileoutputstream object opens an existing file

Answers

A printwriter object should be closed using close( ) is the true statement about output in java programming.

What is printwriter object ?

Java's PrintWriter class can be used to text-write any type of data, including int, float, double, String, and Object, either on the console or in a file. The PrintWriter object, for instance, can be used to print data on the console or log it in a file.

public class PrintWriter

extends Writer

It prints object representations that have been formatted to a text output stream. All of PrintStream's print methods are implemented by this class. It lacks ways for writing unencoded byte streams, which a programme should utilise instead of writing raw bytes.

Contrary to the PrintStream class, automatic flushing will only take place when one of the println, printf, or format methods is called as opposed to every time a newline character is output. Instead of the newline character, these methods employ the platform's internal concept of a line separator.

To learn ore about printwriter refer :

https://brainly.com/question/14298088

#SPJ4

Input a word. If it is "orange," print "Correct." Otherwise, print "Nope". What happens if you type in "ORANGE" or "OrANGE?" Does the capitalizing make a difference?

Sample Run 1
What color? orange
Sample Output 1
Correct
Sample Run 2
What color? red
Sample Output 2
Nope

Answers

Answer:

Yes, the capitalization does make a difference.

Explanation:

The program will check specifically for "orange", if the input is not the same, it will return "Nope".

To prevent this from happening, you can set the input to lowercase before comparing it with "orange".

A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes in word pairs that consist of a name and a phone number (both strings), separated by a comma. That list is followed by a name, and your program should output the phone number associated with that name. Assume the search name is always in the list.

Answers

Using knowledge in computational language in python it is possible to write a code that first takes in word pairs that consist of a name and a phone number, separated by a comma.

Writting the code:

# Get the data

inputs = input("Enter the input. >>> ").split(sep=" ")

# Split the data into lists

for pos in range(len(inputs)):

   inputs[pos] = inputs[pos].split(sep=",")

# Ask for a search query

query = input("Enter a name. >>> ")

# Check for the name in the first element of each item

for item in inputs:

   if item[0] == query:

       print(f"{query}'s phone number is {item[1]}.")

       break

# Store name numbers pairs inputs in a list splitted on whitespaces

namesAndNumbersListInpWithComma = input().split(" ")

# Input the name on next line

nameOn2ndLineToLookfor = input()

# Dictionary to map the names to numbers

mappedDictOfNameandCorrsNums = {}

# Go over namesAndNumbersListInpWithComma list

for indxOfProgLoop in range(0, len(namesAndNumbersListInpWithComma)):

   # Get name and number from each item (like get 'Joe', and '123-5432' from 'Joe,123-5432')

   # Split on comma and then get the first item of list

   nameToBeMappedInDict = namesAndNumbersListInpWithComma[indxOfProgLoop].split(",")[0]

   # Split on comma and then get the second item of list

   numToBeMappedInDict = namesAndNumbersListInpWithComma[indxOfProgLoop].split(",")[1]

   # Store name and corresponding number into dictionary 'mappedDictOfNameandCorrsNums'

   mappedDictOfNameandCorrsNums[nameToBeMappedInDict] = numToBeMappedInDict

# Print the asked number with no whitespaces at the start or end by using the mapped dictionary

print((mappedDictOfNameandCorrsNums[nameOn2ndLineToLookfor]).strip())

See more about python at brainly.com/question/18502436

#SPJ1

Other Questions
WHOEVER GETS THIS RIGHT GETS 95 POINTSDetermine which integer will make the inequality x 4 < 16 true. A) S:{16} B) S:{20} C) S:{21} D) S:{32} how would life on the farm have been different if snowball had seized control, rather than napoleon? An inlet pipe can fill a pool in 12hours, while and outlet pipe can empty a pool in 14 hours. If both pipes are open, how long will it take to fill the pool?____ hoursThis is a proportions math problem. The phenotypic ratio of the f2 generation of the dihybrid cross in mendels experiment with pea plant was?. Kenneth drove 174.2 miles in 3 7/20 hours. What was his average speed? nantor corporation has two divisions, southern and northern. the following information was taken from last year's income statement segmented by division: total company southern northern sales $ 4,600,000 $ 2,860,000 $ 1,740,000 contribution margin $ 1,950,000 $ 1,230,000 $ 720,000 divisional segment margin $ 1,030,000 $ 820,000 $ 210,000 net operating income last year for nantor corporation was $460,000. in last year's income statement segmented by division, what were nantor's total common fixed expenses? Which of the following can be used as evidence to reconstruct the early history of Earth? SELECT ALL THAT APPLY.ResponsesA. The size and composition of solar system objects.B. The number of impact craters on the surface of objects in the solar system.C. The ages of materials found on solar system objects.D. The average temperature of surface of objects in the solar system. How would removing an integral setting MOST likely affect a story? A. It would affect the storys tone but would not affect its plot. B. It would reduce the storys aesthetic appeal but would not affect its plot. C. It would significantly damage the storys effect. D. It would not affect the story in a drastic way. what is the iupac name for the compound shown? the molecule has the formula c h 3 c h 2 c o o h. iupac name: metro holdings inc. contracts to sell a commercial parking garage to new property llc. the contract provides that if metro does not close the deal by a certain date, it must pay the buyer one-half of the value of the property. this provision is not enforceable if it is? Which area of the country was least affected by the growing transportation networks in the united states in the 1800s? in other words, which area of the country remained relatively isolated from the knowledge of the rest of the world?. What system acquisition method has the advantages of freeing up it resources by bypassing the is department and avoids delays, and allows users to control the design of the application and make changes as needed?. Determine the inverse of the function f (x) = 3(x 4)2 + 5. inverse of f of x is equal to 4 minus the square root of the quantity of the quantity x minus 5 end quantity over 3 end quantity such that the domain of f (x) is x 4 inverse of f of x is equal to 4 minus the square root of the quantity of the quantity x minus 5 end quantity over 3 end quantity such that the domain of f (x) is x 4 inverse of f of x is equal to 4 minus the square root of the quantity x over 3 minus 5 end quantity such that the domain of f (x) is x 4 inverse of f of x is equal to 4 minus the square root of the quantity x over 3 minus 5 end quantity such that the domain of f (x) is x 4Question 4(Multiple Choice Worth 2 points)(02.06 MC)Determine the inverse of the function f(x) = log2(3x + 4) 5. f inverse of x is equal to 2 to the power of x plus 3 all over 2 f inverse of x is equal to the quantity x plus 5 end quantity squared minus 4 all over 3 f inverse of x is equal to 2 to the power of the quantity x plus 5 end quantity minus 4 all over 3 f inverse of x is equal to 2 to the power of the quantity x minus 5 end quantity plus 4 all over 3Question 5(Multiple Choice Worth 2 points)(02.06 MC)Given the graph of f(x), determine the range of f1(x).Rational function with one piece increasing from the left in quadrant 2 asymptotic to the line y equals 1 and passing through the point 2 comma 2 and asymptotic to the line x equals 3 and another piece increasing from the left in quadrant 4 asymptotic to the line x equals 3 passing through the point 4 comma 0 asymptotic to the line y equals 1. the solubility of barium fluoride baf2 in water is 7.5 x 10^-3 m. calculate the solubility product constant of this salt. the distance between the supply curve and the price the producer receives for a product for a given quantity supplied is referred to as: how you experience yourself in the present, depending on which part of yourself is most relevant at the time, is referred to as assume a smaller organization has a plan to implement a security program with three full-time staff and two or three groups of part-time roles from other parts of the business. what titles and roles do you recommend for the three full-time staff? what groups would commonly supply the part-time staff? which qualitative analysis test from this module can help distinguish between different kinds of ketones? can this same test give a positive result for 4-methylacetophenone? why? what's a summary of team? In the context of managing inventories in supply chains, _____ is the time between placement of an order and its receipt.