Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write Java application to do the following: a. Declare a BSTNotebook object named nbList. b. Insert THREE (3) Notebook objects into the binary search tree.

Write  Java application to do the following:
a. Declare a BSTNotebook object named nbList.
b. Insert THREE (3) Notebook objects into the binary search tree.
c. Display the details of all notebooks.
d. Count and display the number of HP notebooks with price greater than
RM5,000.
e. Calculate and display the total price of all notebooks stored in the binary search
tree.
f. Display the most expensive notebook.
g. Search and display the details of a notebook based on the serial number entered
by the user.

public class Notebook
{
private String serialNo;
private String brand; // HP, Acer, Lenovo, etc.
private double price;
public String getSN() {...}
public String getBrand() {...}
public double getPrice(){...}
// definition of other methods
}
public class TreeNode
{
TreeNode left;
Notebook data;
TreeNode right;
}
public class BSTNotebook
{
TreeNode root;
public void display(){...}
public int count(){...}
public double totalPrice(){...}
public double maxPrice(){...}
public String search(String){...}
// definition of other methods


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_2

Step: 3

blur-text-image_3

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

A Survey of Mathematics with Applications

Authors: Allen R. Angel, Christine D. Abbott, Dennis Runde

10th edition

134112105, 134112342, 9780134112343, 9780134112268, 134112261, 978-0134112107

More Books

Students also viewed these Programming questions

Question

How big is your business?. A-986

Answered: 1 week ago

Question

Differentiate 3sin(9x+2x)

Answered: 1 week ago

Question

Compute the derivative f(x)=(x-a)(x-b)

Answered: 1 week ago

Question

Express the number in decimal notation. 2.01 x 10 0

Answered: 1 week ago

Question

Determine the prime factorization of the number. 1452

Answered: 1 week ago

Question

Solve the equation for the given variable. (x + 5)/2 = (x - 3)/4

Answered: 1 week ago

Question

____________ twins share the same DNA.

Answered: 1 week ago