CILP Programming Concepts – Assignment 1 and 2

CILP Programming Concepts – Assignment 1 and 2 Include contract, purpose, example, algorithm and test cases for all programs 1. Write a program to find nth term of an arithmetic progression. 2. Write a program to find nth term of Fibonacci series. 3. Write a program to find average of n numbers. 4. Write a program to remove nth element of an array. 5. Write a program to insert an element at nth position. 6. Write a program that accepts a total number of hours worked by an employee and calculates the net pay of the employee: Net Pay = Gross Pay - Tax Gross Pay = 15 * no of hours worked Tax is calculated as per the following rule Gross Pay < 100, tax - 2% 100 <= Gross Pay < 200, tax - 5% 200 <= Gross Pay < 500, tax - 8% Gross Pay >= 500, tax 10% Write a function that calculates gross pay; write another function that calculates tax. Use these modules to calculate net pay 7. Write a program to sort a list of numbers in ascending order. 8. Define a structure Student having attributes – name, ID and score. Write a program that accepts a list of instances of type Student and returns the ID of the student who has scored the highest. 9. Define a structure Product having attributes – name, ID, price. Write a program that accepts a list of instances of type product and a Product ID, and returns the name of product with given ID. 10. Define a structure Car having attributes – model name, mileage. Write a program that accepts a list of instances of Car and a mileage, and returns the list of model names having mileage greater than given mileage.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值