首页 > 其他分享 >“你帮我助”软件开发

“你帮我助”软件开发

时间:2022-10-06 18:55:18浏览次数:67  
标签:product goods name 软件开发 self print master 我助

软件要求

在疫情期间,各个小区居民发挥互助精神,进行物品交换,互通有无。请你编写一个物品交换软件
该程序允许添加物品的信息,删除物品的信息,显示物品列表,也允许查找物品的信息
你实现的程序可以采用命令行方式使用,但是鼓励提供GUI

使用环境

IDE:Pycharm
环境:Python 3.7

PSP数据分析

Item Time
Planning
Estimate 5min
Development
Analysis 5min
Design Spec 0
Design Review 0
Coding Standard 0
Design 30min
Coding 2h
Code Review 10min
Test 10min
Reporting
Test report 0
Size Measurement 10min
Postmortern 5min
Process Improvement Plan 5min

功能介绍

“你帮我助”物品互换平台主要基于命令行完成用户与数据的交互。
用户通过命令行中显示的服务序号可以选择相应的功能。
例如:添加物品、删除物品、查找物品、显示全部物品。

代码

Main文件

from stock import Stock

s = Stock()
print('-' * 20 + 'The Menu' + '-' * 20)
print('1.Add your product\n2.Delete product\n3.Search for one product\n4.List all the product in stock\n5.Exit')
while True:
    try:
        info = eval(input('Please select the service you would like:'))
        if info == 1:
            s.UserAdd()
        elif info == 2:
            s.UserDelete()
        elif info == 3:
            s.Search()
        elif info == 4:
            s.ListAll()
        elif info == 5:
            print('Thanks for using!')
            break
        else:
            print("Error for input!")
    except NameError:
        print("Error for input!")

物品类

class Product:
    def __init__(self, name, master):
        self.name = name
        self.master = master

库存类

from product import Product
class Stock(object):
    def __init__(self):
        self.goods = []

    def Add(self, product):
        self.goods.append(product)

    def Search(self):
        name = input('What product do you want to search for?')
        flag = False
        for i in range(len(self.goods)):
            if self.goods[i].name == name:
                flag = True
                break
        if flag == True:
            print('The product you want to search is here:')
            print('-' * 50)
            for i in range(len(self.goods)):
                if self.goods[i].name == name:
                    print('Product:' + self.goods[i].name + '     Supplier:' + self.goods[i].master)
        else:
            print('There is no such product.')

    def ListAll(self):
        if len(self.goods) == 0:
            print('There is nothing!')
        else:
            print('-' * 20 + 'The Stock List' + '-' * 20)
            for i in range(len(self.goods)):
                    print('Product:'+ self.goods[i].name + '     Supplier:' + self.goods[i].master)

    def UserAdd(self):
        name = input('please enter product:')
        master = input('please enter your name:')
        p = Product(name, master)
        self.Add(p)

    def UserDelete(self):
        print('Please enter the information of product which you want to delete.')
        name = input('please enter your product:')
        master = input('please enter your name:')
        for item in self.goods:
            if name == item.name and master == item.master:
                self.goods.remove(item)

Github链接

https://github.com/RebelHu/YouHelpMeHelp

标签:product,goods,name,软件开发,self,print,master,我助
From: https://www.cnblogs.com/yohanceblog/p/16758197.html

相关文章

  • "你帮我助“软件开发——物品交换系统
    "你帮我助“软件开发——物品交换系统在疫情期间,各个小区居民发挥互助精神,进行物品交换,互通有无。请你编写一个物品交换软件该程序允许添加物品的信息,删除物品的信息,显示......
  • Android软件开发之盘点自定义View界面大合集
    今天我用自己写的一个Demo和大家详细介绍一个Android中自定义View中的使用与绘制技巧。1.自定义view绘制字符串            相信在实际开发过程中必然很多......
  • 你帮我助软件开发-PSP
      设计思路    实现需求只需要一个简单的单向链表,通过添加、删除、查找、遍历等基本操作即可。  设计实现    用Struct记录物品的信息,name、ow......
  • 25-70K*14薪| 梅卡曼德视觉算法、C++软件开发工程师等职位招聘
    3D视觉工坊致力于推荐最棒的工作机会,精准地为其找到最佳求职者,做连接优质企业和优质人才的桥梁。高级C++软件开发工程师薪水:25K-60K*14薪岗位职责:1、负责相关软件系统(客户端)的设......
  • 软件工程个人项目“你帮我助”软件开发
    软件工程第一次作业-物品交换系统项目需求在疫情期间,各个小区居民发挥互助精神,进行物品交换,互通有无。请你编写一个物品交换软件,该程序允许添加物品的信息,删除物品的信息......
  • 软件开发工具文字题检验_20221004
    软件开发工具文字题汇总第一章1.什么是专用的软件开发工具?它有什么优点和不足?(简答题) 的、统一的支撑环境。2.简述高级程序设计语言的不足。(简答题) 3.试论软件......
  • 软件开发工具填空题最易错的_20221004
    软件开发工作中总体设计包含(结构图)(模块清单)(公共数据设计)结模公公共数据结构程序的编写与文档的编写是两件并行的 工作,我们可以统称之为(实用阶段)。实现阶段Eclipse......
  • 软件开发工具填空题_20221004
    1第三代程序设计语言一般都是(  )语言。进入二十一世纪以来,软件开发工具的发展有两个鲜明的特点,第一个特点是面向网络,另一个特点是(来源软件的兴起和运用)。填空题1712......
  • “你帮我助”软件开发
    “你帮我助”软件开发程序语言为C++首版PSP和代码第一版代码第一版代码实现了软件中的4个核心功能,以及比较基本的命令行交互界面。···//////////////////////////......
  • 软件开发工具填空汇总
    第三代程序设计语言一般都是(过程化 )语言。进入二十一世纪以来,软件开发工具的发展有两个鲜明的特点,第一个特点是面向网络,另一个特点是(来源软件兴起和运用)。填空题171......