Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a class called student, this class contains: Three private instance variables: age(date type: int) ,name (date type: String) and Major(date type: String); Two overloaded

Create a class called student, this class contains: Three private instance variables: age(date type: int) ,name (date type: String) and Major(date type: String); Two overloaded constructors: the first constructor doesn't have parameters , it sets both age, name and Major to default (age: 20, name: Tom, Major: IT); The second constructor has three parameters, these three parameters can initialize both age, name and Major as specified. Three public methods: getName():A public method for retrieving student's name; setAge(int studentage):A public method that sets the age of the student. getCollegeName(): return student's college name( return Strome if student's major is IT , Marketing , Finance or Management, return Sciences if student's major is CS or Physics, return others if student's major is not on the list above) The class should contain a main() method which tests two overloaded constructors and three public methods: getName(), setAge(int studentage)and getCollegeName()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Database Modeling With Neo4j

Authors: Ajit Singh

2nd Edition

B0BDWT2XLR, 979-8351798783

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago