联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Java编程Java编程

日期:2019-10-22 11:13

ICSI 201 Fall 2019. Programming Project 1

(100 points)


Goals

In this assignment you must use Java language to program the small application for a grocery buyer.

You will create meaningful utility that implements

(i)simple math model for real problem;

(ii)design of the application logic;

(iii)basic user interface.

The implementation plus coding style and efficiency will be graded.

Description

The supermarket uses three pricing scenarios for the local products –

1.Monday, Wednesday, and Friday, the product A has fixed regular price of X dollars.

2.Tuesday and Thursday, the product A has price of X dollars, but you can buy three A-product items for Y dollars with 10% discount (Y = 3 * X * 90%).

3.On the weekend, the product A has price of X dollars, but you can buy two and get one for free.

Your application must calculate how much you pay for one item depending on a regular price, day of the week, and number of items.


For example, yogurt has regular price of $3. Then, if you buy 3 yogurts on Sunday your spending will be $2 per item.


It is not as simple as it first appears. Consider the following questions before programming:

a.Are price and how much you pay the same things?

b.In the scenarios 2 and 3, how much you pay for one item if you buy 4 or 5?

c.What is the money value of 1000 item if the product is priced using scenario 2?

d.Does fractional money exist?

Program requirements

(i)The inputs for your program are name of the product, regular price for the product, number of items, and day of the week. You may use information from any local grocery store to create a list of 5-7 products to test your program.

(ii)Your program must calculate how much you pay for the one unit of the product.

(iii)The output must be in a form “… dollars … cents.”

(iv)The program must run until the user decides to quit.

(v)The program must use methods and branches.

(vi)Rounding to the cents must be programmed (do not use standard methods).

Submission

Please review your work carefully before submitting. Read “Programming Assignments Requirements and Recommendations.” Check the grading rubric before you submit to make sure you are meeting all of the requirements.

You have three attempts to turn your work in. Use them the following way:

1.Once you have working program that passes your test and is well documented – turn it in. Back up your submission.

2.Take your time to think about your program and what can be done better: user interface, error checking, additional features, etc. Improve and polish the program and its documenting. If you can come to the working version which is better than the first submission – turn the second version in.

3.Use the third submission only if something went wrong, otherwise keep it unused.

Submission should include:

(i)Answers to the questions “a.” to “d.” written in Text Submission field or as a separate MS Word file.

(ii)Java source code as a file named P1.java.

(iii)A screenshot with your program dialog and outputs.

To submit your files, click the assignment title then in the submission window click the “Browse My Computer” button to add files to the submission.

If you need, you may add any comments in the comments area. Click the “Submit” button.


You have three submission attempts, only the last one will be considered and graded.  

You may not retract your submission or resubmit for re-grading after the due date.

Late submissions will not be accepted.

If you have trouble with the submission, please contact your TA for assistance.


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp