首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
CSCI-1200辅导、讲解C++编程、Programming程序设计辅导 辅导R语言编程|调试Matlab程序
项目预算:
开发周期:
发布时间:
要求地区:
CSCI-1200 Data Structures — Spring 2021
Homework 7 — Halloween Costumes
In this assignment you will design a data structure to maintain the inventory and customer data for a
costume shop. The shop carries a variety of costumes and carries multiple copies of some of the more
popular costumes. Customers come into the shop and rent the costumes; however, the customers are fickle
and sometimes change their mind about what to be for Halloween. Each customer is only allowed to rent
one costume at a time. Your task is to streamline the costume rental process and handle queries about the
availability of costumes and “who’s wearing what” to the next party. By using STL’s associative container
(map) we can make this system quite efficient and elegant. Please carefully read the entire assignment before
beginning your implementation.
Input/Output & Basic Functionality
Your program will read from std::cin and write to std::cout, but we expect you will redirect the input
(& output) to trick your program into reading from & writing to files – see the course webpage:
“Misc. C++ Programming Information”. Each line begins with a character signaling which of four operations
should be performed:
a ghost 2 This operation will add a specified number of number of copies of a particular costume type
into the costume shop inventory. The name of the costume is a single string with no spaces (underscores
will be used if the costume name is multiple words, e.g., Elvis_Presley). If the costume is already
in the shop, the number of copies is incremented. A useful message is printed to the screen following
successful execution of this file. See the sample output.
r Sally Smith princess In this operation, a customer is attempting to rent a particular costume from
the shop. The customer name is specified by two strings: their first and last names, in that order,
and then the costume is specified by a single string, as above. If the shop does not carry that type
of costume, if no copies are currently available, or if the person is currently renting a copy of this
costume, then the request is declined with an appropriate message (see sample output). Each person is
only allowed to rent one costume at a time; thus, if the person is currently renting a different costume,
then that costume must first be returned, which will be done automatically by your code. Messages
indicating the returned costume (if any) and rented costume are output.
l gorilla This operation looks up the specified costume and outputs the number of copies available
for checkout and the names of the customers who currently have this type of costume rented. The
customers are printed in chronological order, with the oldest rental first. If the shop does not carry
this type of costume then an appropriate message is printed.
p This operation prints all customers who have ever attempted to rent from the shop (in alphabetical order
by last name then first name) and the costume (if any) that they are currently renting.
Examples of the messages your program must output are available on the course website. To receive full
credit on the assignment, please follow these examples exactly. To see if your program is performing perfectly,
you may use the Unix library program, diff which takes two files as arguments and outputs the differences
between them. diff is included with WSL. WinDiff is another option for Windows users. Please see a TA
or the instructor in office hours if you have a question about these programs.
Performance & Order Notation
You must carefully consider the performance of each of the costume shop operations and choose data
structures to achieve efficient performance. Let n be the number of different costumes in the shop, m
be the maximum number of copies of a given costume, and c be the number of customers who visit the shop.
All of the operations should have sub-linear expected running time with respect to n. Furthermore, the ’a’,
’r’, and ’l’ commands should have sub-linear expected running time with respect to c. Hint: That means
you should use maps. In fact, you’ll need at least two of them! In your README.txt file include the order
notation for each operation in terms of n, m, and c.
You are not explicitly required to create any new classes when completing this assignment, but please do so if
it will improve your program design. We expect you to use const and pass by reference/alias as appropriate
throughout your assignment. We have provided a partial implementation of the main program to get you
started. You may use none, a little, or all of this, as you choose, but we strongly urge you to examine it
carefully.
Data Structure Diagram
As part of your electronic submission, you must include a neat diagram the overall data structures for this
assignment. Follow the conventions from lecture for diagramming maps, lists, and vectors. Use this diagram
to communicate design choices you made and how this data structure works. You can illustrate how a
specific operation (just choose one) results in the insertion, modification, or removal of data in the structure.
Consider diagramming the small_input.txt example, but you may change some of the details.
The accepted file formats for this diagram are .pdf, .png, or .jpg. Name your file diagram.pdf or diagram.png
or diagram.jpg (depending on the filetype). You may draw this diagram with pen/pencil & paper and scan
or take a photo with a camera or you may use electronic drawing/diagram software.
You will be graded on neatness, clarity, and amount of informative detail included in the picture. This
diagram will be worth approximately 7 points of the total HW grade.
Extra Credit
For extra credit, re-implement the functionality of your program without maps (use vectors and/or lists
instead). Have your program take in an optional command line argument to specify the non-map version.
How does the order notation for the expected performance of the program change? Test the two versions of
the program with larger datasets to confirm your predictions of the performance differences. You can use the
UNIX time command to measure the performance. Also, make up new larger test cases as necessary. Write
up your analysis in your README.txt and submit both versions of the code – the map version should run
by default (with no command line arguments).
Submission
Use good coding style when you design and implement your program. Be sure to write your own new test
cases and don’t forget to comment your code! Use the provided template README.txt file for notes you want
the grader to read. You must do this assignment on your own, as described in the “Collaboration Policy
& Academic Integrity” handout. If you did discuss this assignment, problem solving techniques, or error
messages, etc. with anyone, please list their names in your README.txt file.
2
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做 program、代写 c++设计程...
2024-12-23
comp2012j 代写、代做 java 设...
2024-12-23
代做 data 编程、代写 python/...
2024-12-23
代做en.553.413-613 applied s...
2024-12-23
代做steady-state analvsis代做...
2024-12-23
代写photo essay of a deciduo...
2024-12-23
代写gpa analyzer调试c/c++语言
2024-12-23
代做comp 330 (fall 2024): as...
2024-12-23
代写pstat 160a fall 2024 - a...
2024-12-23
代做pstat 160a: stochastic p...
2024-12-23
代做7ssgn110 environmental d...
2024-12-23
代做compsci 4039 programming...
2024-12-23
代做lab exercise 8: dictiona...
2024-12-23
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!