0% found this document useful (0 votes)
9 views5 pages

Step 1: Pick A Design Challenge: Inventory Management System

The document outlines two design challenges: an Inventory Management System and a Student Grade Management System, detailing their functional and non-functional requirements. It provides a design outline for the Inventory Management System, including classes, methods, and control structures, along with a basic code skeleton. The objective is to create console applications for efficient management of inventory and student records.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views5 pages

Step 1: Pick A Design Challenge: Inventory Management System

The document outlines two design challenges: an Inventory Management System and a Student Grade Management System, detailing their functional and non-functional requirements. It provides a design outline for the Inventory Management System, including classes, methods, and control structures, along with a basic code skeleton. The objective is to create console applications for efficient management of inventory and student records.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Step 1: Pick a Design Challenge

Which project are you more inclined to choose?


If you like handling stock and business-like operations, the Inventory Management System might
be a better t.
If you're interested in academic record management, the Student Grade Management System
would be a good challenge.

Step 2: De ne Requirements and Objectives


Inventory Management System

Functional Requirements

• Add new products with a name, price, and stock quantity.


• Update stock levels when sold or restocked.
• View all products and stock levels.
• Remove products from inventory.
Non-Functional Requirements

• Ef cient performance with large datasets.


• User-friendly command-line interface.
• Proper error handling for invalid inputs.
Project Objectives

• Build a working console application that allows real-time product stock management.
• Provide accurate and timely inventory information.

Student Grade Management System

Functional Requirements

• Add new students with names and IDs.


• Assign grades for different subjects.
• Calculate the average grade for each student.
• Display student records with their grades.
Non-Functional Requirements

• Handle various student records ef ciently.


• User-friendly input and output design.
• Accurate calculations for average grades.
Project Objectives

• Build a fully functional console application for student record management.


• Ensure data accuracy in grade calculations and record retrieval.

Step 3: Create a Design Outline


fi
fi
fi
fi
Example Outline for Inventory Management System

• Classes and Properties:

◦ Product: Properties for Name, Price, StockQuantity


◦ InventoryManager: Methods for adding, updating, and deleting products.
• Methods:

◦ AddProduct(): Accepts user input and adds a product to the list.


◦ UpdateStock(): Allows users to update the stock of a product.
◦ RemoveProduct(): Removes a product based on user input.
◦ DisplayProducts(): Displays all products and their stock levels.
• Control Structures and Loops:

◦ If-else: Handle invalid user input or stock quantity errors.


◦ Switch-case: Menu navigation.
◦ Loops: while loop for the main program menu.
• Flowchart Sample:
You can create a owchart in Microsoft Word to visualize tasks, starting with user input and
navigating through the product management functions.

Step 4: Build the Application


To help you start coding, here’s a basic skeleton for the Inventory Management System:

csharp
CopyEdit
using System;
using System.Collections.Generic;

namespace InventoryManagement
{
class Product
{
public string Name { get; set; }
public decimal Price { get; set; }
public int StockQuantity { get; set; }
}

class Program
{
static List<Product> inventory = new List<Product>();

static void Main(string[] args)


{
bool running = true;
fl
while (running)
{
Console.WriteLine("\nInventory Management
System:");
Console.WriteLine("1. Add Product");
Console.WriteLine("2. Update Stock");
Console.WriteLine("3. View Products");
Console.WriteLine("4. Remove Product");
Console.WriteLine("5. Exit");
Console.Write("Choose an option: ");

string choice = Console.ReadLine();


switch (choice)
{
case "1":
AddProduct();
break;
case "2":
UpdateStock();
break;
case "3":
DisplayProducts();
break;
case "4":
RemoveProduct();
break;
case "5":
running = false;
break;
default:
Console.WriteLine("Invalid option.
Please try again.");
break;
}
}
}

static void AddProduct()


{
Console.Write("Enter product name: ");
string name = Console.ReadLine();
Console.Write("Enter product price: ");
decimal price =
decimal.Parse(Console.ReadLine());
Console.Write("Enter stock quantity: ");
int stockQuantity =
int.Parse(Console.ReadLine());

inventory.Add(new Product { Name = name, Price =


price, StockQuantity = stockQuantity });
Console.WriteLine("Product added successfully.");
}

static void UpdateStock()


{
Console.Write("Enter product name to update: ");
string name = Console.ReadLine();
Product product = inventory.Find(p => p.Name ==
name);

if (product != null)
{
Console.Write("Enter new stock quantity: ");
product.StockQuantity =
int.Parse(Console.ReadLine());
Console.WriteLine("Stock updated
successfully.");
}
else
{
Console.WriteLine("Product not found.");
}
}

static void DisplayProducts()


{
Console.WriteLine("\nCurrent Inventory:");
foreach (var product in inventory)
{
Console.WriteLine($"Name: {product.Name},
Price: {product.Price}, Stock: {product.StockQuantity}");
}
}

static void RemoveProduct()


{
Console.Write("Enter product name to remove: ");
string name = Console.ReadLine();
Product product = inventory.Find(p => p.Name ==
name);
if (product != null)
{
inventory.Remove(product);
Console.WriteLine("Product removed
successfully.");
}
else
{
Console.WriteLine("Product not found.");
}
}
}
}

You might also like