Final Project 1) Write a Person dass with a constructor that accepts the following details: 1. First name 2. Middle name 3. Last name 4. Date of birth (entered in this pattern 22-02-2000) 5. Gender (male, female) 6. Identity number (private attribute) 7. Mobile number (if any) Provide a method getAge that calculates the persons' age from his date of birth. If the user provided his mobile number you have to check if it is a valid number with the pattern 999- 999-9999 if not, show him an error message and do not save the number.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
I need answer within 20 minutes please please with my best wishes
Final Project
1) Write a Person dass with a constructor that accepts the following details:
1. First name
2. Middle name
3. Last name
4. Date of birth (entered in this pattern 22-02-2000)
5. Gender (male, female)
6. Identity number (private attribute)
7. Mobile number (if any)
Provide a method getAge that calculates the persons' age from his date of birth.
If the user provided his mobile number you have to check if it is a valid number with the pattern 999-
999-9999 if not, show him an error message and do not save the number.
2) Write two classes called Student and College that represents a student and a college in a
university.
College class:
The constructor of the College class should accept the name of the college and the capacity,
and you have to generate a shortcut of the name by taking the first character of each word
in the name (e.g., Information Technology becomes IT).
Provide a method called updateTotalStudents that increments the total number of students
at this college. You have to check if the total number is in the range of the capacity, if not
you have to present a suitable message for the student and let him/her choose another
college. You can set the capacity as 3 students for testing purposes.
Provide a method called getinfo that prints the information about specific college in a well-
organized appearance.
Student class is a child of Person dass:
The constructor of the Student class should check if the person is older than 18 years, and
then generates a student number in the pattern G2022XXXX where G will be 1 for males and
2 for females, and XXXX is a serial number reflects the order of the student in registration
(first student gets 0001, tenth student gets 0010, and so on). Hint you can use (zfill) function.
Provide a method called setCollege that accepts a College object, first of all you have to
check if the capacity accepts a new student, if not you have to show the student a suitable
message, if the student has accepted in a college you have to call updateTotalStudent
method.
Provide a method called getinfo that prints the information of a specific student in a well-
organized appearance.
You have to generate two College objects and at least 2 students at each one.
The output should be like this screenshot(Q1&Q2).
Student registered successfully in information technology IT
Student registered successfully in information technology IT
information technology (IT) with (2 out of 3)
noor Khalid Bolbol
ID:220220001
noor2 Khalid Bolbol
ID:220220002
2
Final Project
3) Write a dass called Point that represents a point in 2D plane.
The constructor accepts the x and y dimensions of the point.
Provide a method getX that returns the x coordinate of a point, and another method getY
that returns the y coordinate of a point.
Provide a method called translate that changes the original coordinates of the point by
adding a given values for x and y coordinates.
Provide a method distanceTo that calculates the distance between that point and another
one.
Use this equation to calculate the Distance math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
While the math is a library you should import, Where the (x1. v) is the coordinates of the first point
Transcribed Image Text:Final Project 1) Write a Person dass with a constructor that accepts the following details: 1. First name 2. Middle name 3. Last name 4. Date of birth (entered in this pattern 22-02-2000) 5. Gender (male, female) 6. Identity number (private attribute) 7. Mobile number (if any) Provide a method getAge that calculates the persons' age from his date of birth. If the user provided his mobile number you have to check if it is a valid number with the pattern 999- 999-9999 if not, show him an error message and do not save the number. 2) Write two classes called Student and College that represents a student and a college in a university. College class: The constructor of the College class should accept the name of the college and the capacity, and you have to generate a shortcut of the name by taking the first character of each word in the name (e.g., Information Technology becomes IT). Provide a method called updateTotalStudents that increments the total number of students at this college. You have to check if the total number is in the range of the capacity, if not you have to present a suitable message for the student and let him/her choose another college. You can set the capacity as 3 students for testing purposes. Provide a method called getinfo that prints the information about specific college in a well- organized appearance. Student class is a child of Person dass: The constructor of the Student class should check if the person is older than 18 years, and then generates a student number in the pattern G2022XXXX where G will be 1 for males and 2 for females, and XXXX is a serial number reflects the order of the student in registration (first student gets 0001, tenth student gets 0010, and so on). Hint you can use (zfill) function. Provide a method called setCollege that accepts a College object, first of all you have to check if the capacity accepts a new student, if not you have to show the student a suitable message, if the student has accepted in a college you have to call updateTotalStudent method. Provide a method called getinfo that prints the information of a specific student in a well- organized appearance. You have to generate two College objects and at least 2 students at each one. The output should be like this screenshot(Q1&Q2). Student registered successfully in information technology IT Student registered successfully in information technology IT information technology (IT) with (2 out of 3) noor Khalid Bolbol ID:220220001 noor2 Khalid Bolbol ID:220220002 2 Final Project 3) Write a dass called Point that represents a point in 2D plane. The constructor accepts the x and y dimensions of the point. Provide a method getX that returns the x coordinate of a point, and another method getY that returns the y coordinate of a point. Provide a method called translate that changes the original coordinates of the point by adding a given values for x and y coordinates. Provide a method distanceTo that calculates the distance between that point and another one. Use this equation to calculate the Distance math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2) While the math is a library you should import, Where the (x1. v) is the coordinates of the first point
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY