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
KiRa [710]
3 years ago
14

The function below takes two parameters: a string parameter: CSV_string and an integer index. This string parameter will hold a

comma-separated collection of integers: '111,22,3333,4'. Complete the function to return the indexth value (counting from zero) from the comma-separated values as an integer. For example, your code should return 3333 (not '3333') if the example string is provided with an index value of 2. Hint: you should consider using the split() method and the int() function.

Computers and Technology
1 answer:
Ray Of Light [21]3 years ago
3 0

Answer:

Check the explanation

Explanation:

to complete the function that is to return the indexth value from the comma-separated values as an integer.

and since we've been hinted to consider using the split() method and the int() function.

we'll have to execute the below function which you can also see the screenshot in the attached image.

def get_nth_int_from_CSV(CSV_string,index):

l = CSV_string.split(',')

n = int(l[index])

return n

print(get_nth_int_from_CSV('111,22,3333,4',2))

You might be interested in
Tamara is writing a program to organize students in a class and needs to use operators to organize student grades, then compare
VMariaS [17]

Answer:   you said "Tamara needs to use

operators to organize the students' grades, then

operators to compare the results."

i think your right

Explanation:

sounds right.

3 0
3 years ago
1. Write a class for time objects that store three integer values for hour, minute, and second. Also, write a program to test th
Alla [95]

Answer:

1.

class TIME

{

int hour , min , sec ;

public :

TIME()

{

hour=min=sec=0;

}

TIME( int h , int m , int s )

{

hour = h;

min = m;

sec = s;

}

void change ( int Hour)

{

hour = Hour;

}

void stdtime()

{

if(hour>12)

cout<<"The Standard time is"<<(hour-12)<<":"<<min<<":"<<sec<<"P.M\n";

else

cout<<"The Standard time is"<<hour<<":"<<min<<":"<<sec<<"A.M\n";

}

void miltime()

{

cout<<"The Military time is"<<hour<<":"<<min<<":"<<sec<<" hours\n";

}

};

void main()

{

TIME A , B(13,25,30);

A .stdtime();

A.change(23);

A.miltime();

B.stdtime();

B.change(9);

B.miltime();

}

2.

class elevator

{

int CurrentFloor;

int GoingUp;

int GoingDown;

public:

elevator()

{

CurrentFloor=0;

GoingUp=1;

GoingDown=-1;

}

elevator(int floor)

{

CurrentFloor=floor;

GoingUp=1;

GoingDown=-1;

}

void goUp(int y)

{

if( CurrentFloor>3)

cout<<"\nNO MORE FLOORS\n";

else

CurrentFloor=CurrentFloor+y*GoingUp;

}

void goDown(int x)

{

if(CurrentFloor<0)

cout<<"\nNO MORE FLOORS";

else

CurrentFloor=CurrentFloor+x*GoingDown;

}

};

void main()

{

elevator A(1);

A.goUp(1);

A.goUp(1);

A.goUp(1);

A.goDown(1);

A.goDown(1);

}

6 0
3 years ago
A specially formatted encrypted message that validates the information the CA requires to issue a digital certificate is known a
Pavel [41]

Answer:

Certificate Signing Request(CSR).

Explanation:

Certificate Signing Request(CSR):- It is a message that is specially encrypted Which validates the information that is required by CA for the issuing of a digital certificate.

It is the first step towards getting your own SSL certificate.

So we conclude that the answer to this question is Certificate Signing Request (CSR).

5 0
3 years ago
What kind of eolr would you need to not have a open trouble on the facp
zhannawk [14.2K]

Answer:

here are three basic categories for fire alarm panel signals: trouble, supervisory, and alarm. Trouble Signal. A trouble signal is typically designated by a yellow light and means that there is an operational issue. For some more advanced systems, the panel may indicate the kind of problem and where it is located.

Explanation:

8 0
3 years ago
Suppose that you are asked to modify the Stack class to add a new operation max() that returns the current maximum of the stack
Advocard [28]

Answer:

Following are the code to the given points:

Explanation:

For point 8.1:

public String max()//defining a method max

{

   String maxVal=null;//defining a string variable that holds a value

   for(int x=0;x<n;x++)

   {

       if(maxVal==null || a[i].compareTo(maxVal)>0)//defining if blok to comare the value

       {

           maxVal=a[i];//holding value in maxVal variable

       }

   }

   return maxVal;//return maxVal variable value

}

For point 8.2:

public void push(String item)//defining a method push that accepts item value in a parameter

{

       a[n]=item;//defining an array to hold item value

       if(n==0 || item.compareTo(maxVals[n-1])>0)//use if to comare item value

       {

               maxVals[n]=item;//holding item value in maxVals variable

       }

       else

       {

               maxVals[n]=maxVals[n-1];//decreasing the maxVals value

       }

       n++;//incrementing n value

}

public String pop()//defining a method pop

{

       return a[--n];//use return value

}

public String max()//defining a method max

{

       return maxVals[n-1];//return max value

}

  • In the first point, the max method is declared that compares the string and returns its max value.
  • In the second point, the push, pop, and max method are declared that works with their respective names like insert, remove and find max and after that, they return its value.
7 0
3 years ago
Other questions:
  • Find every number from 1 to n (inclusive) that is a palindrome which starts with the digit 3. Do not user a helper function.
    10·1 answer
  • What are some characteristics of filtering junk email in Outlook 2016? Check all that apply.
    9·2 answers
  • A method that receives a two-dimensional array uses two ____ pairs following the data type in the parameter list of the method h
    11·1 answer
  • Of the following which would be the best data representation for this puzzle in a puzzle class?
    6·1 answer
  • Which industry has the highest employment figure for both teen and young adults in July, 2014?
    6·1 answer
  • The ________letter of the first word in the Complimentary Closing has a capital letter, everything else is keyed in lower case o
    8·1 answer
  • 100 points please hurry!!!
    14·2 answers
  • Refer to the exhibit. The PC is connected to the console port of the switch. All the other connections are made through FastEthe
    6·1 answer
  • One of the functions of an IDE is to check for: flowchart errors. Syntax errors. memory errors X input and output.​
    12·2 answers
  • NEED HELP ASAP
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!