CP40061E CP4CS61E CP4HA61E Programming Assignment – UK

Module Code :- CP40061E/CP4CS61E/CP4HA61E
Module Title :-  Programming
Assessment Type :-  Assignment Portfolio
Weighting :-  100%
Assessment Elements :-
There is one portfolio which is made up of two tests and one assignment which will cover the following aspects:
Element 1 & 2: The two tests will be set by the module leader. The first test will be held in week 6 where as the second test will be held in week 15 of the semester.
CP40061E CP4CS61E CP4HA61E Programming Assignment – UK

CP40061E CP4CS61E CP4HA61E Programming Assignment

Weighting: 50% (25% for each test)

Date/time/method of test: Week 6 and Week 15.

Element 3: Assignment.
The assignment will be given by the module leader to be submitted in 13 and will cover the following aspects:

• Appreciation of different programming paradigms
• Analysis of given problems using pseudo codes and flowcharts
• Implementation of solutions to given problems using Java programming constructs

Weighting: 50%

Date/time/method of submission: Week 13

For the given tasks see below you are required to produce a coursework document using the Java programming language.

CP40061E CP4CS61E CP4HA61E Programming Assignment – UK

Evidence of the working application in terms of screenshots of the code and output must be submitted online via the UWL Blackboard portal

Tasks :-
The tasks listed below provide an informal specification of programs that you are asked to develop test and document. All these tasks must be included in the coursework with appropriate coding standards and documentation.

Task 1: Write a Java program to print an American flag on the screen.

Expected Output:
CP40061E CP4CS61E CP4HA61E Programming Assignment Task 2:
Write a Java program to compute body mass index (BMI). The program should take input values such as weight and height in order to calculate BMI and display it on the screen. In addition the program should display to the user whether the calculated BMI result corresponds to underweight healthy weight or over weight.

Formula: weight (kg) / [height (m)]2

Task 3:
Write a Java program to simulate an online store. The program should begin by displaying a list of products and their prices. There should be a minimum of 4 products offered. The program should ask the user to choose a product and then ask the user to enter the quantity they require of that product. The program should then allow the user to keep choosing more products and quantities until they enter something to indicate they want to end the program (e.g. a given number or q or exit. The program should then tell the user the total amount for the products they have selected.

Task 4:
Write a program Election that computes the tally in a write-in election and announces the winner. Since the votes are write-in there is no pre-determined set of candidates. Who ever appears the most in the votes is the winner. The user enters the individual votes one vote per line and ends entering with typing -1 or an empty line. To compute the tally, the program uses two arrays a String [ ] variable (names) and an int [ ] variable (count). Upon receiving a single vote, the program checks if the name on the vote appears in names, and if it does the program adds 1 to the value of the element in count. If the name does not appear in names the program extends both arrays by one element stores the name in names at the last position and store 1 in count at the last position. In this manner, the two arrays will have the same lengths. The initial length is 0 for both arrays.

CP40061E CP4CS61E CP4HA61E Programming Assignment – UK

Hint: You can use either Array or ArrayList.
Below is an example of how the program may run:
CP40061E CP4CS61E CP4HA61E Programming Assignment

Task 5 :
Task 5 is on Object Oriented Programming.
Design a class named Account that contains:
• A private int data field named id for the account (default 0).
• A private double data field named balance for the account (default 0).
• A private double data field named annual Interest Rate that stores the current interest rate (default 0). Assume all accounts have the same interest rate.
• A private Date data field named date Created that stores the date when the account was created.
• A no-arg constructor that creates a default account.
• A constructor that creates an account with the specified id and initial balance.
• The accessor and mutator methods for id, balance, and annualInterestRate.
• The accessor method for dateCreated.

• A method named getMonthlyInterestRate() that returns the monthly interest rate.
• A method named withdraw that withdraws a specified amount from the account.
• A method named deposit that deposits a specified amount to the account.
• Draw the UML diagram for the class.
• Implement the class. Write a Java program that creates an Account object with an
account ID of 1122 a balance of $20,000 and an annual interest rate of 4.5%. Use the withdraw method to withdraw $2,500, use the deposit method to deposit $3,000, and
print the balance, the monthly interest and the date when this account was created.

ORDER This CP40061E CP4CS61E CP4HA61E Programming Assignment NOW And Get Instant DiscountOrder Your Assignment

Read More :

Principles Of Data Science Assignment UK