Question: python Create a class called Sms in this file. 01 A1444 Your class must have three private instance variables: A string named 'to_number' A string

 python Create a class called Sms in this file. 01 A1444 pythonYour class must have three private instance variables: A string named 'to_number'

Create a class called Sms in this file. 01 A1444 Your class must have three private instance variables: A string named 'to_number' A string name 'content' An integer named 'sms_count' Create a constructor with a parameter for 'to_number' only. Create a public method named 'send_sms' that takes no arguments and returns a string. This method will be responsible for taking as input the SMS content and sending it to the 'to' number. First, you should validate the 'to_number' variable. If 'to_number' is none or contains nothing, you should return "You must have a valid to number". Then, you should take a line of input from the console and save that into the content' instance variable. You must use the input function to do this. If the received content is empty, return "You must enter an SMS body". Next calculate how many SMS messages will be required. A single SMS is 160 characters long, at most. That is, for every 160 characters, an SMS must be sent. Save this result into the 'sms_count' instance variable. Finally, build and return a string of feedback, formatted as follows (in this example, three SMS messages were required): SMS_1 sent to: SMS_2 sent to: SMS_3 sent to: Write appropriate getters and setters. 01 A144 A # DEFINE YOUR CLASS HERE # DO NOT MODIFY ANYTHING BELOW Gif __name__ == '__main__': sms = Sms('0400000000') print(sms. send_sms() Example 1: Enter SMS contents: My SMS SMS_1 sent to 0400000000 Example 2: Enter SMS contents: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad SMS_1 sent to 0400000000 SMS_2 sent to 0400000000 SMS_3 sent to 0400000000 # Should use the properties and setters print(sms.to_number) print(sms.content) print(sms.sms_count) sms.to_number = '0411000000 sms.content = 'New message

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!