Java Programming ( PROG191) - ASSIGNMENT - PASS, Assignments of Java Programming

Java Programming ( PROG191) - ASSIGNMENT - PASS

Typology: Assignments

2021/2022

Uploaded on 07/17/2022

flex.lowey
flex.lowey 🇻🇳

4.8

(104)

33 documents

1 / 20

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Higher Nationals in Computing
Java Programming
ASSIGNMENT
Learner’s name: NGUYEN GIA HUY
ID: GCS200801
Class: GCS0905C
Subject code: PROG191
Assessor name: VU THANH HIEN
Assignment due: Assignment submitted:
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14

Partial preview of the text

Download Java Programming ( PROG191) - ASSIGNMENT - PASS and more Assignments Java Programming in PDF only on Docsity!

Higher Nationals in Computing

Java Programming

ASSIGNMENT

Learner’s name: NGUYEN GIA HUY

ID: GCS

Class: GCS0905C

Subject code: PROG

Assessor name: VU THANH HIEN

Assignment due: Assignment submitted:

ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Submission date Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Nguyen Gia Huy Student ID GCS Class GCS0905C Assessor name Student declaration I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that making a false declaration is a form of malpractice. Student’s signature Grading grid Grade (0-10)

Table of Contents

  • Java Programming ASSIGNMENT
  • Assignment................................................................................................................
    1. Introduction:
    1. Requirement:
    1. UI design:
    1. Implementation:
    1. Test:
    1. Result
    1. Conclusion

Assignment

1. Introduction: Introduce the business problem: An agricultural warehouse specializing in coffee wants to have a program to manage the output of four types of coffee imported into the warehouse: Arabica, Robusta, Cherry and Moka. The program requires permission to transmit the volume of coffee entering the warehouse, the value of each type of coffee per volume, promotion information and finally output the total value of the order. The program must have a simple interface that runs on multiple operating systems, uses the Java programming language, and has a database management system using MySQL technology. 2. Requirement: Java applications to Coffee Management requirements include: ➢ Applications for coffee management software include the following functions: ➢ Add coffee information including Coffee Type, Mass, Price, Discount. ➢ Delete information. ➢ Find coffee information by name. ➢ A java form designed to be used on the Microsoft Windows platform to support management. ➢ A database to store entered information (using MySQL).

The code of the program consists of 3 classes: ⚫ The CoffeeFrame class is used to create the interface as well as set the main properties for the software. This class is the main class used to write processing algorithms on the form. ⚫ The CoffeeCheck class is used to initialize and save the initial values of the form such as ID, coffeename, mass, price, etc. This is also the class that has Constructors and Getter-Setter functions.

⚫ The CoffeeModify class is used to connect to the database as well as to retrieve information on the database. This class is also used to pass properties from the form to the database. Explain important algorithms The software has 4 main algorithms including:

⚫ Data entry algorithm. This algorithm takes the user input data on the form with the Add button and then passes it to the database through the insert function inside the CoffeeModify class. ➢ Button Add: ➢ Function inserts:

⚫ Algorithm to delete data. This algorithm takes the selected data from the user on the table form and then calls the delete function from CoffeeModify to delete the data on the database. ➢ Button Delete:

➢ Function searchBycoffeetype:

Explain how to handle errors: To handle errors during running of the software without interrupting or terminating the software, I used the Try - Catch method in Java programming. Take the data input method example: With the input method, if the user enters items like mass, price, etc., whose data type is DOUBLE, the program will catch Exception and return an error handling function inside the Catch section. Last, the code in the finally section will still be executed. Errors will be handled without interrupting the program.

clean, and you must input again. was reset, and I must input again. Case 6 Input coffee with all information is null. When you are not input anything and click Add, the information will not be update. I clicked the button Add without input anything, the warning pop-up appear, and I must input again. Success Case 7 Find Coffee with name but input a number. When you use the find option with student name but using number, the information cannot return value. I choose the Find option and input number to find information, the information cannot return value. Success

6. Result 6.1.Input and show information: 6.2.Input and Add then show information:

6.3.Reload form after user find information:

7. Conclusion I was able to comprehend the fundamental ideas and workings of the Java programming language through the report on the program as well as by creating a piece of expert software to manage the coffee warehouse. I am already proficient in using object-oriented techniques, creating Java Forms, and identifying and fixing software bugs. Through this project, I was able to create a database system that integrates with the best software as well as a Java application with all of its features.

REFERENCES

  • Xuanthulab.net. 2022. Exception - Ngoại lệ trong Java. [online] Available at: https://xuanthulab.net/exception-ngoai-le-trong-java.html [Accessed 5 July 2022].
  • VietTuts. 2022. Kết nối Java với MySQL - VietTuts. [online] Available at: https://viettuts.vn/java-jdbc/ket-noi-java-voi-mysql [Accessed 5 July 2022].
  • Docs.oracle.com. 2022. "Hello World!" for the NetBeans IDE (The Java™ Tutorials > Getting Started > The "Hello World!" Application). [online] Available at: https://docs.oracle.com/javase/tutorial/getStarted/cupojava/netbeans.html [Accessed 5 July 2022].
  • C. Thomas Wu. (2010). An Introduction on Object-Oriented Programming with Java. 5th ed. Library of Congress Cataloging-in-Publication Data, pp.445- 477
  • Paul Deitel – Harvey Deitel. (2012). Java for Programmer. 2nd ed. Library of Congress Cataloging-in-Publication Data, pp.398- 467