Write a Java program as given in class/ UML diagram. In a Test class inside the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Java program as given in class/ UML diagram. In a "Test" class inside the main, Create two objects one from teacher and another from Students with user entered values then call print() for both objects. (12 Marks) Student - id: int + Student(name: String, age: int, id: int) +getld(): int + setid(id: int):void + print(): void Person -name: String -age: int + Person(name: String, age: int) + getName(): String +getAge(): int + setName(name: String): void + setAge(age: int): void + print(): void Teacher - salary: float +Teacher(name: String, age: int, s: int) + getSalary(): float + setSalary(id: int):void + print(); void Write a Java program as given in class/ UML diagram. In a "Test" class inside the main, Create two objects one from teacher and another from Students with user entered values then call print() for both objects. (12 Marks) Student - id: int + Student(name: String, age: int, id: int) +getld(): int + setid(id: int):void + print(): void Person -name: String -age: int + Person(name: String, age: int) + getName(): String +getAge(): int + setName(name: String): void + setAge(age: int): void + print(): void Teacher - salary: float +Teacher(name: String, age: int, s: int) + getSalary(): float + setSalary(id: int):void + print(); void
Expert Answer:
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
Import it into Eclipse. Finish the code so the output looks like the output below. Do the coding in Eclipse and Java. starting code main code static String States[] = new String[50]; static String...
-
Choose a topic that can be applied to one of the following economic concepts. (Possible curves: Lorenz curve, marginal product of labor curve, labor demand and supply curves, utility function and...
-
In this assignment, you will create a program that allows theuser to draw in a window using brushes of different sizes andcolors. The user will be able to change the size and color of thebrush using...
-
What is the smallest (most negative) 32-bit binary number that can be represented with (a) Unsigned numbers? (b) Twos complement numbers? (c) Sign/magnitude numbers?
-
Calculate the expected rate of return on each alternative and fill in the blanks on the row for r in the table.
-
A piston/cylinder device keeping a constant pressure has 1 kg water at 20oC and 1 kg of water at 100oC both at 500 kPa separated by a thin membrane. The membrane is broken and the water comes to a...
-
Why do endorphins have effects similar to those of drugs like morphine and heroin?
-
A Travel Weekly International Air Transport Association survey asked business travelers about the purpose for their most recent business trip. Nineteen percent responded that it was for an internal...
-
Code based on this. The blue box is a step by step explanation on how to implement the code. It also has two attributes: Py_func: the python function that implements the built-in scheme procedure....
-
A perishable dairy product is ordered daily at a particular supermarket. The product, which costs $1.19 per unit, sells for $1.65 per unit. If units are unsold at the end of the day, the supplier...
-
A skier is moving 8.33 m/s when he starts to slide UP a 8.44 frictionless slope. How much time does it take him to come to a stop? (Unit = s)
-
How do scholars of conflict resolution integrate principles of game theory and decision analysis to model and predict the dynamics of strategic interactions between conflicting parties in complex...
-
Write a java AWT program to create a Frame window by extending Frame Class. It should have the following components, as given in the figure. You suppose to create 3 Labels, 3 TextFields, and 2...
-
Calculate the required variables Average Average Average Output Fixed cost Variable cost Total cost fixed cost variable cost total cost Marginal cost 160 20 1 140 60 200 2 The Fixed Cost at Output 2...
-
A single person with a taxable income of $172960 will have the first $9,525 of that income taxed at a different rate than the income between $9,525 and $38,700. The first bracket is taxed at 10%, the...
-
How do technological innovations, including cyber warfare, autonomous weapons systems, and information warfare, transform the nature of conflict, introducing new forms of asymmetric threats, and...
-
1. (6 pts) Given the function f(x): x + 1, 2x - 1, f(x) = 1, -2x + 4, 0, -1x <0 0 < x < 1 x = 1 1 < x < 2 2
-
The first national bank pays a 4% interest rate compound continuously. The effective annual rate paid by the bank is __________. a. 4.16% b. 4.20% c. 4.08% d. 4.12%
-
Add a method in the BST class to return the number of the nonleaves as follows: /** Returns the number of nonleaf nodes */ public int getNumberofNonLeaves()
-
There are several techniques for implementing the sqrt method in the Math class. One such technique is known as the Babylonian method. It approximates the square root of a number, n, by repeatedly...
-
Improve Programming Exercise 20.13 to enable the computer to display the expression if one exists, as shown in Figure 20.20. Otherwise, report that the expression does not exist. Place the label for...
-
Associated British Foods is a diversified international food, ingredients and retail group with sales of 12.9bn, and 118,000 employees in 47 countries across Europe, southern Africa, the Americas,...
-
WHSmith plc is one of the UKs leading retailers and is made up of two core businesses Travel and High Street. Extracts from Annual report and accounts About us WHSmith has a presence in a wide range...
-
Rio Tinto is a leading global mining group that focuses on finding, mining and processing the Earths mineral resources. Our vision is to be a company that is admired and respected for delivering...
Study smarter with the SolutionInn App