Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q1 ) Answer the following. (i) Create an HashMap object called Student to add a key and its value. I/Key is a student name and

image text in transcribed

Q1 ) Answer the following. (i) Create an HashMap object called Student to add a key and its value. I/Key is a student name and value is an student id. (2 marks) (ii) Write a java program using HashMap(use above student) and implement two methods add student and search studentname. (2 marks) // Use your own class name. Q2) Consider the following Java program. (2 marks) public class Square { private integer side; ***** **Fill out the following details ******* public Square() { l/initialize the parameter } public Square(integer s) { ------- //initialize the parameter } public double getArea() -?------ --side * side; } } Course Teacher: DCA Saahira bany / Assignment-2 (ii) Consider the subclass box of the superclass Square and call to the superclass default constructor & with its parameter. (2 marks) l/hint: public class box extends square { Il private double height; FILL OUT THE REMAINING PART OUTPUT SCREEN WITH THE PROGRAM CODING 2 MARKS

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

Relational Database And Transact SQL

Authors: Lucy Scott

1st Edition

1974679985, 978-1974679980

More Books

Students also viewed these Databases questions

Question

2. Describe how technology can impact intercultural interaction.

Answered: 1 week ago

Question

Calculate the lifetime value (LTV) of a loyal customer.

Answered: 1 week ago

Question

Use service tiering to manage the customer base and build loyalty.

Answered: 1 week ago