Programming Assignment IFN555

Task 1: Display your personal information including your last name, first name and your student ID. Make these surrounded by a border composed of asterisks.

iuww520iuww520iuww520iuww520iuww520iuww520iuww520iuww520iuww520

Task 2: The application prompts the user to enter the number of orders for interior and exterior murals. This number has to be between 0 and 30 (inclusive). Otherwise, the program prompts the user to re-enter the number.

Task 3: Display the number of orders of interior and exterior murals. Compute and display the expected revenue for each type of mural and the total revenue from both types. Interior murals cost $500.00 each, and exterior murals cost $750.00 each.

Note that all revenues should be displayed using currency format.

Task 4: Display a statement based on the following conditions:

  • If the number of exterior murals ordered is greater than the number of interior murals, the program should display “Exterior murals are becoming more attractive!”, else, the program displays “Interior murals are becoming popular!”.
  • If the number of the orders are equal, then display “Both types are equally preferred!”

Task 5: The user is prompted to input information for interior mural orders. Each interior mural order includes customer name and mural code: L for landscape, S for seascape, A for abstract, and O for others. Make sure that all the entered codes are valid (L, S, A or O), and, if not, prompt the user to re-enter the correct code. The 

number of orders should be the same as the number of interior murals ordered in Task 2.

After the data entry for all the customers is complete, display a count of the number of customers ordering each type of interior mural.

Then, continuously prompt the user for a mural code until the user enters a sentinel value. For each code entry, display a list of the customers ordering that type of mural, or display a message that the code is not valid, and re-prompt the user for a valid mural code.  

Note: You must use arrays in Task 5 in order to achieve the maximum marks.

A sample screen shot for Task 2, 3, 4 and first part of Task 5 is provided below.

  • 24
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
作业和函数式编程是两个不同的概念。 首先,作业是指在学校或工作中给予学生或员工完成的任务或项目。作业通常有特定的要求和指导,在规定的时间内完成,并提交给相应的老师或上司进行评估。 而函数式编程是一种编程范式,它强调将计算视为函数的求值和函数之间的组合。在函数式编程中,函数被视为一等公民,可以作为参数传递给其他函数,也可以作为返回值返回。这种编程方式注重函数的纯粹性和不可变性,避免了副作用的产生。 将这两个概念结合起来,可以说函数式编程可以用来解决作业中的一些问题或需求。在处理作业时,可以使用函数式编程的思想来组织和处理数据,通过定义和组合各种函数来完成各种操作。函数式编程的特点,如纯函数、不可变性和函数的组合性,可以帮助我们更加清晰和高效地完成作业。 例如,在一个作业中需要进行复杂的数据处理和转换时,可以使用函数式编程的概念来定义和组织相应的函数,将数据以函数参数的形式传递给这些函数,然后通过组合这些函数来实现所需的处理和转换。这种方式可以使代码更加简洁、可读性更高,并且更容易进行测试和维护。 总之,作业和函数式编程是两个不同的概念,但可以通过运用函数式编程的概念和原则来更好地处理和完成作业。函数式编程提供了一种清晰、简洁和高效的方法来处理和组织数据,从而帮助我们更好地完成作业。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值