注册 登录
查看: 2447|回复: 0
打印 上一主题 下一主题

英文作业:对字符串进行处理 实现两个数正整数相加

[复制链接]

该用户从未签到

3524

主题

3538

帖子

67万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
673178
QQ
跳转到指定楼层
#
发表于 2018-11-23 11:20:42 | 只看该作者 |只看大图 回帖奖励 |正序浏览 |阅读模式
Assignment #9
Goals:
Ø This lab gives students more experience in
· Top-down design.
· Procedural abstraction using methods.
· Good style programming.
Requirement
Write a structured program that can accept two integer numbers up to 40 digits and perform the followings:
1.        Add the two numbers and display the result.
2.        The result number should be separated by commas.
             For example
                          If inputs are:  
Number1:   236598745632
                             Number2:   2453254365546764765
The output should be:
                                                236,598,745,632 +
2,453,254,365,546,764,765
             -------------------------------------
2,453,254,602,145,510,397
       
Notes:
· You must read the two input numbers as string objects, then verify if the input is correct (i.e. all digit characters).
· You may assume that your program only works for positive integer numbers.
· You cannot use any of BigDecimal / BigInteger / double / long / int types for your calculations.
Marking Scheme
[2 marks] Presentation/Style: Organization, readability, descriptive  identifier,
                 indentation, bracket placement
[14 marks] Correctness: Program works without bugs. Appropriate use of
                  methods.
[4 marks] Internal Documentation and External document (Provide pseudo code
                for the method which adds the two String umbers)


运行效果:

下载地址:
游客,本付费内容需要支付 50金币 才能浏览支付
               

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
java无忧网(http://www.javawyw.com),专业提供Java大作业,小作业,课程设计,毕业设计源码,答辩辅导,作业排错,bug修复,专业解答,远程部署运行项目等服务
本网站所有源码,保证能运行!
QQ:1399491757
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回列表 返回顶部