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

Answers

Answer 1

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.


Related Questions

True or False: One benefit of virtualization is that it allows for better use of already existing hardware that may not be seeing full utilization.

Answers

Answer:

True.

Explanation:

Virtualization can be defined as a technique used for the creation of a virtual platform such as a storage device, operating system, server, desktop, infrastructure or computing resources so as to enable the sharing of resources among multiple end users. Virtualization is usually implemented on a computer which is referred to as the "host" machine.

Generally, to use the virtualization technology on a computer, it must be enabled in the BIOS/UEFI).

Additionally, VMware tools can be installed on host computers to check which processes are having high CPU usage by using vimtop, as well as checking if vCenter Server is swapping.

Hence, one benefit of virtualization is that it allows for better use of already existing hardware that may not be seeing full utilization. Hardware components such as storage devices, central processing unit (CPU), random access memory (RAM), host computers are extensively put into use.

If every company is now a technology company then what does this for every student attending a business college? Provide specific examples to support your example

Answers

Answer:

The fact that most companies today are tech companies is not an obstacle for people studying in business schools.

Thus, despite the fact that today's large companies, such as Microsoft, Tesla, Apple or Amazon dedicate themselves almost exclusively, or have their business base, to technology, a group of suitable professionals will always be necessary in the field of technology. economic and financial management of these companies, to avoid that they incur in bad business, bad investments, errors in the payment of taxes or problems of the same tenor.

What is the output?

answer = 0

for numA in [2,4]:

for numB in [3, 5]:

answer = answer + numA + numB

print (answer)

Output:

Answers

Answer:

The output is 28

Explanation:

Required

Determine the output of the code segment

The first line initializes "answer" to 0

The next two lines iterate through lists [2,4] and [3,5

Each of these lists have two elements; So, the number of iterations is 2 * 2 i.e. 4.

In the first iteration

numA = 2, numB = 3, answer = 0

So:

[tex]answer = answer + numA + numB= 0 + 2 + 3 = 5[/tex]

In the second iteration

numA = 2, numB = 5, answer = 5

So:

[tex]answer = answer + numA + numB= 5 + 2 + 5 = 12[/tex]

In the third iteration

numA = 4, numB = 3, answer = 12

So:

[tex]answer = answer + numA + numB= 12 + 4 + 3 = 19[/tex]

In the fourth iteration

numA = 4, numB = 5, answer = 19

So:

[tex]answer = answer + numA + numB= 19 + 4 + 5 = 28[/tex]

Lastly, the value of "answer" is printed

Hence, the output is 28

Answer: 28

Explanation: got it right on edgen

Which statement best describes the refraction of light

Answers

Answer:

Two wave pulses move toward each other along a rope. The two waves produced have different speeds.

Explanation:

Refraction of light is the change in the speed of light as it travels. The correct option is C.

What is refraction?

The bending of light as it passes from one medium to another is caused by the difference in the speed of light in the different media.

When viewed through a medium with a different refractive index, this bending of light can cause objects to appear distorted or displaced.

The change in direction and speed of light as it passes from one medium to another, such as from air to water or from water to glass, is referred to as refraction.

This happens because the speed of light changes when it moves from one medium to another due to a change in the refractive index of the medium.

Thus, the correct option is C.

For more details regarding refraction, visit:

https://brainly.com/question/14760207

#SPJ3

Your question seems incomplete, the probable complete question is:

Which statement best describes refraction of light? It

A. produces echoes

B. happens only in mirrors

C. is the change in the speed of light as it travels

D. happens because light bounces from a surface

Write a program that will read a line of text as input and then display the line with the first word moved to the end of the line

Answers

Answer:

The program in Python is as follows:

text_input = input("Enter text: ")

first_word = text_input.split(" ")

new_text = text_input.replace(first_word[0], "")

new_text = new_text + " "+ first_word[0]

print("New Text: " + new_text)

Explanation:

This line gets a line of text from the user

text_input = input("Enter text: ")

This line splits the text into list

first_word = text_input.split(" ")

This line deletes the first word of the string

new_text = text_input.replace(first_word[0], "")

This line appends the first word to the end of the string

new_text = new_text + " "+ first_word[0]

This line prints the new text

print("New Text: " + new_text)

Define the following propositions: c: I will return to college. j: I will get a job. Translate the following English sentences into logical expressions using the definitions above: (a) Not getting a job is a sufficient condition for me to return to college. (b) If I return to college, then I won't get a job.

Answers

Answer:

Answered below

Explanation:

//Program is written in Kotlin programming language

//Initialize Boolean variables

var getJob:Boolean = true

var returnToCollege: Boolean = false

//First sentence. If no job then return to //college.

if( !getJob ) {

returnToCollege = true

}

//Second sentence. If you have returned to college then you cannot get a job.

if (returnToCollege == true){

getJob = false

}

how would i change this:
" try:
userChoice = input("Would you like to Add or Multipy?(A/M): ")
except:
print("Please enter 'A' or 'M'") "

so it only allows me to put "A" or "M" so that it runs the except part

Answers

You wouldnt use a try and except statement. Use a loop.

what are the differences of location decisions between manufacturing establishment and service establishment?​

Answers

Organizations can be divided into two broad categories: manufacturing organizations and service organizations, each posing unique challenges for the operations function. There are two primary distinctions between these categories. First, manufacturing organizations produce physical, tangible goods that can be stored in inventory before they are needed. By contrast, service organizations produce intangible products that cannot be produced ahead of time. Second, in manufacturing organizations most customers have no direct contact with the operation. Customer contact occurs through distributors and retailers. For example, a customer buying a car at a car dealership never comes into contact with the automobile factory. However, in service organizations the customers are typically present during the creation of the service. Hospitals, colleges, theaters, and barber shops are examples of service organizations in which the customer is present during the creation of the service.

images Manufacturing organizations

Organizations that primarily produce a tangible product and typically have low customer contact.

images Service organizations

Organizations that primarily produce an intangible product, such as ideas, assistance, or information, and ...

Drag each tile to the correct box.

Match the elements used in web searches to their functions.

to make an exact phrase

appear in all the results

to ensure all search terms

appear in the results

to ensure that at least one of the

search terms appear in the results

to exclude specific words from

the results

quotation marks

the AND operator

the OR operator

the minus sign

um All rights reserved.

Answers

Answer:

1. The quotation marks.

2. The AND operator.

3. The OR operator.

4. The minus sign.

Explanation:

Boolean logic refers to a theory of mathematics developed by the prominent British mathematician, called George Boole. In Boolean logic, all variables are either true or false and are denoted by the number "1" or "0" respectively; True = 1 or False = 0.

Additionally, Boolean logic allow users to combine keywords with Boolean operators (quotes, AND, OR, near/n) to give a more personalized and relevant search results.

The various elements used in web searches and their uses are listed below;

1. The quotation marks: to make an exact phrase appear in all the results.

Some examples of a Boolean logic search using quotes as the Boolean operator are;

"What is the name of the president of USA""How to pass my exams with flying colors""Brainly is the best educational platform

2. The AND operator: to ensure all search terms appear in the results.

An example is searching; the name of the new president of USA AND his wife.

3. The OR operator: to ensure that at least one of the search terms appear in the results.

An example is searching, how to grow slim OR loose weight in a week.

4. The minus sign: to exclude specific words from the results.

An example is searching, list of all the members on brainly minus moderators.

Answer:

The answer is:

Quotation marks - to make an exact phrase  appear in all the results.

The AND operator - to ensure all search terms  appear in the results.

The OR operator - to ensure that at least one of the  search terms appear in the results.

The minus sign - to exclude specific words from  the results.

Explanation:

I got it right on the Edmentum test.

Complete the program by writing and calling a method that converts a temperature from Celsius into Fahrenheit.

Answers

Missing Code:

import java.util.Scanner;

public class CelsiusToFahrenheit {

// FINISH: Define celsiusToFahrenheit method here

public static void main (String [] args) {

Scanner scnr = new Scanner(System.in);

double tempF = 0.0;

double tempC = 0.0;

System.out.println("Enter temperature in Celsius: ");

tempC = scnr.nextDouble();

// FINISH

System.out.print("Fahrenheit: ");

System.out.println(tempF);

return;

}

}

Answer:

Replace // FINISH: Define celsiusToFahrenheit method here

with

public static double celsiusToFahrenheit(double tempC){

   double tempF = (tempC * 9/5) + 32;

   return tempF;

}

Replace // FINISH

with

tempF = celsiusToFahrenheit(tempC);

Explanation:

The first addition to the program:

This line defines the method

public static double celsiusToFahrenheit(double tempC){

This line calculates the Fahrenheit equivalent of the temperature in Celsius

   double tempF = (tempC * 9/5) + 32;

This line returns the temperature in Fahrenheit back to the main method

   return tempF;

}

The second addition to the program:

This line gets the returned tempF from the celsiusToFahrenheit module

tempF = celsiusToFahrenheit(tempC);

See attachment for complete program

Write a function in Java that implements the following logic: Given three ints, a, b, and c, one of them is small, one is medium and one is large. Return true if the three values are evenly spaced, so the difference between small and medium is the same as the difference between medium and large.

Answers

Answer:

Follows are the code to this question:

public class Main//defining a class Main

{

public static boolean evenly_Spaced(int a,int b,int c)//defining a method evenly_Spaced that accepts three integer parameter  

   {

if(a-b==b-c)//defining if block to check small and the medium is the same as the difference between medium and large.

           return true;//return value true

       else//else block  

           return false;//return value false

   }

public static void main(String[] args) //defining the main method

{

    int a,b,c;//defining integer variable

    a=4;//assigning value  

    b=6;//assigning value  

    c=8;//assigning value  

    System.out.println(evenly_Spaced(a,b,c));//use print method to call evenlySpaced  

}

}

Output:

True

Explanation:

In the above code, a boolean method "evenly_Spaced" is declared, that accepts three integer variables in its parameter and defined the if block to check the smallest and the medium value is the same as the difference value in between the medium and large value, and return its value.

In the next step, the main method is defined, and inside this three integer variable "a, b, and c" is declared, that holds a value and passes into the method and print its return value.

For each of the descriptions below perform the following tasks:

a. A book is identified by its ISBN number and it has a title, a price, and a date of publication. It is published by a publisher which has its own ID number and a name. Each book has exactly one publisher but one publisher typically publishes multiple books over time.
b. A book is written by one or multiple authors. Each author is identified by an author number and has a name and a date of birth. Each author has either one or multiple books. In addition, occasionally data are needed regarding prospective authors who have not yet published any books.
c. In the context specified in 2a and 2b better information is needed regarding the relationship between a book and its authors. Specifically, it is important to record the percentage of the royalties that belong to a specific author whether or not a specific author is a lead author of the book and each author's position in the sequence of the book's authors.
d. A book (2a) can be part of a series which is also identified as a book and has its own ISBN number. One book can belong to several sets and a set consists of at least one but potentially many books.

Answers

Explanation:

i dont really know. I am just answering for the sake of points

what are the three main components of an operating system? define each of them.

Answers

The three main components of an operating system are:

1. manage the computer's resources (this includes the central processing unit, memory, printers, and disk drives).

2. establish a user interface (this is where the human interacts with a computer, website or application. the UI, also known as user interface, is to make the user's experience easy and intuitive).

3. execute and provide services for applications software (this is the interface between the application program and the hardware, which gets carried out from OS).

Ann Marie would like to test her hypothesis. To do that, she needs to show groups of data that are similar in some way. Which data-mining techniques should she use?

Answers

Answer:

Clustering Analysis

Explanation:

Clustering analysis or otherwise called cluster analysis is a task composed of grouping sets of objects in a way that objects in the same group tend to be more similar to each other than to objects in some other groups. Like the question said, Ann would love to show groups of data that are similar in some way. This makes Clustering analysis the perfect choice of pick, because of the similarity that's needed. A result of cluster analysis is capable of being used in the creation of something like customer profiling.

Why computer literacy is vital to access in business work

Answers

Answer:

The description of the circumstance is summarized throughout the answer section below.

Explanation:

Computer literacy, particularly throughout the working population, tends to help somebody to gain a primary influence over investments, also because the working population would then fully understand what else to do. It, therefore, makes it possible to implement that many key business functions that are using extra sophisticated technology also because the workforce seems to have elevated computer literacy.

What is the acronym that helps you remember the order of math operations?

Answers

Answer: BEDMAS

Explanation:

for business teachings its BEDMAS

Write a function named is_sub_dict that accepts two dictionaries from strings to strings as its parameters and returns True if every key in the first dictionary is also contained in the second dictionary and maps to the same value in the second dictionary. For example, given the dictionaries below, map1 is a sub-dict of map2, so the call of is_sub_dict(map1, map2) would return True. The order of the parameters does matter, so the call of is_sub_dict(map2, map1) would return False.

Answers

def is_sub_dict(dict1, dict2):

   one = dict1.keys()

   two = dict2.keys()

   for x in one:

       if x in two:

           if dict1[x] == dict2[x]:

               pass

           else:

               return False

       else:

           return False

   return True

I wrote the code in python 3.8. I hope this helps.

Write code to play a Tic-tac-toe tournament. Tic-tac toe is a game for two players who take turns marking the spaces with Xs and Os in a 3x3 grid. The purpose of the game is to place three of your marks in a horizontal, vertical or diagonal.

Answers

Answer:

Explanation:

The following code is written in Python and is a full Two player tic tac toe game on a 3x3 grid that is represented by numbers per square.

# Making all of the main methods of the game

board = [0,1,2,

        3,4,5,

        6,7,8]

win_con = [[0,1,2],[3,4,5],[6,7,8],

           [0,3,6],[1,4,7],[2,5,8],

           [0,4,8],[2,4,6]] # possible 3-in-a-rows

def show():

   print(board[0],'|',board[1],'|',board[2])

   print('----------')

   print(board[3],'|',board[4],'|',board[5])

   print('----------')

   print(board[6],'|',board[7],'|',board[8])

def x_move(i):

   if board[i] == 'X' or board[i] == 'O':

       return print('Already taken!')

   else:

       del board[i]

       board.insert(i,'X')

def o_move(i):

   if board[i] == 'X' or board[i] == 'O':

       return print('Already taken!')

   else:

       del board[i]

       board.insert(i,'O')  

 

# Creating the main loop of the game

while True:

   turn_num = 1

   board = [0,1,2,3,4,5,6,7,8]

   print('Welcome to Tic-Tac-Toe!')

   print('AI not implemented yet.')

   while True:

       for list in win_con: #check for victor

           xnum = 0

           onum = 0

           for num in list:

               if board[num] == 'X':

                   xnum += 1

               elif board[num] == 'O':

                   onum += 1

               else:

                   pass

           if xnum == 3 or onum == 3:

               break

       if xnum == 3 or onum == 3: # break loops

           break

       if turn_num > 9: # Check if there are any more moves available

           break

       show()

       if turn_num % 2 == 1:

           print('X\'s turn.')

       else:

           print('O\'s turn.')

       move = int(input('Choose a space. '))

       if turn_num % 2 == 1:

           x_move(move)

       else:

           o_move(move)

       turn_num += 1

   if xnum == 3:  #If game ends

       print('X Won!')

   elif onum == 3:

       print('O Won!')

   else:

       print('Draw!')

   play_again = input('Play again? Y or N ')

   if play_again == 'Y' or play_again == 'y':

       continue

   else:

       break

There are several security frameworks and architectures available to use as templates for creating a secure environment. These include ISO, NIST, COBIT, ETSI, RFC, and ISA/IEC. Select three security frameworks/architectures and use the Internet to research each of them. How are they predominately used

Answers

Answer:

Answered below

Explanation:

The International Standards Organisation (ISO) security framework is very well recognised and used by businesses and companies worldwide because of its effectiveness and high quality standards.

The Control Objectives for Information and related Technology (COBIT) framework, is a security framework widely used in finance companies for identification and mitigation of risks.

The US National Institute of Standards and Technology (NIST) framework has an abundance of information security best practices and standards and is trusted by large enterprises due to its legacy over the years.

*explain why computer literacy is vital to access in today’s business work

Answers

Answer:

Computer literacy is vital to access in today’s business work because of advanced technology which ensured that most companies run a computerized system as against the manual one which was existent in the past.

The use of computerized system enables work to be done faster and in a more accurate manner which is why bring a computer literate is widely embraced in the world today.

What computer part Connects to The outlet and provides power to the computer

Answers

The plug in thingy lol

Compare the average cost of tablets with a Windows operating system to the average cost of tablets with an Android operating system.

Answers

Answer:

the average for Windows tablets is $700 while the average for Android tablets is $463

Explanation:

After researching a variety of different products I have come up with the following price points for tablets of each operating system.

Windows:

879399599924

Android:

779349600124

From these prices, we can see that the average for Windows tablets is $700 while the average for Android tablets is $463. This is because Android has always been specifically designed for mobile and handheld devices which have allowed them to easily transfer their operating system to any handheld device. This has drastically cut down their manufacturing costs which also allowed them to reduce consumer prices while still making profits.

How many times will the loop iterate, if the input is 105 107 99 103? cin >> x; while (x > 100) { // Do something cin >> x; }

Answers

Answer:

well since only 3 out of the 4 values are above 100 it would go 3 times and before your program returns to 0.

Explanation:

Answer:

Two times

Explanation:

Required

Determine the number of iteration of the loop

The first line: cin>> x; gets input for x

[tex]x = 105[/tex]

The while loop: while x > 100 is true because 105 > 100

So, the loop will be iterate as thus:

cin>>x:

Here, [tex]x = 107[/tex]

The while loop: while x > 100 is true because 107 > 100

So, the loop will iterate for the second time as thus:

cin>>x:

Here, [tex]x = 99[/tex]

The while loop: while x > 100 is false because 99 < 100

Hence, the loop will not iterate.

Number of iteration = 2

A string is represented as an array of characters. If you need to store an array of 5 strings with the maximum length of a string is 100, how would you declare it

Answers

Answer:

char str[5][100]

Explanation:

See attachment for options:

From the options, we can see that the programming language is C language.

The syntax to store an array of m strings with a maximum of n elements in C is:

char array-name[m][n]

In this case:

[tex]m = 5[/tex] --- Number of strings in the array

[tex]n = 100[/tex] --- Maximum character in each string

Assume the array name is str, the syntax can be expressed as:

char str[5][100]

What is the next line? tupleC = (3, 8, 11, 15, 8, 11) >> tupleC.index(15) 0 1 O 3 02​

Answers

Answer:

The next line is 3

Explanation:

Given

The above code segment

Required

Determine the next line

The above program is in Python and the next line is the output of the second line.

The second line gets the index of 15 in tupleC.

15 is at the 3rd index.

Hence, the next line is 3.

Answer:3

Explanation: got it right on edgen

True or false: The objective of an Enterprise Resource Planning (ERP) system is to create a customized software program that integrates the information of departments and functions of a company into a single computer system.

Answers

Answer:

True

Explanation:

The ability of a build system for handling a rise in the amount of code that it blends and analyzes is called ___________.

Answers

Answer:

Build integration

Explanation:

The ability of a build System to handle the rise in amount of code it blends/analyses is known as build integration.

It is the overall capacity of the build System to handle the growing amount of code. It is also a process where the system tries to handle potentials to accommodate growth. This is a very important condition.

Which symbol would be used in a flowchart to represent a connection to another part of the flowchart on the same page

Answers

Answer:

The answer is "Connectors".

Explanation:

Please find the Connectors image in the attached file.

In this question, the connectors symbol is usually small throughout the flowcharts. It is used as a connection to display and changes throughout the flux. It was usually marked by major letters that indicate jump points. This diagram visually shows the sequence of events in a system and who is accountable.

What is syntax?

A. syntax is the rules of the programming language
B. It is used to read information
C. it is used to output information
D. syntax is the word used to describe an error

Answers

Answer:

A

Explanation:

Operands may be any of the following: (select all that apply) Group of answer choices constant or constant expression register name variable name (memory) reserved word

Answers

Answer:

constant or constant expression

register name

variable name (memory)

Explanation:

Literally, operand means data which an operation can be performed on. The operation could be an arithmetic or logical operation.

From the list of options, several operations can be performed on:

constants e.g. [tex]\pi = 3.14[/tex]registers andvariables e.g. (a + b)

However, no operation can be performed on keywords and/or reserved words.

Other Questions
11. List five powers granted expressly to the president bythe Constitution. 3. Decide whether each equation is true or false, and explain how you know.a. 9.9.3 = 35b. 7+7+ 7 = 3 + 3 + 3 + 3+3+3+3c. / 2 / 3 / 2 = 2/3d. 4' = 4.1e. 6 + 6 + 6 = 63Which problems are true or false If you ride your bike at an average speed of 5 km/h and need to travel a total distance of 35 km, how long will it take you to reach your destination? PLEASE HELP Point P is plotted on the coordinate grid. If point Sis 10 units to the left of point P what are the coordinates of point S? TO 8 -12-10-8-6-4 20 2 4 6 8 10 12 O 07604 F - 10 - 12 (6. -14) O(-4,-4) O(-4, -14) (6,4) Who can prosecute a criminal case against a defendant?O The governmentThe victim of a crimeO A criminal court judgeO A witness to a crime What is 6 degrees is colder than -3 degrees I need more help ASAP its just really confusing because I havent even learned this yet Rylee is baking cupcakes for a bake sale. She spends $35 on supplies and she plans to sell the cupcakes for $2.50 each. How many cupcakes must she sell in order to make a profit of at least $75? PLEASE HELP ASAP WHICH ARE PROPORTIONAL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Marian earns $7.50 per hour at her part-time job. Is the number of hours Marian works proportional to the amount she earns? The area of a square can be found by squaring the length of one of its sides. For example, if a square has a side length of 5 centimeters, the square's area is 5, 2, square centimeters, or 25 cm, 2, . Is the side length of a square proportional to its area? Rafael opens a savings account with an initial deposit of $50. Each week after that, he deposits $10 more. Is the number of weeks that have passed proportional to the amount in his account? Noah is mixing yellow and red paint. For every 5 ounces of yellow paint he adds 4 ounces of red paint. Is the number of ounces of yellow paint proportional to the number of ounces of red paint? An equation is shown below. 3(2x+1)+5=2(3x+5) Which of the following statements describes the solutions to this equation? when rounding what does it 4 or less mean Which point is located at (Negative 0.5, 0.75)?point Bpoint Gpoint Mpoint Z The conclusion of an argument _______ (1 point) introduces a final main idea. pulls all of the pieces together to make sense of them. acknowledges and addresses counterclaims. makes the reader want to read more about the topic. Roast Beef Deli Meat is on sale for $8.59 per pound. At this rate how much would it cost to get 1.8 pounds of Roast Beef? Please help me out and I'll mark you Brainllest. Which of the following statements about the Qin dynastys accomplishments is true?A.They were the first dynasty to create bronze metalwork.B.They were the first dynasty to create iron metalwork.C.They agreed to open all trade with European nations.D.They created a standard system of writing that has influenced modern Chinese. intervals in music:G to A Your school's talent show will feature 8 solo acts and 2 ensemble acts. the show will last 82 minutes. The 4 solo performers judged best will give a repeat performance at a second 54 minute show, which will also feature the 2 ensemble acts. Each solo acts lasts x minutes, and each ensemble act last y minutes. write a system of equations Need done ASAP due later today SHOW WORK Brazil is the largest country in South America. Which European power claimed most of that territory as part of its empire?