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
tatyana61 [14]
2 years ago
5

The date June 10, 1960, is special because when it is written in the following format, the month times the day equals the year:

6/10/60 Design a program that asks the user to enter a month (in numeric form), a day, and a two digit year. The program should then determine whether the month times the day equals the year. If so, it should display a message saying the date is magic. Otherwise, it should display a message saying the date is not magic.
2. Running on a particular treadmill you burn 3.9 calories per minute. Write a program that uses a loop to display the number of calories burned after 10, 15, 20, 25, and 30 minutes.

Computers and Technology
1 answer:
MrRa [10]2 years ago
7 0

Answer for Question 1:

Code for the first question:

#section 1

<em># Prompt for accurate day month and year </em>

<em>while True: </em>

<em>    try: </em>

<em>        day = int(input("Enter the day of month: ")) </em>

<em>        if day > 31 or day < 1: </em>

<em>            raise </em>

<em>        try: </em>

<em>            month = int(input("Enter the month in numeric form: ")) </em>

<em>            if month > 12 or month < 1: </em>

<em>                raise </em>

<em>            try: </em>

<em>                year = int(input("Enter the year in two digit format: ")) </em>

<em>                if year > 99 or year < 0: </em>

<em>                    raise </em>

<em>                else: </em>

<em>                    break </em>

<em>            except: </em>

<em>                print("Error: invalid year input.") </em>

<em>        except: </em>

<em>            print("Error: invalid month input.") </em>

<em>             </em>

<em>    except: </em>

<em>        print("Error: invalid day input.") </em>

<em> </em>

<em># We have a valid date, lets determine whether it's magic or not </em>

<em> </em>

<em>#Section 2 </em>

<em># Calculate the mutliplication of day and month </em>

<em>dayxMonth = day * month </em>

<em> </em>

<em># Display the results to the screen </em>

<em>print() </em>

<em>print("The date ", day, "/", month, "/", year, end=" ") </em>

<em />

<em />

<em># Calculates whether the entered date is a magic date </em>

<em>if dayxMonth == year: </em>

<em>    print ("is a magic date.") </em>

<em>else: </em>

<em>    print ("is not a magic date.") </em>

Explanation for Question 1:

#section 1

The Try and Except block in combination with the while loop is used to ensure that all inputs are accurate if there is an error in the input, it prompts the user to enter a valid input and states the problem with the input.

Each try block contains an if statement for day, month and year respectively.

<em />

#Section 2

calculates the multiplication of  day  and month,

compares it with the year to find out if it's magic and finally prints the result to the screen

Answer for Question 2:

Code for the second question:

<em>print("Time   Calories Burned in minutes") </em>

<em>print("----   ---------") </em>

<em>for time in range(10,31,5): </em>

<em>    cburn=3.9*time </em>

<em>    print(time,cburn,sep='      ')</em>

<em />

Explanation for Question 2:

  • <em>for time in range(10,31,5): </em>

A for loop is used to iterate over a range of values.

from 10 to 31 and the skipper is 5.

The skipper is how many numbers are skipped before the for lop takes another value from the range.

  • <em>  </em><em>cburn=3.9*time </em>

<em>                print(time,cburn,sep='      ')</em>

the values provided by the range are 10, 15, 20, 25, and 30 minutes.

we then calculate the calories for each value and print then to the screen.

You might be interested in
Write a program named Deviations.java that creates an array with the deviations from average of another array. The main() method
Westkost [7]

Answer:

hello your question is incomplete attached is the complete question and solution

answer : The solution is attached below

Explanation:

Below is a program named Derivations.java that creates an array with the deviations from average of another array.

3 0
3 years ago
Discuss how the use of digital formats for audio-visual recording and editing has
Zolol [24]

Answer:

Digital formats allow for lossless data storage, fast editing (without the loss of original source material, ie having to manually clip pieces of film), and made collaboration easier.

4 0
2 years ago
If you are weak or lacking in an area or skillset, what kinds of things can you do to compensate or improve?
Ilya [14]
Put some more of your time to help improve that skill.try to learn to get better.
6 0
3 years ago
The 169.254.78.9 ip address is an example of what type of ip address
scoundrel [369]
As specified in RFC5735, this is an address from the "link local" block. It is assigned to a network interface as a temporary address, for instance if no static address is configured and the DHCP server is not found.

If you boot your PC without a network cable, you'll probably end up with a 169.254.*.* address.
8 0
3 years ago
What job title is used for the person who uses the server operating system to add and remove users, install software, and admini
yan [13]
System Administrator
7 0
3 years ago
Other questions:
  • Spreadsheet software creates a ____, composed of a grid of columns and rows
    5·1 answer
  • David has created a lot of styles and now his Quick Style Gallery contains styles he no longer uses.
    14·2 answers
  • Pressing the e key while in edit mode will exit the interaction mode<br><br> true<br><br> false
    7·1 answer
  • Marissa, a 21-year-old young woman, is working as an intern at a software company. She has recently graduated from college. She
    6·1 answer
  • How many of the colonists of Jamestown died before they made it to shore, due to the difficult voyage?
    15·1 answer
  • Always follow the routine "clean up while in use and clean up before keeping it".
    6·1 answer
  • What facilitates the automation and management of business processes and controls the movement of work through the business proc
    9·1 answer
  • Can someone please help me with this ,it is my assignment of technology and agriculture year 8
    5·1 answer
  • What plan can businesses use to protect sensitive data from malicious attacks?
    11·2 answers
  • We call any device connected to the Internet a(n) ________. Group of answer choices router host IP client
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!