• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

cbourke/KaprekarProject: Git Assignment Project for Computer Science I

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

cbourke/KaprekarProject

开源软件地址:

https://github.com/cbourke/KaprekarProject

开源编程语言:

C 62.8%

开源软件介绍:

Computer Science I - GitHub Assignment

This repo contains code and tests for a simple GitHub assignment in used in Computer Science I at the University of Nebraska-Lincoln. It contains code to compute whether or not a given integer is a Kaprekar number. It contains both Java and C versions. Both versions contain both ad-hoc testing suites as well as examples of formal testing frameworks (junit and cmocka respectively).

Both versions contain intentional syntax errors and bugs that will fail a number of test cases. The assignment is to fix these errors, commit and document each change and to push it to your own repository.

When working with GitHub, you should fork the project first to your own GitHub profile. Then clone your repository to your local machine, make and commit changes, then push them to your repository.

C Version

C code is available in c_version/. A makefile is provided that specifies how to build the various parts of the project. You can build the demo using:

make kaprekarDemo

and then run it from the command line using

./kaprekarDemo 297

An ad-hoc testing program has been provided as well which can be built using

make kaprekarTest

and then run it from the command line using

./kaprekarTest

An alternative version, kaprekarTestCmocka.c has been provided that uses a formal unit testing framework called cmocka (https://cmocka.org/). It can be built using:

make kaprekarTestCmocka

which produces an executable, kaprekarTestCmocka. This will only work if you have cmocka installed on your system. The necessary files have already been installed on the CSE server, so you should build and test there.

Only after you have corrected all of the problems (both syntax errors as well as logic errors) will everything compile and the test suite reach 100%

Java Version

Code for the Java version is in src directory. However, the project is setup as an Eclipse project so you should clone the repo via Eclipse if you want the build to work.

Files provided:

  • KaprekarUtils.java - contains the method used to determine if an integer is a Kaprekar number or not
  • KaprekarDemo.java - contains a main method that you can run ad-hoc tests with
  • AutomatedAdHocTest.java - an ad-hoc automated test suite
  • TestKaprekarUtils.java - an automated test suite that uses JUnit

Once you've fixed all issues, run either AutomatedAdHocTest or TestKaprekarUtils to verify that your code is correct.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
yysun/Git-Source-Control-Provider: Git Source Control Provider is a visual studi ...发布时间:2022-06-11
下一篇:
fracz/git-exercises发布时间:2022-06-11
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap