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
alisha [4.7K]
3 years ago
8

g Write a recursive function all capital (L,start ,stop) that takes a string L and two integers. It returns a Boolean (True/Fals

e). The function will return True if there are ONLY upper case letters in the string from index start to index stop. The function will return False if there are any lower case letters in the string from index start to index stop.
Computers and Technology
1 answer:
Anton [14]3 years ago
8 0

Answer:

def recursive(L, start, stop):

         y = L[start:stop]

         print(y.isupper())

recursive("ALLow", 0, 3)

Explanation:

The code is written in python.

def recursive(L, start, stop):

The function is defined known as recursive. The function takes a string and 2 integers known as start and stop. The parameter L is a string and the other 2 parameter start and stop are integers which indicates the index range of the string L.  

y = L[start:stop]

A variable y is declared to store the string L with the index range from start to stop . Note start and stop are integers.

print(y.isupper())

The code prints True if the index range of the string L are all upper case else it print False.

recursive("ALLow", 0, 3)

This code calls the function with the required parameters L(string), Start(integer) and stop(integer)

 

You might be interested in
The method main of a class is called when you instantiate an object of that class like this: Box myBox = new Box();
WINSTONCH [101]

Answer:

The answer is "Option A"

Explanation:

In the OOPs programming language, the class and object concept is used, in which class is a collection of data members, and member function and object is known as real-time entity. In the class when the main method is created, so inside this method class object is created that's why the answer to this question is true.

7 0
3 years ago
Which two computer peripherals are connected to the computer through a port?
chubhunter [2.5K]
Most computer devices are connected to the computer through port
Keyboard through usb port
Printer through usb port
Hand point device through usb port
Also computer equipped with LPT port for printers and COM port for additional devices like external modems e.t.c
7 0
3 years ago
Find what the secret message is. Get Brainliest if you are fast and correct.
Firdavs [7]

Answer:

What does your digital footprint say about you?

Explanation:

Just follow the path from the end to the start, that's how I always get mazes.

8 0
2 years ago
Read 2 more answers
What tool is used to find and organize files on a mac
Margaret [11]

Answer:

the tool is literally called <u><em>The Finder.</em></u>

Explanation:

hope this helps

4 0
2 years ago
Develop a CPP program to test is an array conforms heap ordered binary tree. This program read data from cin (console) and gives
mafiozo [28]

Answer:

Following are the code to this question:

#include<iostream>//import header file

using namespace std;

int main()//defining main method

{

int ar[7];//defining 1_D array that stores value      

int i,x=0,l1=1,j; //defining integer variable

for(i=0;i<7;i++)//defining for loop for input value from user ends  

{

cout<<"Enter a Number: ";//print message

cin>>ar[i];//input value in array

if(l1<=2 && i>0)//using if block that checks the array values  

{

x++;//increment the value of x by 1  

}

if(l1>2 && i>0)//using if block that checks the array values  

{

l1=l1-2;//using l1 variable that decrases the l1 value by 2  

}

j=i-x;//using j variable that holds the index of the root of the subtree

if(i>0 && ar[j]>ar[i])// use if block that checks heap condition  

{

l1++; //increment the value of l1 variable

}

if(i>0 && ar[j]<ar[i])// using the if block that violate the heap rule  

{

cout<<ar[i]<<" "<<"Violate the heap";//print message with value

break;//using break keyword  

}

}

return 0;

}

Output:

1)

Enter a Number: -15

Enter a Number: -5

-5 Violate the heap

2)

Enter a Number: 45

Enter a Number: 0

Enter a Number: 55

55 Violate the heap

Explanation:

  • In the above-given C++ language code, an array "ar" and other integer variables " i,x,l1, j" is declared, in which "i" variable used in the loop for input values from the user end.
  • In this loop two, if block is defined, that checks the array values and in the first, if the block it will increment the value of x, and in the second if the block, it will decrease the l1 value by 2.
  • In the next step, j variable is used that is the index of the root of the subtree. In the next step, another if block is used, that checks heap condition, that increment the value of l1 variable. In the, if block it violate the heap rule and print its values.
5 0
3 years ago
Other questions:
  • Jerry suspects that information about his internet usage was sent to external websites without his knowledge. He is wary about t
    7·1 answer
  • What is the use of word art?
    10·1 answer
  • IBF Consultants, LLC provides consulting services in privacy and theft deterrence solutions. Another client has very sensitive d
    7·1 answer
  • Sulfur content is measured in
    11·1 answer
  • What includes two or more private, public, or community clouds, but each cloud remains separate and is only linked by technology
    7·1 answer
  • What is the base for a hexadecimal number system?
    11·1 answer
  • In this scenario, hackers launch cyber-attacks that affect several parts of the nationâs financial infrastructure over the cours
    8·1 answer
  • Outline the dangers arising as a result of using computers​
    12·1 answer
  • Given a number n, for each integer i in the range from 1 to n inclusive, print one value per line as follows:
    12·1 answer
  • The second generation of computer languages is a higher-level language than
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!