NEW
Font size
WorksheetsMusic Store Management Quiz
Total questions: 15
Worksheet time: 8mins
What is the primary goal of developing this Java-based desktop application for the music store?
To create a complex graphical user interface (GUI).
To replace the existing paper-based stock and sales process.
To connect the store to an online e-commerce platform.
To upgrade the store's hardware and network infrastructure.
Which of the following is a direct benefit of digitizing the music store's sales and inventory management?
Increased application download speed.
Reduced errors and improved efficiency in tracking inventory.
Automated tax filing for the business owner.
Mandatory use of the `HashMap` data structure.
Which objective is directly responsible for ensuring that the inventory data is saved and available for the next day's use?
To display out-of-stock items.
To allow the user to record sales.
To calculate total sales revenue.
To save changes back into the `stock.txt` file.
Why might a developer choose to use a **`HashMap`** instead of an **`ArrayList`** to store the music items in this system?
`ArrayList` is not available in Java.
`HashMap` provides faster, efficient lookup and access using a unique item ID (key).
`ArrayList` only allows storing strings.
`HashMap` is specifically designed only for file I/O operations.
The requirement to use private attributes, getters, and setters within the **`Music`** class primarily enforces which core principle of Object-Oriented Design (OOP)?
Inheritance
Polymorphism
Encapsulation
Abstraction
The `sellMusic()` method is crucial because it executes two main actions: recording the sale and what other critical function?
Calculating the total sales revenue.
Printing a receipt for the customer.
Displaying the interactive menu system.
Updating the stock quantities correctly.
The feature **Stock File Integration** ensures data is loaded into memory at startup and then written back to disk. What is the specific file used for this task?
sales.log
config.xml
`stock.txt`
inventory.db
According to the activity, what type of issue must the **Error Handling** feature be able to manage during a sales transaction?
System-wide power outages.
Invalid user input or impossible sales quantities (e.g., selling 5 items when only 3 are in stock).
Browser compatibility issues.
Slow internet connection speeds.
The **Continuous Operation** feature ensures the program stays running and ready for the next action. How is this typically implemented in the main part of a desktop application?
A single execution and exit command.
A loop that continues until the user selects the 'Exit' option from the menu.
An automatic restart every hour.
A timer that shuts down the program after 10 minutes of inactivity.
The **Menu System** is vital for the application because it:
Handles all the calculations automatically.
Manages low-level file I/O operations.
Provides the interactive interface for user input and navigation between features.
Creates and manages the `Music` class objects.
Which menu option directly supports the music store owner's need for easy **restocking decisions**?
Sales Total
List Stock
Out of Stock
Write to File
When a user records a sale, what calculation is immediately necessary to maintain the integrity of the inventory?
Recalculating the average price of all items.
Determining the profit margin of the sale.
Subtracting the sold quantity from the item's current stock level.
Sorting the entire list of music items alphabetically.
The entire application is specified to be developed using which programming language and environment?
Python and web browser.
C++ and command line.
Java and desktop application framework.
JavaScript and mobile app.
In the `Music` class, what is the main responsibility of a **setter** method (e.g., `setQuantity(int newQ)`)?
To retrieve the current value of a private attribute.
To print the object's information to the console.
To safely update and modify the value of a private attribute.
To define the item's unique identifier.
Given the program overview, the final product is defined as a **desktop application**. This means it is designed to:
Run exclusively on a remote cloud server.
Be accessed via a web browser URL.
Be installed and run locally on a single user's computer.
Only operate on a mobile phone's operating system.
