iTunes is a media player and media library application developed by Apple Inc. It is used to play, download, and organize digital audio and video on personal computers running the OS X and Microsoft Windows operating systems. The iTunes Store is also available on the iPod Touch, iPhone, and iPad. Through the iTunes Store, users can purchase and download music, music videos, television shows, audiobooks, podcasts, movies, and movie rentals in some countries, and ringtones, available on the iPhone and iPod Touch (fourth generation onward). Application software for the iPhone, iPad and iPod Touch can be downloaded from the App Store.
To address the problem, we'll create an HTML structure that formats the given system requirements into a readable and organized format. The solution ensures that each key-value pair from the input JSON is transformed into a list item within a div, following the specified guidelines.
### Approach
1. **Input Analysis**: The input is a JSON array where each object contains either system-specific requirements or individual key-value pairs of system specifications.
2. **Structure Identification**: Determine if the input objects contain a "system" key, which indicates multiple system requirements. If not, treat all objects as part of a single "PC" system.
3. **HTML Construction**: For each system identified:
- Create a div with a heading indicating the system name.
- Include a paragraph highlighting "MINIMUM SPECS".
- Transform each key-value pair into a list item with a span for the key and the value.
4. **Output**: Generate the HTML structure by concatenating the constructed elements for each system.
### Solution Code
```html
Windows System Requirements
MINIMUM SPECS
- OS: Windows 7 or higher
- Processor: 1.5 GHz
- Memory: 2 GB RAM
- Graphics: 256MB DirectX 9 or higher
- Storage: 1 GB available space
- Additional Notes: A printed copy of the Bomb Defusal Manual or an additional web-enabled device to view the Bomb Defusal Manual is required.
Mac System Requirements
MINIMUM SPECS
- OS: OS X 10.9 (Mavericks) or later
- Processor: 1.5GHz Intel Processor
- Graphics: 256MB or higher
- Storage: 1 GB available space
- Additional Notes: A printed copy of the Bomb Defusal Manual or an additional web-enabled device to view the Bomb Defusal Manual is required.
Linux System Requirements
MINIMUM SPECS
- OS: Ubuntu 16.04 or later
- Processor: 1.5GHz Intel Processor
- Graphics: 256MB or higher
- Additional Notes: A printed copy of the Bomb Defusal Manual or an additional web-enabled device to view the Bomb Defusal Manual is required.
```
### Explanation
- **HTML Structure**: Each system's requirements are enclosed in a `div` with class `prod-spec` for styling consistency.
- **Heading**: The system name is included in the heading to clearly indicate which system's requirements are being displayed.
- **Minimum Specs Paragraph**: A bold paragraph highlighting "MINIMUM SPECS" precedes the list to emphasize the necessary specifications.
- **List of Requirements**: Each key-value pair is converted into a list item (`
`), with the key wrapped in a `` for emphasis, followed by its corresponding value.
This approach ensures that the system requirements are presented in a clear, organized, and visually appealing manner, making it easy for users to understand the necessary specifications for different systems.
分享