Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

CITP 4350 In this project, you will create your own on-line shopping store in the console application. You can choose different products to sell in your store (at least 8 products). You will create an...

1 answer below »
CITP 4350
In this project, you will create your own on-line shopping store in the console application. You can choose different products to sell in your store (at least 8 products). You will create an product inventory text file.
The program will display two options at the beginning of the program, Customer and Manager.
Customer:
If this is a new customer, the program will let customer to register with their information and assign a unique ID number to the new customer.
The customer will enter the customer id every time when they are shopping in your store and the program will keep tracking the total amount the customer spend each time to determine the discount level. You can create your discount level rule or use the rule in the assignment 4.
The program has to keep tracking the products inventory. If customer select the product that is out of stock, the program has to display a warning message and let customer continue to shop. After customer finish selecting the products, the program will calculate the subtotal, apply the discount, calculate the tax, and the total. The program will display a receipt on the screen and save it to a text file with customer information. (Just like the HEB receipt).
Manager:
    The manager option has to be password protected. The program will give the manager two option:
1. Display the inventory: display all the products stock information
2. Restock the products: add more stock for each product
You have to create different classes and utilize the inheritance features. You have to text files to keep all the information the program need. You can check some on-line store to get some ideas (Amazon, Walmart …). Make sure your program does not end unexpectedly and let user have the option to continue.
Answered Same Day Dec 03, 2021

Solution

Aditya answered on Dec 04 2021
132 Votes
CITP4350/.vs/CITP4350/DesignTimeBuild/.dtbcache.v2
CITP4350/.vs/CITP4350/v16/.suo
CITP4350
in/Debug/netcoreapp3.1/CITP4350.deps.json
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v3.1",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v3.1": {
"CITP4350/1.0.0": {
"runtime": {
"CITP4350.dll": {}
}
}
}
},
"li
aries": {
"CITP4350/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
CITP4350
in/Debug/netcoreapp3.1/CITP4350.dll
CITP4350
in/Debug/netcoreapp3.1/CITP4350.exe
CITP4350
in/Debug/netcoreapp3.1/CITP4350.pd
CITP4350
in/Debug/netcoreapp3.1/CITP4350.runtimeconfig.dev.json
{
"runtimeOptions": {
"additionalProbingPaths": [
"C:\\Users\\Aditya\\.dotnet\\store\\|arch|\\|tfm|",
"C:\\Users\\Aditya\\.nuget\\packages"
]
}
}
CITP4350
in/Debug/netcoreapp3.1/CITP4350.runtimeconfig.json
{
"runtimeOptions": {
"tfm": "netcoreapp3.1",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "3.1.0"
}
}
}
CITP4350
in/Debug/netcoreapp3.1/customerBill.txt
CITP4350
in/Debug/netcoreapp3.1/inventory.txt
Perfume,50,2555
Sanitiser,20,92
Soap,10,200
Chips,10,250
Soda,25,100
Choclate,40,80
Biscuits,15,200
Ice Cream,20,100
CITP4350/CITP4350.csproj
Project Sdk="Microsoft.NET.Sdk"
Exe
OutputType
netcoreapp3.1
TargetFramework

PropertyGroup
Project
CITP4350/CITP4350.sln
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30517.126
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CITP4350", "CITP4350.csproj", "{026E0634-C195-43C6-AF9F-C5274EB7748A}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
        Release|Any CPU = Release|Any CPU
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {026E0634-C195-43C6-AF9F-C5274EB7748A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {026E0634-C195-43C6-AF9F-C5274EB7748A}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {026E0634-C195-43C6-AF9F-C5274EB7748A}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {026E0634-C195-43C6-AF9F-C5274EB7748A}.Release|Any CPU.Build.0 = Release|Any CPU
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
    GlobalSection(ExtensibilityGlobals) = postSolution
        SolutionGuid = {B384490B-64ED-4D66-8EB3-8B46AEC452F7}
    EndGlobalSection
EndGlobal
CITP4350/Customer.cs
using System;
using System.Collections.Generic;
using System.Text;
namespace CITP4350
{
class Custome
{
private int customerID;
private string name;
private string address;
private int age;
private string number;
private static int autoId = 2001;
private List products;
public Customer(string name, string address, int age, string number)
{
this.customerID = autoId;
this.name = name;
this.address = address;
this.age = age;
this.number = number;
autoId++;
products = new List();
}
public int getCustomerID()
{
return customerID;
}
public void buyProduct(Product product)
{
products.Add(product);
}
public double getDuscountAmount(double subTotalAmount)
{
double amount = 0;
if (subTotalAmount > 50 && subTotalAmount <= 150)
{
amount = 0.05 * subTotalAmount;
}
else if (subTotalAmount > 150 && subTotalAmount <= 250)
{
amount = 0.1 * subTotalAmount;
}
else if (subTotalAmount > 250 && subTotalAmount <= 350)
{
amount = 0.15 * subTotalAmount;
}
else if (subTotalAmount > 350)
{
amount = 0.2 * subTotalAmount;
}
return amount;
}
public String getFileData()
{
double totalPrice;
double subTotal = 0;
double disountAmount = 0;
for (int i = 0; i < products.Count; i++)
{
Product p = products[i];
subTotal = subTotal + p.getTotalPrice();
}
disountAmount = getDuscountAmount(subTotal);
double taxAmount = 0.12 * subTotal;
totalPrice = subTotal + taxAmount - disountAmount;
string data = "Customer Id: "+customerID+"\nCustomer Name: "+name+"\nContact Number: "+number+"\nBill Information\nSubTotal Amount: "+subTotal+"\nDiscount Amount: "+disountAmount+"\nTax Amount: "+taxAmount+"\nTotal Amount: "+totalPrice;
return data;
}

public void generateBill()
{
double totalPrice;
double subTotal = 0;
double disountAmount = 0;
Console.WriteLine("---------------------------------------------------------");
Console.WriteLine("Customer ID: "+customerID);
Console.WriteLine("Customer Name: " + name);
Console.WriteLine("Contact Number: " + number);
Console.WriteLine("Products Bought");
for (int i =0;i {
Product p = products[i];
Console.WriteLine("Product Id: "+p.getProductId());
Console.WriteLine("Product Name: " + p.getProductName());
Console.WriteLine("Price: " + p.getPrice());
Console.WriteLine("Quantity: "+p.getQuantity());
Console.WriteLine("Product Total Amount: " + p.getTotalPrice());
subTotal = subTotal + p.getTotalPrice();
}
disountAmount = getDuscountAmount(subTotal);
double taxAmount = 0.12 * subTotal;
totalPrice = subTotal + taxAmount - disountAmount;
Console.WriteLine("\nSub Total Amount: " + subTotal);
Console.WriteLine("Discount Amount: " + disountAmount);
Console.WriteLine("Tax Amount: " + taxAmount);
Console.WriteLine("Total Amount: "+totalPrice);
Console.WriteLine("---------------------------------------------------------");
}
}
}
CITP4350/inventory.txt
Perfume,50,200
Sanitiser,20,100
Soap,10,200
Chips,10,250
Soda,25,100
Choclate,40,80
Biscuits,15,200
Ice Cream,20,100
CITP4350/Manager.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace CITP4350
{
class Manage
{
private List customers;
private List products;
private static Manager manager = null;
private Manager()
{
customers = new List();
products = new List();
readProductInformation();
}
private void readProductInformation()
{
string fileName = "inventory.txt";
using (StreamReader reader = new StreamReader(fileName))
{
string line;
while ((line = reader.ReadLine()) != null)
{
string[] a
= line.Split(",");
string productName = a
[0];
double price = Convert.ToDouble(a
[1]);
int quantity = Convert.ToInt32(a
[2]);
Product product = new Product(productName,price,quantity);
products.Add(product);
}
}
}
public void saveCustomerBill()
{
string fileName = "customerBill.txt";
using (StreamWriter file = new StreamWriter(fileName))
{
for (int i = 0; i < customers.Count; i++)
{
file.Write(customers[i].getFileData() + "\n\n");
}
}
}
public void updateInventory()
{
string fileName = "inventory.txt";
using (StreamWriter file = new StreamWriter(fileName))
{
for (int i=0;i {
file.Write(products[i].writeFileData()+"\n");
}

}
}
private int checkCustomerId(int...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here