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
olga2289 [7]
3 years ago
10

Which one is the right code

Computers and Technology
1 answer:
levacccp [35]3 years ago
7 0
D.) is the correct answer.
You might be interested in
Lynn wants to share parts of an essay she wrote in her slide presentation
fgiga [73]

Answer:

no

Explanation:

No she should not  because it might be for a test

6 0
2 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
Database Management Systems are featured with:
Olin [163]

Answer:

Answer: Database Management Systems are featured with:​ The ability to store a large amount of data to facilitate easy updates, short, and retrieval.

Explanation: I took the test

6 0
3 years ago
Read 2 more answers
Which is the best example of an unreliable narrator?
melomori [17]
The best example is a. A guilty criminal
3 0
3 years ago
____ software controls the flow of data, provides data security, and manages network operations.
Alchen [17]
<span>'SYSTEM' software controls the flow of data, provides data security, and manages network operations.</span>
5 0
3 years ago
Other questions:
  • List and describe the issues that lead to making a successful website?​
    9·1 answer
  • T<br> F<br> 5.<br> You can save presentations in PDF and XPS formats.
    14·1 answer
  • Maria found a cupcake recipe on a cooking blog. However, she would like to read comments and suggestions before she begins bakin
    6·2 answers
  • What is a Qwerty?<br> A) It's a Computer<br> B) It's a keyboard <br> C) A type of frog
    11·2 answers
  • Does Android have text-to-voice?
    11·1 answer
  • The user can set their own computer hostname and username. Which stage of the hardware lifecycle does this scenario belong to?
    6·1 answer
  • Which BEST identifies the primary function of the key words above?
    5·1 answer
  • Mrs. Brown is a teacher at the elementary school. As the school year begins, she sends a couple of email messages to her student
    11·1 answer
  • Which of the following is the BEST example of the principle of least privilege? Correct Answer: Wanda has been given access to t
    13·1 answer
  • You are the network administrator for a rapidly growing company with a 100BaseT network. Users have recently complained about sl
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!