首页 > 编程语言 >DATA 2100 Major Python Programming

DATA 2100 Major Python Programming

时间:2024-11-01 20:08:49浏览次数:5  
标签:program Major .__ database Python Programming record points user

DATA 2100 Major Homework
Python Programming
100 points
Purpose
In this assignment, students will apply their (Python) programming skills to develop a data entry application that validates entries against a database and then records valid entries to the same database. Specific programming skills will include data input and output, variables, Python lists and indexes, loops, and if-statements.
Background
DustBunny Vacuums, a company we’ve heard from before, needs you to code an application for them that facilitates data entry when collecting data from customers. This application should prompt the user for data from multiple customers, verify that the customers are not already in the database, then record the new records into the database. Students will begin the assignment by importing the DustBunny Vacuums (for this assignment) dataset - MIS Major Programming HW Dataset.xlsx.
Assignment
For this assignment, you will submit two documents: (1) your Python program (this is the .py file that you create in the IDE) and (2) the check-off sheet included below, with those items checked that you were able to successfully complete. 
The program you submit MUST RUN. Comment out any parts of your program that do not run prior to submitting (please be sure to include, but comment out, these parts so that we can get some idea as to the effort you went through). Also, the program must effectively execute all of the items that you’ve checked off on your checklist.
The full program, with everything checked off below, will ask the user to input a number of customer-related data points. These will include: 
Customer First Name
Customer Last Name
State of Residence
Household Income
Marital Status
Number of Children
Pet Ownership Status (whether they own a pet or not)
After inputting each record, the program should ensure that the customer entered is a new customer by ensuring that there is not already someone in the database with the same first name and last name who is from the same state (this is the assumption we will make for this dataset to verify the customer is new). If the new record passes this validation test (i.e., if it’s a new record), then the record should be recorded into the database. If the new record fails the validation test, the user should be informed, and the record should not be written to the database.
After each record has been validated and included into the database (or not), the program should ask the user whether they would like to enter another record (and, if so, allow them to do so). At the end of the program, when the user is done entering records, the program should (a) output the values for all records that were inputted that session and (b) report how many total valid and invalid entries were made during the session (this should be two separate values — (1) total of valid entries and (2) total of invalid entries).
Check off all parts of the program that were successfully completed and submit this checklist via Canvas.
1.__ Includes the student’s name as part of a comment on the first line of the program (5 points)
2.__ Each major section of code is usefully commented to explain what’s happening. (10 points)
3.___ The MIS Major Programming HW Dataset.xlsx has been successfully imported into Microsoft Access through the instruction sheet in Module 4. The database is properly named DustBunny and the table is named CustomerInfo. (7 points)
4.__ Import the database driver module into your program. (2 points)
5.__ Connect to the Microsoft Access database within your program. (4 points)
6.The program asks the user to input (and facilitates input of) the following: 
a.__ Customer first name (3 points)
b.__ Customer last name (3 points)
c.__ Customer marital status (Married or Single) (4 points)
d.__ State of Residence (use two-character postal code) (4 points)
e.__ Household Income (HHI) (4 points)
f.__ Number of children (4 points)
g.__ Pet Ownership Status (Y or N) (4 points)
7.The program should validate that each of the following are true and, if not, request the user to re-input:
a.__ First name and last name are not null (3 points)
b.__ Marital Status is married, single, or null (3 points)
c.__ The state entered consists of two characters and is not null (3 points)
d.__ Household income is a positive integer (3 points)
e.__ Number of children is a non-negative integer (3 points)
f.__ Pet Ownership Status is Y, N, or null (3 points)
8.__ Verifies against database data that the customer is not already in the database (if there’s already a user in the database with the same first and last name and state of residence, we’ll assume that’s a duplicate). (5 points)
9.__ Writes the new record to the database’s customer table (if the record is not a duplicate). Note that this customer table’s primary key, CustID, is set up in SQL Server as an auto-incrementing primary key. (4 points)
10.__ After completing entry of a record (i.e., after entering ALL of the information for one customer), user should be prompted to find out if they want to add another record. (5 points)
11.__ If the user wants to add 代写DATA 2100 Major  Python Programming  another record, enables the record to be entered (and then validated and recorded to the database). (5 points)
12.__ Counts, separately, the number of valid and invalid records entered by the user, then outputs this number to the user once the user is done entering records. (5 points)
13.__ Thanks the user for the input and tells them, forcefully, to have a pretty good day. (4 points)
Bonus Points:
14.__ At the time when the user enters a customer’s state, verify that the state entered is valid according to the database (i.e., that it’s a state abbreviation that exists in the appropriate table). If it’s not, prompt the user to enter valid data. This should happen at the time the user enters the state data. (2 points)
15.__ Before throwing out a “duplicate record” (i.e., before not writing it to the database), inform the user that the record that was entered appears to be a duplicate record and ask whether the user would prefer to throw the record out or write it to the database despite the apparent duplication. (2 points)
16.__ When the user is done entering records, outputs (to the screen) each of the records that were entered during that session only (i.e., not all the records in the database table, just the ones that were entered during that session). (2 points)

标签:program,Major,.__,database,Python,Programming,record,points,user
From: https://www.cnblogs.com/CSSE2310/p/18521103

相关文章

  • VBA和Python到底哪个比较难学
    标题:VBA和Python到底哪个比较难学摘要:对于编程初学者,VBA和Python的学习难度受多种因素影响,如个人编程基础、学习环境和目标任务。1、Python通常被视为入门友好的语言;2、VBA深入与Office应用协同工作;3、资源丰富程度;4、语言灵活性与功能性;5、社区支持;6、个人学习倾向。在这些......
  • 使用wxpython开发跨平台桌面应用,实现程序托盘图标和界面最小化及恢复处理
    在前面随笔《基于wxpython的跨平台桌面应用系统开发》介绍了一些关于wxpython开发跨平台桌面应用的总体效果,开发桌面应用,会有很多界面细节需要逐一处理,本篇随笔继续深入该主题,对开发跨平台桌面应用的一些实现细节继续深入研究并总结,介绍程序托盘图标和界面最小化及恢复处理。1、......
  • Python 库可以用来做哪些图像处理操作
    图像处理是一个广阔的领域,Python库多元复杂且功能强大,可以实现以下操作:1、基本图像操作包括裁剪、旋转和缩放、2、颜色转换如灰度、二值化、3、图像过滤比如模糊、锐化、边缘检测、4、图像增强和恢复、5、特征提取、6、图像分割、7、物体检测和识别。让我们详细探讨图像过滤技术,它......
  • python练习题
    练习判断下列逻辑语句的布尔值1>1or3<4or4>5and2>1and9>8or7<6 答案:Truenot2>1and3<4or4>5and2>1and9>8or7<6答案:False求出下列逻辑语句的值8or3and4or2and0or9and7答案:80or2......
  • 【硕士论文完美复现】【价格型需求响应】基于需求侧响应的配电网供电能力综合评估(Pyth
    ......
  • Kafka python模拟整理
    模拟需要用到kafka的包,需要pip安装,但注意pipinstallkafka不适用于python3.x的某个版本以上,均已经换成kafka-python推荐使用版本2.0.2,目前稳定pip没有的问题如果是windows环境,可通过直接去官网下载python版本,指定版本会顺带安装pip如果是linux环境,有节点是不带pip的,可使用yu......
  • TOYOTA SYSTEMS Programming Contest 2024(AtCoder Beginner Contest 377) 补题记录(A-E
    AtCoderBeginnerContest377A-RearrangingABC字符串有ABC三个字母即可。#include<bits/stdc++.h>usingnamespacestd;#defineintlonglongsignedmain(){ strings; cin>>s; map<char,int>mp; for(autot:s){ mp[t]=1; } if(mp[......
  • 关于构建镜像-python的rpc服务打镜像
    要在离线Docker环境中构建并导出amd64架构的Docker镜像,你可以按照以下步骤操作:1.确保使用正确的基础镜像首先,确保Dockerfile中的基础镜像是适用于amd64架构的。例如,你可以使用python:slim作为基础镜像。如果已经在离线环境中启动了python:slim镜像,这里不需要做任......
  • Python爬取豆瓣音乐top250
    importrequestsfrombs4importBeautifulSoupimportpandasaspdimporttimedefcrawl_douban_music_top250():data=[]base_url="https://music.douban.com/top250"foriinrange(0,250,25):url=f"{base_url}?start={......
  • Python制作视频解析全平台免费追剧神器
    importtkinter.messageboxasmsgboximporttkinterastkimportwebbrowserimportreimporturllib.parseclassAPP:def__init__(self,width=500,height=300):self.width=widthself.height=heightself.title='视频解析器&#......