Concept explainers
Please help with the following question:
In Java without using arrays, Integer.parseInt in the main class or this.keyword in the classes code the following.
Make 1 project having 1 main class and 3 other classes. For each classes you need make to use the constructor to set its attributes. Your classes have to have setters and getters and their attributes should all be private.
Make a class University
A university name (string)
A university population (int)
A university budget(double)
Make a class Department
An ID(int)
A Name(string)
A DEP ID(int)
Make a class Student
Dep Name(string)
Dep ID(int)
In the main class first Create three departments.Ask the user to input the field values.
In the main class create 5 students. Ask the user to input the field values.
Write a function in the main class that takes two integers as input and Checks if they are equal. Use that function to check if for a department and a student their DEP ID is equal. (So you have to check if dep1.di=student1.id for example).
Create a university in the main again. (Initialize it the way you like). DO NOT ASK THE USER HAVE THEM DEFINED YOUR SELF SO NO SCANNER.
In the main class ask the user to input a string. Then until you have reached the end of the string iterate on each char and replace each char at location I (the location you are at in that iteration) with the following: If the location was an even location replace it with the lowercase version of the char and if it was odd to replace it with its upper case. Example:
heLlo: hElLo.
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 2 images
- in java Create a class for Student and implement all the below listed concepts in your class. Read lecture slides for reference. Class Name: Student 1. Data fields studentID name email majorDepartmentSelect proper datatypes for these variables. 2. Constructors – create at least 2 constructors No parameter With parametersSet id and name using the constructor with parameters. 3. Methods toString method : To print the details of the Student. Setter and getter methods 4. A static variable count : To keep the count of Student objects5. Visibility Modifiers: private for data fields and public for methods 6. Write some test cases in main methodarrow_forwardin javaarrow_forwardPLZ help with the following: In JAVA ABC Company helps its clients to find a quick and easy analysis for better investment decisions. It would like to include the ways to calculate the evaluated price and investment analysis for the two types of property, ‘Condo’ and ‘single-family home (SFHome). Implement the class property based on the following specification. The class has - Instance variables: ▪ address that holds the address of the property and is of type string. ▪ ZoneCode which is an integer indicating the zone of the property. (possible values 1, 2, and 3) ▪ NoOfBedrooms that holds the number of bedrooms in the property. ▪ YearofConstruction an integer to hold the year of construction ▪ RiskFactor which is a float number in the range(0.0,1.0) for the risks related to investments in real estate market. ▪ Type indicates if the type of the property is a Condo or a SFHome. - At least three constructors, a default constructor, a parametrized…arrow_forward
- Please help with the following question: Code in Java You need to deliver one project consisting of only one main class and three other classes stated below. For each of the classes you create you need to use the constructor to set its attributes. Your classes have to have setters and getters and their attributes should all be private. Create a class University A university has the following attributes. 1. A university name (string)2. A university population (int)3. A university budget(double) Create a class Department This class has this attributes: 1. Dep Name(string)2. Dep ID(int) Create a class Student A student has the following attributes. 1. An ID(int)2. A Name(string)3. A DEP ID(int) In the main class first Create three departments.Ask the user to input the field values. In the main class create 5 students. Ask the user to input the field values. Write a function in the main class that takes two integers as input and Checks if they are equal. Use that function to check if for a…arrow_forwardNeed it in the java language, doesn't have to be perfect. If you can do the whole program that would be best but if not an outline would suffice so I can get a good idea of how to finish the program. Thanks!arrow_forwardI'm learning java in college and I missed one homework assignment. Since then it has been difficult to keep up with homework because they were based on the one I missed. Here's the prompt: Design a class Phone with one data member as long phoneNumber. Add constructors, get/set methods to class Phone. Then design a class InternationalPhone as subclass of class Phone, with one extra data member as int countryCode. Add constructors, get/set methods to class InternationalPhone. Write a main program to test these two classes. (We use netbeans btw) I can't get any credit for this so there's no rush but I would be very happy to recieve an answer before the end of the semester. Thank you in advance :)arrow_forward
- Please follow the steps to complete JAVA PROGRAM Create a class, EmployeeException, that has the following attributes: name: String SSN: String Salary: double The methods required in this class are: A constructor with no arguments that sets the attributes at default values A constructor that passes values for all attributes Accessor, mutator, display method for each attribute. An example of a display method for an attribute is writeOutName(): void, in which you just display the name:System.out.println("Employee Name: " + name); An equals method that has an object of type Employee as argument, and returns true if two employees have the same name, salary, and SSN. Write a driver program for the Employee class that uses an array that can hold up to 100 employees (the array will be of EmployeeException type). However, the user should be free to enter as many employees as needed. The driver class should use two exception classes to signal the user that the SSN entered is not correct.…arrow_forwardPlease write in Java and use Math.PI for pi. I wrote the print statements to use in the program. The screenshot explains the question.arrow_forwardMust be in JAVA. Please show in simplest form and with comments. The correct UML Diagram MUST be provided as well with the solution. It will be flagged if the UML Diagram is not provided.arrow_forward
- help me javaarrow_forwardA library wants to manage its collection of books and authors more efficiently. They would like to create a Python program to help with this task. The following requirements need to be implemented: Create an Author class with the attributes: name, dob (date of birth), and nationality. The class should have a __str__ method to represent the author in a user-friendly format. Create a Book class with the following attributes: title, author (an instance of the Author class), publication_date, and price. Also, include a class variable all_books that keeps a list of all book instances created.The Book class should have: A __str__ method to represent the book in a user-friendly format. A __eq__ method to compare two books. Two books are considered the same if they have the same title and author. A __lt__ method to compare two books based on their publication dates. A class method get_all_books that returns a list of all books in the library. A static method most_expensive_book that takes…arrow_forwardA library wants to manage its collection of books and authors more efficiently. They would like to create a Python program to help with this task. The following requirements need to be implemented: Create an Author class with the attributes: name, dob (date of birth), and nationality. The class should have a __str__ method to represent the author in a user-friendly format. Create a Book class with the following attributes: title, author (an instance of the Author class), publication_date, and price. Also, include a class variable all_books that keeps a list of all book instances created.The Book class should have: A __str__ method to represent the book in a user-friendly format. A __eq__ method to compare two books. Two books are considered the same if they have the same title and author. A __lt__ method to compare two books based on their publication dates. A class method get_all_books that returns a list of all books in the library. A static method most_expensive_book that takes…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education