Exercise 1 : Implement the class Student as presented by the following UML diagram: Exercise 2 :
Fantastic news! We've Found the answer you've been seeking!
Question:
Exercise 1 : Implement the class Student as presented by the following UML diagram:
Exercise 2 : Write a driver class to test the Student class as follow:
Transcribed Image Text:
Excrcise L(60 pts) Implement the class Student as presented by the following UML. diagram: Student -name: String could be formed of more than two words -id: int -gender: char -address: String +Student(--All Attributes--) (10 pts) +getters'setters (20 pts) +formatName(): void (20 pts) capitalize the first letter of every word in name *printDesrciption(): void (10 pts) Excrcise 2. (40 pts) Write a driver class to test the Student class as follows: a. Create a student object s by reading his her name, id, gender and address from the user, (10 pts) b. Change its id with any other id. (6 pts) c. Display the name of s. (6 pts) d. Format his her name and then display it. (6 pts) e Print the description of s. (6 pts) £ Display either the word Male or the word Female according to the gender of s. (6 pts) Sample Run: Enter name: ali abdel Karim el masri Enter the atudent id: 1111 Enter M for male and r for female: m Enter address: Hamra ali abdel Karin el manri After formatting the name: Ali Abdel Karin El Manri Student (name - Ali Abdel Karim El Masri, id 3333, gender H, addreas - Hamra) The gender of a in Male Excrcise L(60 pts) Implement the class Student as presented by the following UML. diagram: Student -name: String could be formed of more than two words -id: int -gender: char -address: String +Student(--All Attributes--) (10 pts) +getters'setters (20 pts) +formatName(): void (20 pts) capitalize the first letter of every word in name *printDesrciption(): void (10 pts) Excrcise 2. (40 pts) Write a driver class to test the Student class as follows: a. Create a student object s by reading his her name, id, gender and address from the user, (10 pts) b. Change its id with any other id. (6 pts) c. Display the name of s. (6 pts) d. Format his her name and then display it. (6 pts) e Print the description of s. (6 pts) £ Display either the word Male or the word Female according to the gender of s. (6 pts) Sample Run: Enter name: ali abdel Karim el masri Enter the atudent id: 1111 Enter M for male and r for female: m Enter address: Hamra ali abdel Karin el manri After formatting the name: Ali Abdel Karin El Manri Student (name - Ali Abdel Karim El Masri, id 3333, gender H, addreas - Hamra) The gender of a in Male
Expert Answer:
Answer rating: 100% (QA)
Studentjava public class Student private String name private int id private char gender private Stri... View the full answer
Related Book For
Modeling the Dynamics of Life Calculus and Probability for Life Scientists
ISBN: 978-0840064189
3rd edition
Authors: Frederick R. Adler
Posted Date:
Students also viewed these programming questions
-
1. Write a class called Student. This student class should have the following fields: Id: This is the Id of the student. -_scores: This is a list of scores that belong to the student. Add the...
-
Suppose the quantity of root beer demanded decreases from 105,000 litres per week to 95,000 litres per week when the price rises by 5 percent. The price elasticity of demand is Select one: O A. 10. O...
-
Student 2 comes to class with probability 1.0 if student 1 does. Student 3 ignores them. A small class has only three students. Each comes to class with probability 0.9. Find the probability that all...
-
A particular leadcadmium alloy is 8.0% cadmium by mass. What mass of this alloy, in grams, must you weigh out to obtain a sample containing 7.25 x 10 23 Cd atoms?
-
Identify two specific benefits that you would add to mall apps to make them functional enough to attract shoppers to the mall.
-
1. Suppose that Sun Farms supplies the basil that survived the storm but the basil does not pass the chemical-residue inspection. Which concept discussed in the chapter might allow Vals to refuse to...
-
Explain how and why physician incompetency is reported.
-
1. How do information technologies contribute to the business success of Sew What? Inc.? Give several examples from the case regarding the business value of information technology that demonstrate...
-
Johnson was known for "having trouble remembering what was his and what was the company's." For example, the company had a fleet of 10 corporate planes (also called the RJR air force), used for...
-
EYE SPY sells sophisticated video surveillance equipment. EYE SPY sells the equipment and computer integration services together. It does not sell these separately. The equipment cannot operate...
-
How long did Majay finance his used car if the initial cost was $8000, final cost was $10000 and the annual rate of simple interest was 3.2%
-
Between 1929 and 1933, output fell ______. a) by about one-tenth b) by about one-third c) by about one-half d) by about two-thirds
-
Which of the problems in the construction of the CPI might be illustrated by each of the following situations? Explain. a. the invention of cell phones b. the introduction of air bags in cars c....
-
The production possibilities curve represents ________. a) our economy at full employment but not full production b) our economy at full production but not full employment c) our economy at full...
-
What other theories have you learned about in this class that could be applied to crisis contexts?
-
At the time of the American Revolution, about of ______ every 10 Americans lived on a farm. a) 1 c) 5 e) 9 b) 3 d) 7
-
Cipher Corporation, a new car manufacturer that has entered the automotive industry, reported earnings growth of 10% on both December 31, 2021, and December 31, 2022. A study released in January 2023...
-
Graph one period of each function. y = 4 cos x
-
If there are n seeds, each sprouts and grows to a size s = 100.0/n. An adult of size s produces s - 1.0 seeds (because it must use 1.0 units of energy to survive). Crowded plants grow to smaller...
-
Sketch the graph of an updating function that has a corner at an equilibrium and is unstable. The unusual equilibrium in the text has an updating function that lies below the diagonal both to the...
-
For the following bacterial populations, find the average rate of change during the first hour, and during the first and second half hours. Graph the data and the secant lines associated with the...
-
What are the differences among an onsite team, a virtual team, a task force, and a committee? What are some of the potential differences in dynamics between people in these different groups?
-
What are the benefits of implementing programs to address cultural competence within a health care organization? What are the costs of not implementing such programs?
-
Over the past month, every member of the Intravenous (IV) Therapy Team has complained to you about the IV Team supervisor. Her direct reports, all RNs, agree that she is technically superb. However,...
Study smarter with the SolutionInn App