代写CS 15900、代做 C++设计编程
CS 15900 – Homework 7
Due Friday 19 April 2024 at 11:00 PM (time local to West Lafayette, IN). 10 Points
Problem: A dominant number is an integer in which more than half of its digits are the same. For example, 434 is a dominant number beause of the number of times the digit 4 is present. Another example, 4343 is NOT a dominant number because neither ‘3’ nor ‘4’ present make up more than half of the digits of 4343.
The user will provide a seed for the random number generator and the minimum and maximum values to generate. A total of 1,000 numbers are to be generated in the range given (inclusive of the end points). Count how many times each digit (zero to nine) is the digit that makes a number in the data set a dominant number. Lastly, print all of the numbers in the for which the digit or digits with the largest count of dominant numbers in the data set.
Example Execution #1:
Enter desired seed value -> 2200
Enter desired minimum range value -> 1000
Enter desired maximum range value -> 9999
Dominant values by digit: 2 3 9 4 2 1 5 8 5 1
Dominant values #1: 2282 2224 2228 2822 2262
Dominant values #2: 2422 2225 2292 2202
Example Execution Explained:
• Dominant values by digit begin with ‘0’ and end with ‘9’.
• The ‘2’ is responsible for the most dominant numbers in the data set (nine).
• Values are displayed in the same order in which they were generated.
Example Execution #2:
Enter desired seed value -> 2400
Enter desired minimum range value -> 1000
Enter desired maximum range value -> 9999
Dominant values by digit: 1 5 5 7 3 8 8 4 5 4
Dominant values #1: 1555 5545 5557 3555 6555
Dominant values #2: 5055 5355 7555 6966 4666
Dominant values #3: 6686 9666 6066 6661 3666
Dominant values #4: 8666
Example Execution Explained:
• Display five dominant values per line.
• Two numbers are tied with the largest number of dominant values in the set (‘5’ and ‘6’) with 8 total occurrences each.
• Order of values begins with the smaller digit dominant number (‘5’) and continues through the largest digit dominant number (‘6’).
Example Execution #3:
Enter desired seed value -> 3000
Enter desired minimum range value -> 10000
Enter desired maximum range value -> 99999
Dominant values by digit: 9 9 8 13 6 12 9 8 4 4
Dominant values #1: 83733 37335 38833 95333 91333
Dominant values #2: 33335 13373 33370 36373 33030
Dominant values #3: 33308 33339 30343
First ten values generated:
79279 40919 74096
84718 94058 62375
92149 24877 53671
95695
Example Execution #4:
Enter desired seed value -> 2894
Enter desired minimum range value -> 10
Enter desired maximum range value -> 1000000
Dominant values by digit: 0 1 1 0 1 1 0 0 1 1
Dominant values #1: 101112 792222 48454 95255 78188
Dominant values #2: 92499
First ten values generated:
172335 127815 453121
464866 442046 663058
431503 85090 130021
823688
All course programming and documentation standards are in effect for this and each assignment this semester. Please review this document!
Example Execution #5 (input validation expectations demonstrated):
Enter desired seed value -> 0
Error! Seed value must be positive!
Enter desired seed value -> 1000
Enter desired minimum range value -> 0
Error! Minimum range value must be positive!
Enter desired minimum range value -> 9000
Enter desired maximum range value -> 9000
Error! Maximum range value must be greater than minimum range value of 9000!
Enter desired maximum range value -> 9999
Dominant values by digit: 1 1 2 0 2 0 1 0 1 24
Dominant values #1: 9994 9997 9399 9899 9499
Dominant values #2: 9992 9959 9299 9999 9991
Dominant values #3: 9990 9992 9899 9299 9994
Dominant values #4: 9969 9969 9993 9998 9199
Dominant values #5: 9099 9997 9993 9999
Academic Integrity Reminder: Please review the policies of the course as they relate to academic integrity. The assignment you submit should be your own original work. You are to seek assistance from course staff members ONLY. Collaboration is not permitted on individual homework assignments.
Additional Requirements:
1. Add the homework assignment header file to the top of your program. A description of your program will need to be included in the assignment header. This particular header can be added to your file by entering :hhw while in command mode in vi.
2. Each of the example executions provided for your reference represents a single execution of the program. Your program must accept input and produce output exactly as demonstrated in the example executions. Do not add any “bonus” features not demonstrated in the example executions. Your program will be tested with the data seen in the example executions and an unknown number of additional tests making use of meaningful data.
◦ See the final example execution provided for input validation expectations.
◦ No values given as input will exceed what an int data type variable is capable of storing.
3. For this assignment you will be required to implement user-defined functions (from chapter 4). Failing to follow course standards as they relate to good user-defined function use will result in a zero for this assignment.
4. Revisit course standards as it relates what makes for good use of user-defined functions, what is acceptable to retain in the main function, and when passing parameters by address is appropriate. In many cases user- defined function use should result in a main function that only declares variables and makes function calls.
5. Course standards prohibit the use of programming concepts beyond the material found in the first EIGHT chapters of the book, notes, and lectures.
◦ This problem can be solved using only single dimension fixed-length arrays.
◦ Theuseofanydynamicmemoryallocation,strings,bitwiseoperators,orunionswouldviolatethe
requirements of this assignment and would result in no credit being awarded for your effort.
6. A program MUST compile, be submitted through Vocareum as demonstrated during the Lab #0 exercise, and submitted prior to the posted due date to be considered for credit. The source code file you submit must be named exactly hw07.c; no variation is permitted.
Course Programming and Documentation Standards Reminders:
• It is common to make use of a symbolic/defined constant when the size of the array is known prior to the start of a program. The course standards expect all arrays to be of a fixed size. Variable-size arrays, even those demonstrated in chapter 8 of the text, would violate course standards.
• Code found inside the body of relevant selection and repetition constructs must be indented two additional spaces.
• Make use of { and } with all relevant selection and repetition constructs.
• See page 258 of your C programming text regarding the proper indentation for a switch construct.
• Use the course function header (vi shortcut :hfx while in command mode) for every user-defined function. ◦ List and comment all parameters to a function, one per line, in the course function header.
◦ All function declarations will appear in the global declaration section of your program.
◦ Theuser-definedfunctiondefinitionswillappearinyourprogramafterthemainfunction.
• Indent all code found within the main function exactly two spaces.
• Place a single space between all operators and operands.
• Comment all variables to the right of each declaration. Declare only one variable per line.
• Maximize your use of symbolic/defined constants and minimize your use of literal constants.
• Notice that several programs (see program 2-9 on pages 74-75) in the programming text use a single line comment to indicate the start of the local declaration and executable statement sections of the main function. ◦ Atnopointduringthesemestershouldthesetwosectionseveroverlap.
When you submit... only the final successful submission is kept for grading. All other submissions are overwritten and cannot be recovered. You may make multiple submissions, but only the last attempt is retained and graded.
• Verify in the confirmation email sent to you by the course that you have submitted the correct file to the correct assignment.
• Leave time prior to the due date to seek assistance should you experience difficulties completing or submitting this assignment. All attempts to submit via a method other than through the appropriate assignment on Vocareum will be denied consideration.
Assignment deadlines... are firm and the electronic submission will disable promptly as advertised. We can only grade what you are able submit via Vocareum prior to the assignment deadline.
请加QQ:99515681 邮箱:99515681@qq.com WX:codinghelp
- 从小白到高手 她在海外市场使用WhatsApp拉群工具 社交媒体影响力上涨了70%
- WhatsApp群发软件,ws全球代发/ws拉群/ws接粉/ws协议号出售
- 怎么样解决WhatsApp拉群的问题呢
- KXO151代做、代写Java设计编程
- Instagram自动采集涨粉利器,Ins博主采集打粉新技巧!
- 中法绒情 恒久无限——恒源祥携手中国国际工艺创新博览会共促中法交流
- TikTok管理层重组,CEO周受资更多监督内容审核
- 北京爱尔英智眼科丁雪主任教你这样自测白内障,不抓瞎!
- 电报精准采集,高效营销!Telegram群发引流神器带你领跑!
- EE5311代写、代做Java/Python程序设计
- ISL6146DFUZ: Empowering Electronic Systems with Advanced Power Management | ChipsX
- 太阳能照明智慧革命:旭日东方无线控制引领新时代照明
- 揭秘广东筑梦人新型材料有限公司负氧离子黄晶板简约而不失随性的生活
- SDSC4026代写、代做Python / Matlab程序
- Ins群发群控工具,Instagram多开云控群发,助你快速推广!
- 全方位Telegram代群发,助力品牌全球曝光
- Instagram营销采集软件,ins超强采集私信工具/ig采集神器来袭
- 理大利用地理空间人工智能技术促进可持续城市发展
- Telegram快速群发方案,电报采集群发一体机/TG拉群秘籍
- 魔法盛宴 WhatsApp拉群工具如何在我的业务中释放科幻魔法的无穷潜能
- instagram自动营销怎么做?ins一键爆粉引流推广软件来袭
- Instagram营销软件 - ins采集软件/ig采集助手/ins定位采集
- 代做 numerical-methods-montecarlointeg、R编程设计代做
- 碧桂园服务:政企联合,助力秭归脐橙销售
- 中国轴套:精工细作,助力机械传动之美
- WhatsApp群发软件一键覆盖,多语言推送!WhatsApp群发云控打破语言壁垒,全球推广无阻碍
- 从“稳中求进”的发展新战略,看碧桂园服务的长期主义
- 资金应急周转就找微粒贷 提前还款0罚金
- 从冷冰冰到暖洋洋 新点软件助力内蒙古通辽政务数据“活起来”
- 中国品牌崛起,爱可声助听器在欧美市场崭露头角
推荐
- 老杨第一次再度抓握住一瓶水,他由此产生了新的憧憬 瘫痪十四年后,老杨第一次再度抓握住一瓶水,他 科技
- 智慧驱动 共创未来| 东芝硬盘创新数据存储技术 为期三天的第五届中国(昆明)南亚社会公共安 科技
- 全力打造中国“创业之都”名片,第十届中国创业者大会将在郑州召开 北京创业科创科技中心主办的第十届中国创业 科技
- B站更新决策机构名单:共有 29 名掌权管理者,包括陈睿、徐逸、李旎、樊欣等人 1 月 15 日消息,据界面新闻,B站上周发布内部 科技
- 创意驱动增长,Adobe护城河够深吗? Adobe通过其Creative Cloud订阅捆绑包具有 科技
- 升级的脉脉,正在以招聘业务铺开商业化版图 长久以来,求职信息流不对称、单向的信息传递 科技
- 疫情期间 这个品牌实现了疯狂扩张 记得第一次喝瑞幸,还是2017年底去北京出差的 科技
- 苹果罕见大降价,华为的压力给到了? 1、苹果官网罕见大降价冲上热搜。原因是苹 科技
- 丰田章男称未来依然需要内燃机 已经启动电动机新项目 尽管电动车在全球范围内持续崛起,但丰田章男 科技
- 如何经营一家好企业,需要具备什么要素特点 我们大多数人刚开始创办一家企业都遇到经营 科技