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
maria [59]
3 years ago
11

Provide a class Letter for authoring a simple letter. In the constructor, supply the names of the sender and the recipient: def

__init__(self, letterFrom, letterTo) Supply a method
Computers and Technology
1 answer:
STatiana [176]3 years ago
4 0

Answer:

class Letter:

   header="Dear "

   footer="Sincerely, \n"

   text=""

   def __init__(self,letterFrom,letterTo):

       self.header+=letterTo + ":\n\n"

       self.footer+=letterFrom + "\n"

   

   def getText(self):

       return self.header+self.text+self.footer

   def addLine(self,line):

       self.text+=line+"\n\n"

l = Letter("Cain", "Abel")

l.addLine("I am very happy to be writing to you at this joyful moment of my life.")

I.addLine("I am really sorry i killed you, I was a saddist back then.")

print(l.getText())

Explanation:

The Letter class a used to write a letter. The magic method "__init__" is used as a constructor to accept the sender and the recipient of the letter. The addLine method is called on an instance of the class to add string lines to the object while the getText method returns the entire written letter.

You might be interested in
Which is one of the modes of game advertising?
-BARSIC- [3]

Answer:

I'm pretty sure its A

Explanation:

The Media it the biggest platform rn

7 0
3 years ago
Read 2 more answers
Companies use computers for which of the following?
RoseWind [281]

Answer:

Buisness,creation,advertising.

7 0
3 years ago
What can you say about the different website that you used? do they have in common?​
Harrizon [31]
They all have ads. Some have inappropriate ads while some have irrelevant ads with respect to the website your on.
8 0
3 years ago
What can you do in the Mouse section of the Devices and Printers menu?
ANTONII [103]
See for yourself.
On windows hit windowskey+r
Type in control and then hit enter
Then search device and printers

The answer is you can add an change settings (dpi, color) of the mouse
3 0
3 years ago
Write the interface (.h file) of a class Player containing: A data member name of type string. A data member score of type int.A
mezya [45]

Answer:

Following are the class definition to this question:

class Player//defining a Player class  

{

private://use access specifier

string name;//defining string variable  

int score;//defining integer variabl  

public://use access specifier

void setName(string par_name);//declaring the setName method with one string parameter

void setScore(int par_score);//declaring the setScore method with one integer parameter

string getName();//declaring string method getName

int getScore();//declaring integer method getScore

};

Explanation:

In the above-given code, a Player class is defined, that hold a method and the variable which can be defined as follows:

  • It uses two access specifier, that are public and private.
  • In private, a string and an integer variable "name, score" is declared, which holds their respective value.
  • In public, it declares the get and set method, which holds the value from its parameters.
7 0
3 years ago
Other questions:
  • What is the first stage of perception
    6·2 answers
  • Database management systems _____. a. include transaction-processing reports for database analysis b. are used to create, organi
    6·1 answer
  • In Python Calculate the BMI of a person using the formula BMI = ( Weight in Pounds / ( ( Height in inches ) x ( Height in inches
    9·1 answer
  • Hard drive access time is measured in
    11·1 answer
  • A function ________ contains the statements that make up the function.
    5·1 answer
  • i give up on understanding and trying to pass science. ive now started clicking random letters as the choices. i actually got a
    5·1 answer
  • What are two ways you can open an application?
    11·2 answers
  • Line charts are best used for
    15·2 answers
  • Which slideshows design can not be use?
    12·1 answer
  • A help desk technician determines that a user's issue is caused by a corrupt file on their computer. What is the fastest way to
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!