Answer to Question #322500 in C# for Madhu

Question #322500

Designing class model for online shopping site app using OOAD


Case Study :: Online Shopping SiteHigher Level Requirements

  1. Identify the entities in the online shopping site system and model them based on OOAD (Object oriented approach and design)
  2. Identify the relationship among entities based on is-a and has-a relationship
  3. Identify the members for each of the entities with their scope
  4. Create class outline for each different class in a separate .cs file
  5. The class outline should provide the below information to the reader
  • Class body
  • Attributes declaration statements
  • Properties declaration statements
  • Methods with appropriate signatures and empty body
  1. Use OOPs features with proper justification
  2. Ensure C# code and naming conventions are strictly followed
  3. It is not expected to create a working application
  4. Provide useful comments
  5. Ensure the design implements single responsibility principle, ensuring a class handles a single responsibility
1
Expert's answer
2022-04-03T11:15:27-0400
interface IAdd
    {
        void Add(int ID, Catalog catalog);
    }
    class Client : IAdd
    {
        public int ID { get; set; }


        public Basket basket;
        public Client(int id)
        {
            ID = id;
        }


        public void Add(int ID,Catalog catalog)
        {
            for (int i = 0; i < catalog.items.Count; i++)
            {
                if (ID == catalog.items[i].ID)
                    basket.items.Add(catalog.items[i]);
            }
        }
    }
    class Basket
    {
        public List<Item> items;
    }


    class Catalog
    {
        public List<Item> items;
        public Catalog(Item item)
        {
            items.Add(item);
        }
    }
    class Item
    {
        public int ID { get; set; }
    }


    internal class Program
    {
        static void Main(string[] args)
        {
        }
    }

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS