Chat with us, powered by LiveChat PROGRAM DESIGN AND DEVELOPMENT | Writedemy

PROGRAM DESIGN AND DEVELOPMENT

PROGRAM DESIGN AND DEVELOPMENT

T1 2019 Page |

1

T12019: ICT104 Program Design and Development

Programming Assignment

Assessment type: Programming Assignment

Purpose: This assessment will allow students to demonstrate their understanding of Java programming and object oriented concepts, the use of list classes in collection framework, and the use of graphical features using swing and applets. This assessment contributes to Learning Outcomes c and d.

Value: 20%

Due Date: Week 10 Sunday 23:55

Task Details:

Topic: Develop Java application based on the given scenario: individual assignment

Assignment Details: The context for this assignment (Part 1 and Part 2) is a ‘Milk Consumption App’ for calculating and displaying milk consumption of a given household. This assignment will test a student’s knowledge of and skills in writing application software for a particular task, understanding the business rules of a particular problem, coding these in a computer program, developing a graphical user interface. For this assignment, students will use the Java programming language and development will be on the NetBeans IDE platform. This assignment consists of 2 stages,

• Part 1: A simple console program (no GUI)

• Part 2: The same but wrapped in a GUI

Milk Consumption App Preamble: A milk provider business owner has approached you with a request to write a software application to track the milk usage of their clients. Following data are gathered for each filling;

a) Amount of milk purchased (x litres) [float] b) Price of milk (y cents/litre) [integer] c) Number of days the household could utilize the milk (z days) [float]

ICT104: Programming Assignment Compiled By: Divya Leekha T1 2019 Page |

2

The client requires the application to track the last five such household fillings of milk and alert if the average cost goes above the threshold as per the following table. (Important: The value of threshold is as per the last two digits of student ID from the following table.)

Threshold above Last 2 Digits of your Student ID

1) 114.05 cents 00 to 09

2) 114.10 cents 10 to 19

3) 114.15 cents 20 to 29

4) 114.20 cents 30 to 39

5) 114.25 cents 40 to 49

6) 114.30 cents 50 to 59

7) 114.35 cents 60 to 69

8) 114.40 cents 70 to 79

9) 114.45 cents 80 to 89

10) 114.50 cents 90 to 99

A Worked example: Let’s calculate the average milk consumption for a single filling. Using the notation above; The average milk consumption (afc1) = x/z (liters per day) The average cost (ac1) = (x/z)*y (cents per day) Then for five households; The overall Average Milk Consumption (afc) = {afc1+ afc2+…+ afc5}/5 The overall Average Cost (ac) = {ac1+ ac2+…+ ac5}/5

ICT104: Programming Assignment Compiled By: Divya Leekha T1 2019 Page |

3

You’ll also need to check if ac exceeds client set threshold warning.

Test Cases When designing and implementing software applications, it is always important to first work out how to test the program(s) and what data to use, then to code. You need to identify at least 5 test cases. You need to design and systematically test the two different conditions of average cost warning.

Submission Instruction Add all Java files (ending in .java) to a ZIP file. You do not need to zip the entire project folder, just the Java source file(s) (the ‘src’ folder). Part 1: Write a simple Java program to calculate the average milk consumption and the average cost for a single household filling. Then extend this to include five households and calculate the overall average milk consumption (afc) and average cost (ac) for the five households. You’ll also need to warn the user if the average cost is equal to higher than the threshold. In Part 1, you will be developing a Java program without a GUI. Input and output are via the console. When the program is executed, the user will be asked to input for five consecutive households:

• Amount of milk purchased (in litres)

• Price of ONE litre of milk (in cents)

• The number of days after the filling (in days) Then the program should display afc and ac for the data and indicate if the ac is below the warning level.

ICT104: Programming Assignment Compiled By: Divya Leekha T1 2019 Page |

4

Hint/Steps for Part 1:

1. Think about your strategy for how you will calculate the afcn and ac_n for each filling. And then how you work out the overall afc and ac using these calculations. Think about writing simple functions/methods for the repetitive calculations.

2. Add a simple Java class named Part1. Do not add a GUI.

3. Declare and instantiate the variables that you will need for Part 1. You will also need several ArrayLists to hold the milk amount, price, and number of days, at the start of the main method, for example (you’ll need to add additional ArraysLists as well): Make use of Generics to define your Collection Framework classes. i.e. ArrayList

4. Add code to read in the data from the user for the five households. A recommended

way is to use the Scanner class.

5. Now add the code that implements your strategy of calculating the afc and ac.

6. Finally, add three System.out.println() statements that state the overall afc, ac and the warning message if ac exceeds the threshold.

7. Test your implementation with the test cases mentioned above (and additionally your own).

Part 2: Design and implement a Java Swing GUI application (Java Swing components) that provides an easy to use interface. This GUI application must allow a user to input the various data elements. To this end, the user can

• input the data using Java Swing GUI elements, e.g. text fields, radio buttons, drop down lists, etc.

• Click on a Calculate button that starts the calculation of the final results, and

• An Exit or Quit button to properly close the program. Use the same code for the calculations from Part 1. Reusing code is an important part of software development. You have a great degree of freedom in what GUI elements you choose and how you would like to design the layout of your GUI.

ICT104: Programming Assignment Compiled By: Divya Leekha T1 2019 Page |

5

Notes:

• For this assignment, you do not have to do any checking for invalid user input (you may of course, if you want to), for example you do not have to check whether the user has typed in a negative number or a zero as discussed earlier.

• Your GUI should update the output labels “Average milk Consumption “, “Average Cost” and another label to show a warning if the average cost is higher when the Calculate button has been clicked. If “Average Cost” is greater than threshold then display the warning message in Red colour.

Hint/Steps for Part 2: 1. Draw a sketch of your graphical user interface on paper. What Java Swing components

will you use? Where will you place them? The above GUI is just an example. You are free to create your own GUI.

2. Add all the components for your GUI. Use Java Swing components like JFrame, JLabel, JTextField, JButton.

3. Add event handlers (ActionListeners) for your buttons, radio buttons, check boxes, etc.

4. Add the code that does the actions, e.g. that does the calculation for afc and ac. Reuse your code for the calculation Part 1 by copying and pasting it from the Part1main method into the Calculate button’s event handler.

5. Test your application. Run it as a Java Application. Enter the test cases listed above and make sure your code adheres to the Java style guide. You need to manually add more comments than the automatically generated comments.

Marking Rubrics:

Criteria (Unsatisfact ory) Fail

(Satisfactory) Pass

(Effective) Credit

(Excellent) Distinction

(Exceptional) High Distinction

%

Delivery No task submitte

d.

Complete

d less

than 50%

of the

requirem

ents. Not

submitte

d in

correct

format

Completed between 5075% of the requirements. Submitted in correct format

Completed

between

7585% of the

requirements.

Submitted in

correct format

Completed

between

8595% of the

requirements.

Submitted in

correct format

Completed

between 95-100%

of the

requirements.

Submitted in

correct format

3

ICT104: Programming Assignment Compiled By: Divya Leekha T1 2019 Page |

6

Coding Standards

No name, date, or assignment title included. Poor use of

white space (indentatio n, blank lines). Disorganiz ed and messy. Poor use

of

variables

(many

global

variables,

ambiguo

us

naming).

Missing information on name, date, or assignment title included. White space (indentation, blank lines) used properly. Organized work use of variables (many global variables, ambiguous

naming).

Includes name, date, and assignment title. White space makes program fairly easy to read. Organized work. Good use of variables (few global variables, unambiguous

naming).

Includes name, date, and assignment title. Good use of white space. Organized work. Good use of variables (no global variables, unambiguous

naming).

Includes name, date, and assignment title. Excellent use of white space. Creatively organized work. Excellent use of variables (no global variables, unambiguous

naming).

3

Documentation No documentat

ion

included.

Basic

documentation

has been

completed

Basic

documentation

has been

completed

including

descriptions of

all variables.

Purpose is

noted for each

function.

Clearly documented

including

descriptions of

all variables.

Specific

purpose is

noted for each

function and

control

structure.

Clearly and effectively documented including descriptions of all variables. Specific purpose

is noted for each

function, control

structure, input

requirements,

and output

results.

3

Runtime Does not execute

due to

errors.

User

prompts

are

misleading

or non-

existent.

No testing

has been

completed

.

Executes with

some warning

errors.

Executes without errors. User prompts contain little

information,

poor design.

Some testing

has been

completed.

Executes without errors. User prompts are understandable, minimum use of symbols or spacing in output. Thorough testing

has been

completed

Executes without errors excellent user prompts, good use of symbols, spacing in output. Thorough and

organized testing

has been

completed and

output from test

cases is included.

3

Efficiency

A difficult

and

inefficient

solution.

A solution which provides some answer

but not

efficient.

A logical

solution that is

easy to follow

but it is not the

most efficient.

Solution is efficient and easy to follow (i.e. no confusing tricks).

Solution is

efficient, easy to

understand, and

maintain.

3

ICT104: Programming Assignment Compiled By: Divya Leekha T1 2019 Page |

7

Demonstration Not given or

shown

irrelevant,

incomplete

or

ambiguous

functionality

and

features

shown and

discussed.

Some of the features and functionality are shown and discussed but some are incomplete.

Most of the

features and

functionality

are shown and

discussed, are

mostly

complete.

All of the features and functionality are shown and discussed systematically.

All of the features

and functionality

are shown and

discussed

systematically

with additional

details.

5

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?

About Writedemy

We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.

How It Works

To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Are there Discounts?

All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.

Hire a tutor today CLICK HERE to make your first order