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
ExtremeBDS [4]
3 years ago
13

Assume the following Python code has already executed.

Computers and Technology
1 answer:
Ivanshal [37]3 years ago
7 0

e. /Users/me/Documents/file.txt

You might be interested in
Which statement reflect a culture that value collectivism
Morgarella [4.7K]

Answer: To be honest i believe its D. All of the above reflect collectivism

hope this helps :)

8 0
4 years ago
A program that accepts insurance policy data, including a policy number, customer last name, customer first name, age, premium d
valentina_108 [34]

Answer:

  1. policy_num = int(input("Enter policy number: "))
  2. lastName = input("Enter last name: ")
  3. firstName = input("Enter first name: ")
  4. premiumDate = input("Enter premius due date (mm/dd/yyyy): ")  
  5. numAcc = int(input("Enter number of driver accident in the past three years: "))
  6. if(policy_num <1000 or policy_num > 9999):
  7.    policy_num = 0  
  8. dateComp = premiumDate.split("/")
  9. month = int(dateComp[0])
  10. day = int(dateComp[1])
  11. year = int(dateComp[2])
  12. if(month < 1 or month > 12):
  13.    month = 0
  14.    day = 0
  15.    year = 0  
  16. else:
  17.    if(month == 1 or month == 3 or month == 5 or month == 7 or month == 8 or month == 10 or month == 12):
  18.        if(day < 1 or day > 31):
  19.            month = 0
  20.            day = 0
  21.            year = 0  
  22.    elif(month == 4 or month == 6 or month == 9 or month == 11):
  23.        if(day <1 or day > 30):
  24.            month = 0
  25.            day = 0
  26.            year = 0
  27.    elif(month == 2):
  28.        if(day < 1 or day > 29):
  29.            month = 0
  30.            day = 0
  31.            year = 0
  32. print("Policy number: " + str(policy_num))
  33. print("Last name: " + lastName)
  34. print("First name: " + firstName)
  35. print("Premium Date: " + str(month) + "/" + str(day) + "/" + str(year))
  36. print("Number of driver accidentin the last three years: " + str(numAcc))

Explanation:

The solution code is written in Python 3.

Firstly use input function to prompt user to enter all the necessary insurance policy data (Line 1 - 5).

Next create an if statement to validate the input policy number. If the policy number is not within the range of 1000 - 9999, set the policy number to zero (Line 7 -8).

Next, split the input premium date into month, day and year (Line 10 -13). It is followed by checking the month if it is between 1 - 12. If not, set the month, day and year to zero (Line 15 - 18). Otherwise the program will proceed to validate the month based on the maximum and minimum number of days for a particular month (Line 20 - 34). If the day is out of range, set month, day and year to zero.

Lastly, use print function to display the policy data (Line 36 - 40).

8 0
4 years ago
Exactly how many times must the merge function call each of read and write to merge two arrays of size n/2 into an array of size
Rom4ik [11]

Answer:

Exactly how many times must the merge function call each of read and write to merge two arrays of size n/2 into an array of size n, assuming

i don t know

7 0
3 years ago
Concept of national sovereignty was established by the
Eduardwww [97]

Answer:

Explanation:

Thomas Hobbes. He was the one who provided the term with its modern meaning.

7 0
4 years ago
Exercise #3: Write a c++ program that reads, from a file called numbers.in, up to 10 numbers, counts and adds the positive value
Gre4nikov [31]

I don't know

Thanks for the points

3 0
3 years ago
Read 2 more answers
Other questions:
  • Select all examples of good keyboarding technique.
    13·2 answers
  • Which of the following refers to special eyeglasses from Google that provide the user with visual information directly in front
    5·1 answer
  • Which categories format cells
    14·2 answers
  • Which internet resource can you use to publicly describe an adventure trip you recently made?
    6·2 answers
  • The most common layout of keys on the keyboard is the _____ keyboard.
    5·2 answers
  • What are the long-term consequences for John’s health and wellness if he continues to use this technique
    15·1 answer
  • To see the formula in a cell, look at the___
    5·1 answer
  • What is the first thing you should do when you open a savings account
    11·1 answer
  • Application for a lawn-mowing service. The lawn-mowing season lasts 20 weeks. The weekly fee for mowing a lot under 40 square fe
    13·1 answer
  • What is used for risk response control?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!