Overview
This prompt aims to guide developers in creating a simple account management system using programming concepts. Programmers and coding learners will benefit from the structured approach and clear requirements provided.
Prompt Overview
Purpose: This code provides a simple account management system for creating, updating, viewing, and deleting accounts.
Audience: It is designed for developers seeking to implement basic account management functionalities in their applications.
Distinctive Feature: The system includes error handling for non-existing accounts and invalid operations to ensure robustness.
Outcome: Users can effectively manage account details while maintaining data integrity and security throughout the process.
Quick Specs
- Media: Text
- Use case: Generation
- Industry: Business Communications, Development Tools & DevOps, General Business Operations
- Techniques: Role/Persona Prompting, Self-Critique / Reflection, Structured Output
- Models: Claude 3.5 Sonnet, Gemini 2.0 Flash, GPT-4o, Llama 3.1 70B
- Estimated time: 5-10 minutes
- Skill level: Beginner
Variables to Fill
- [desired programming language, e.g., Python] – Desired Programming Language, E.g., Python
Example Variables Block
- [desired programming language, e.g., Python]: Example Desired Programming Language, E.g., Python
The Prompt
# Task
Write a code for a simple account management system that allows for:
– Creating accounts
– Updating account details
– Viewing account information
– Deleting accounts
# Requirements
– Implement an `Account` class with the following properties:
– `account_id`
– `name`
– `email`
– `balance`
– Include methods for:
– `create_account`: Initializes a new account with a unique account ID.
– `update_account`: Updates the name and email of an existing account by ID.
– `view_account`: Displays the details of an account by ID.
– `delete_account`: Deletes an account by ID.
– Incorporate appropriate error handling for:
– Non-existing accounts
– Invalid operations
# Steps
1. Define the `Account` class with the specified properties.
2. Develop methods for:
– Creating accounts
– Updating accounts
– Viewing accounts
– Deleting accounts
3. Ensure each method properly handles exceptions and errors, such as invalid account IDs.
4. Write test cases to validate the functionality and robustness of each method.
# Output Format
Provide well-commented code in the [desired programming language, e.g., Python], detailing each step.
Include a main function or script section demonstrating the use of the system with sample data.
# Examples
– Example code initialization:
“`python
accounts = []
account_manager = AccountManager(accounts)
“`
– Example account creation:
“`python
account_id = account_manager.create_account(“John Doe”, “john@example.com”)
“`
– Example viewing an account:
“`python
details = account_manager.view_account(account_id)
print(details)
“`
# Notes
– Assume all account IDs are system-generated and unique.
– Utilize standard libraries for basic functionalities like input/output operations.
– Consider security issues, such as securely storing sensitive information.
Screenshot Examples
How to Use This Prompt
- [account_id]: Unique identifier for each account.
- [name]: Name of the account holder.
- [email]: Email address of the account holder.
- [balance]: Current balance of the account.
- [create_account]: Method to initialize a new account.
- [update_account]: Method to modify account details.
- [view_account]: Method to display account information.
- [delete_account]: Method to remove an account from the system.
Tips for Best Results
- Define the Account class: Create a class with properties for account ID, name, email, and balance.
- Implement account methods: Develop methods for creating, updating, viewing, and deleting accounts with proper error handling.
- Handle exceptions: Ensure methods check for non-existing accounts and invalid operations to prevent crashes.
- Test functionality: Write test cases to validate each method’s performance and robustness, ensuring reliability.
FAQ
- What is the purpose of the Account class?
The Account class manages account details like ID, name, email, and balance. - How do you create a new account?
Use the create_account method to initialize a new account with a unique ID. - What happens when you view an account?
The view_account method displays the details of the specified account by ID. - How is error handling implemented?
Error handling is included for non-existing accounts and invalid operations in each method.
Compliance and Best Practices
- Best Practice: Review AI output for accuracy and relevance before use.
- Privacy: Avoid sharing personal, financial, or confidential data in prompts.
- Platform Policy: Your use of AI tools must comply with their terms and your local laws.
Revision History
- Version 1.0 (February 2026): Initial release.


