In: Computer Science
You can estimate the total number of text messages you send and receive in a year as follows:
13 is a guesstimate or SWAG for the ratio of the total number of messages sent and received in a day to the number of messages sent and received during the peak hour of texting activity.
Design a program, using pseudocode or a flowchart, that asks the user to enter the number of text messages sent and received for their peak one-hour of texting on a typical day. Use that value to calculate and report out an estimate of how many text messages that person sends and receives in a year.
To get full credit for this problem you must use a named constant for the number of days in a year and a named constant the 13 total day to peak hour ratio. If you believe you have a better guess for that ratio go ahead and use it.
Second Part: Write a Python program based on your design for estimating yearly text messages per the prior problem statement.
Hi,
Please find the pseudocode below.
1>This program will calculate the number of messages sent and
received in an year.
2> Take the no of messages sent and received in a day from user
as integer input.
3> Take 13 as the count as an estimate to no of messages send
and received in a day.
4> Take 365 as a constant which is number of days in a
year.
5> Finally no of messages in year =
userInputofnoofdays*13*365.
6> display the final no of messages calculated.
Python program below:
print("Program to calculate total no of messages sent in an
year")
input_a = input("Enter the no of text messages sent during peak
hours : ")
# type cast into integer
input_a = int(input_a)
# print data type
print(input_a)
SWAGGuesstimate = 13
noOfDaysInAYear = 365
totalNoOfMessagesSentInAYear = input_a*SWAGGuesstimate*noOfDaysInAYear
print("Total no of messages sent in an year
=",totalNoOfMessagesSentInAYear)
python code screenshot:
output attached:
Thanks,
kindly upvote