#Write a function called random_marks. random_marks should #take three parameters, all integers. It should return a #string. # #The first parameter represents how many apostrophes should #be in the string. The second parameter represents how many #quotation marks should be in the string. The third #parameter represents how many apostrophe-quotation mark #pairs should be in the string. # #For example, random_marks(3, 2, 3) would return this #string: #'''""'"'"'" # #Note that there are three apostrophes, then two quotation #marks, then three '" pairs. #Add your function here!

Answers

Answer 1

Answer:

def random_marks(apostrophe, quotation, apostrophe_quotation):

   return "'"*apostrophe + "\""*quotation + "'\""*apostrophe_quotation

   

print(random_marks(3, 2, 3))

Explanation:

Create a function called random_marks that takes apostrophe, quotation, and apostrophe_quotation as parameters. Inside the function, return apostrophe sign times apostrophe plus quotation mark times quotation plus apostrophe sign quotation mark times apostrophe_quotation.

Note that plus sign (+) is used to concatenate strings. Also, if you multiply a string with a number, you get that number of strings ("#"*3 gives ###).

Then, call the function with given parameters and print


Related Questions

A customer contacts the help disk stating a laptop does not remain charged for more than 30 minutes and will not charge more than 15%. Which of the following components are the MOST likely causes the issue? (Select three.) A. LCD power inverter B. AC adapter C. Battery D. Processor E. VGA card F. Motherboard G. Backlit keyboard H. Wireless antenna

Answers

Answer:

A. LCD power inverter

B. AC adapter

C. Battery

What are the pros and cons of using a linked implementation of a sparse matrix, as opposed to an array-based implementation?

Answers

Answer:

Linked lists and arrays are both linear data structures but while an array is a collection of items that can be accessed randomly, a linked list can be accessed sequentially.

A sparse matrix contains very few non-zero elements. For example;

_                        _

|  0   0   3  0  6    |

|   0   5   0  0  4   |

|   2   0   0  0  0   |

|_ 0   0   0  0  0 _|

In the implementation of a sparse matrix, the following are some of the pros and cons of using a linked list over an array;

PROS

i.  Linked lists are dynamic in nature and are readily flexible - they can expand and contract without having to allocate and/or de-allocated memory compared to an array where an initial size might need to be set and controlled almost manually. This makes it easy to store and remove elements from the sparse matrix.

ii. No memory wastage. Since the size of a linked list can grow or shrink at run time, there's no memory wastage as it adjusts depending on the number of items it wants to store. This is in contrast with arrays where you might have unallocated slots. Also, because the zeros of the sparse matrix need not be stored when using linked lists, memory is greatly conserved.

CONS

i. One of the biggest cons of linked lists is the difficulty in traversing items. With arrays, this is just of an order of 0(1) since the only requirement is the index of the item. With linked lists, traversal is sequential which means slow access time.

ii. Storage is another bottle neck when using linked lists in sparse matrix implementation. Each node item in a linked list contains other information that needs to be stored alongside the value such as the pointer to the next or previous item.

What is the difference between requirements and controls in the security process? Give examples of each.

Answers

Answer:

Security controls are those measures taken to prevent, identify, counteract, and reduce security risks to computer systems, whereas, Security Requirements are guidelines or frameworks that stipulates measures to ensure security control.

Explanation:

Security controls encompass all the proactive measures taken to prevent a breach of the computer system by attackers. Security requirements are those security principles that need to be attained by a system before it can be certified as safe to use.

Security controls are of three types namely, management, operational, and technical controls. Examples of technical controls are firewalls and user authentication systems. A statement like 'The system shall apply load balancing', is a security requirement with an emphasis on availability.

Write a program that create Employee class with fields id,name and sal and create Employee object and store data and display that data.

Answers

Answer:

Here is the C++ program for Employee class with fields id,name and sal.

#include <iostream>  // to use input output functions

#include <string>  //to manipulate and use strings

using namespace std;   // to access objects like cin cout

class Employee {  //class Employee

private:  

/* the following data members are declared as private which means they can only be accessed by the functions within Employee class */

  string name;  //name field

  int id; //id field

  double sal;   //salary field

public:    

  Employee();  // constructor that initializes an object when it is created

/* setName, setID and setSalary are the mutators which are the methods used to change data members. This means they set the values of a private fields i.e. name, id and sal */

  void setName(string n)  //mutator for name field

     { name = n; }        

  void setId(int i)  //mutator for id field

     { id = i; }        

  void setSalary(double d)  //mutator for sal field

     { sal = d; }  

/* getName, getID and getSalary are the accessors which are the methods used to read data members. This means they get or access the values of a private fields i.e. name, id and sal */

  string getName()  //accessor for name field

     { return name; }        

  int getId()  //accessor for id field

     { return id; }        

  double getSalary()  //accessor for sal field

     { return sal; }  };  

Employee::Employee() {  //default constructor where the fields are initialized

  name = "";  // name field initialized

  id = 0;  // id field initialized to 0

  sal = 0;   }   // sal field initialized to 0

void display(Employee);  

// prototype of the method display() to display the data of Employee

int main() {  //start of the main() function body

  Employee emp;  //creates an object emp of Employee class

/*set the name field to Abc Xyz which means set the value of Employee class name field to Abc Xyz  through setName() method and object emp */

  emp.setName("Abc Xyz");  

/*set the id field to 1234 which means set the value of Employee class id field to 1234  through setId() method and object emp */

  emp.setId(1234);

/*set the sal field to 1000 which means set the value of Employee class sal field to 1000  through setSalary() method and object emp */

  emp.setSalary(1000);    

  display(emp);  }   //calls display() method to display the Employee data

void display(Employee e) {  // this method displays the data in the Employee //class object passed as a parameter.

/*displays the name of the Employee . This name is read or accessed through accessor method getName() and object e of Employee class */

  cout << "Name: " << e.getName() << endl;  

/*displays the id of the Employee . This id is read or accessed by accessor method getId() and object e */

  cout << "ID: " << e.getId() << endl;

/*displays the salary of the Employee . This sal field is read or accessed by accessor method getSalary() and object e */

  cout << "Salary: " << e.getSalary() << endl;  }

Explanation:

The program is well explained in the comments mentioned with each statement of the program.

The program has a class Employee which has private data members id, name and sal, a simple default constructor Employee(), mutatator methods setName, setId and setSalary to set the fields, acccessor method getName, getId and getSalary to get the fields values.

A function display( ) is used to display the Employee data i.e. name id and salary of Employee.

main() has an object emp of Employee class in order to use data fields and access functions defined in Employee class.

The output of the program is:

Name: Abc Xyz                                                                                                      

ID: 1234                                                                                                                  

Salary: 1000

The program and its output are attached.

Other Questions
Show all work to solve 3x^2 5x 2 = 0. ASAP What is a downside of receiving a tax refund? HELP ASAP! The number of entertainment websites in 1995 wass 54. By 2004 there were 793 entertainment website..Approximately, what was the rate of change for the number of the websites for this time period?? Given that (x) = 4x + 5 and g(x) = x2 2x 2, find ( + g)(x). Which of the following is a sentence fragment?Laughed until his face turned red.My brother is funny.Their favorite hobby is drawing.I want to swim. I NEED HELP PLEASE, THANKS! :) A music concert is organized at a memorial auditorium. The first row of the auditorium has 16 seats, the second row has 24 seats, the third row has 32 seats, and so on, increasing by 8 seats each row for a total of 50 rows. Find the number of people that can be accommodated in the sixteenth row. (Show work) Describe three examples of anti-democratic actions by the U.S. during and after the war. Rank the steps of the (sandwich) ELISA procedure from first step to last step. Do not overlap any steps. Please answer this correctly Why did the Allies want to secure islands that held strategic importance in the Pacific? to establish bases from which to invade the Japanese mainland to resist Japan and invade from the northeast to free Jews being held in labor camps to destroy Japanese infrastructure The company had a net income of $248,462, and depreciation expenses were equal to $72,487. What is the firm's cash flow from financing activities? How many valence electrons are in the electron dot structures for the elements in group 3A(13)? An insurance company models the number of warranty claims in a week on a particular product that has a Poisson distribution with mean 4. Each warranty claim results in a payment of 1 by the insurer. Calculate the expected total payment by the insurer on the warranty claims in a week. Find the critical value z Subscript alpha divided by 2 that corresponds to the given confidence level. 80% Which best defines the different forms of sexual harassment? pls hurry the answer is not 36.......Given a * b=baba+ab, find (2*3)(3*2). The open-ended question post-project evaluation meeting should contain an opportunity to talk about possible additional projects and assume permission to use the customer as a reference with potential customers.a. Trueb. False Brainliest to whoever gets this correct This word problem has too much information. Which fact is not needed to solve the problem? Tanisha tried to sell all her old CDs at a garage sale. She priced them at $2 each. She put 80 CDs in the garage sale, but she sold only 35 of them. How many did she have left? A. All of the information is needed. B. Tanisha sold the CDs for $2 each. C. Tanisha put 80 CDs in the sale. D. Tanisha sold 35 of the CDs. Question: Hablamos espaol. Answer: A. Se habla espaol. B. Se hablas espaol. C. Se hablan espaol. D. Se hablamos espaol. When you make an electronic payment from your checking account, the bank __________ identifies the bank where you have an account. A:Withdrawal number b:Deposit number c:Certified number d:Routing number