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
erastova [34]
3 years ago
6

Define and implement a method that takes a string array as a parameter and returns the length of the shortest and the longest st

rings in the array
Computers and Technology
1 answer:
Drupady [299]3 years ago
7 0

Answer:

#HERE IS CODE IN PYTHON

#function to find length of shortest and longest string in the array

def fun(list2):

   #find length of shortest string

   mn=len(min(list2))

   #find length of longest string

   mx=len(max(list2))

   #return both the value

   return mn,mx

#array of strings

list2 = ['Ford', 'Volvo', 'BMW', 'MARUTI','TATA']

# call the function

mn,mx=fun(list2)

#print the result

print("shortest length is:",mn)

print("longest length is:",mx)

Explanation:

Create an array of strings.Call the function fun() with array as parameter. Here min() function will find the minimum string among all the strings of array and then len() function will find its length and assign to "mn". Similarly max() will find the largest string and then len() will find its length and assign to "mx". Function fun() will return "mn" & "mx".Then print the length of shortest and longest string.

Output:

shortest length is: 3

longest length is: 5

You might be interested in
In design and implementation of any _____ reasoning application, there are 4 Rs involved: retrieve, reuse, revise, and retain.
Burka [1]

Answer:

case-based.

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 on how to perform a specific task and solve a particular problem.

Simply stated, it's a computer program or application that comprises of sets of code for performing specific tasks on the system.

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.

3. Design.

4. Development (coding).

5. Testing.

6. Implementation and execution.

7. Maintenance.

A case-based reasoning application refers to a knowledge-based system that is designed and developed to use previous case scenarios (similar past problems) to interprete or proffer a solution to a problem.

In design and implementation of any case-based reasoning application, there are four (4) Rs involved: retrieve, reuse, revise, and retain.

5 0
3 years ago
Explain why there are fundamental ideas of software engineering that apply to all types of software systems.
olasank [31]

Solution:

Because of all software systems have common quality attributes, including  

Fundamental software engineering activities.  The four basic process activities of specification, development, validation and evolution are organized differently in different development processes.  The software is implemented either by developing a program or programs or by configuring an application system. Such that at they (Software engineer) have been made keeping in mind project development. They hence, apply to all software systems and even non software systems. They are the fundamentals for any kind of project development.

Thus this is the required answer..


5 0
3 years ago
Iven the code fragment below with nested if statements, rewrite the code to combine all the tests into one if statement with mul
Georgia [21]

Answer:

See Explanation Below

Explanation:

The new code segment is

int feb = 28;

if ((year % 4) == 0 && (year % 100) != 0) // assume that year is an integer with a valid year value

{

System.out.println("This is a leap year");

feb = 29;

}

Assume year = 2020, the assigned value of feb is 29;

Reason below;

At line 2 of the new code segment, two conditions are tested both of which must be satisfied.

1. year % 4 == 0

2020 % 4 = 0

0 = 0 (True)

2. year % 100 != 0

2020 % 100 != 0

20 != 0 (True)

Since both conditions are true, the value assigned to feb will be 29 and

"This is a leap year" will be printed without the quotes

8 0
3 years ago
Read 2 more answers
Adam is so good at playing arcade games that he will win at every game he plays. One fine day as he was walking on the street, h
klio [65]

Answer:

what the answer chaoices

Explanation:

brainlest me please

3 0
3 years ago
Byron wants to use Quick Parts to insert reusable content into a company Word document. Where will he access this option? Design
storchak [24]

Answer:

Insert tab

Explanation:

To use <em>Quick Parts</em>, first go to Insert tab then text group. The icon of <em>Quick Parts</em> is there in the attached picture.You can use the <em>Quick Part Gallery</em> to create, store, and reuse pieces of content, including <em>AutoText</em>, document properties (such as title and author), and fields. These reusable blocks of content are also called <u><em>building blocks</em></u>. <em>AutoText</em> is a common type of building block that stores text and graphics. You can use the <em>Building Blocks Organizer</em> to find or edit a building block

7 0
3 years ago
Read 2 more answers
Other questions:
  • Being able to express your thoughts in an email is a primary technology skill. True or False
    8·2 answers
  • Manuel is working on a project in Visual Studio. He wants to keep this program showing on the entire desktop, but he also needs
    7·1 answer
  • Two or more computers that are linked together are called which of the following
    10·1 answer
  • Mr. Green maintains a spreadsheet containing data on all of his employees, including name, job profile, monthly salary, and home
    15·1 answer
  • How is a computer component, such as a network card, commonly marked for identification?
    12·1 answer
  • A network host with an IP address of 192.168.10.200 wants to send a message to a destination computer with an assigned IP addres
    6·1 answer
  • How do you do this question
    11·1 answer
  • You type a web address in your web browser. order the steps, which describe the internet name resolution process for the web add
    7·1 answer
  • What type of e-mail typically lures users to sites or asks for sensitive information?
    7·1 answer
  • Which of the following protocols is used by an email client to retrieve messages from an email server, giving users the option t
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!