GithubHelp home page GithubHelp logo

as2_pp2s's Introduction

Review Assignment Due Date Open in Visual Studio Code

Assignment 2

Creating a simple JAVA application to implement File I/O and Filtration

Dear students,

In this assignment, you need to submit you work to implement File I/O and Filtration.

Task Related - List of the required types

  • Mall class

Task Related - Mall class (10 %)

It should have the following fields and the methods:

Fields:

  • id - (String - randomly generated)
  • mallName - (String)
  • country - (String)
  • city - (String)
  • yearOpened - (Integer)
  • gla_sqft - (Integer - Gross Leasable area in square feets)
  • gla_sqmt - (Integer - Gross Leasable area in square meters)
  • shops - (Integer)

Methods:

  • necessary constructor(s)
  • a getter method for each field
  • static parseFrom(String mallRecord) : Mall - parses the given string (comma-separated) to create an instance of Mall and returns it. Note that GLA is a string in the file and stores two information. These should be separately stored in the entity in relevant fields.
  • parseTo() : String - parses the current mall instance to a string record (comma-separated) to be later stored in a file. Note that the generated string should look like the records in the input source file in a way that there is only one column representing GLA (together both in sqft and sqm)
  • static parseTo(Mall mallInstance) : String - parses the given mall instance to a string record (comma-separated) to be later stored in a file. Hint: You should use already defined instance method to delegate the job

Task Related - FileManager class (30 %)

It should have the following fields and the methods:

Fields:

  • static final MALLS - (List)

Methods:

  • static loadMalls() - returns a list of malls reading the original data source
  • static saveMalls(List malls, String fileName) - generates a file with the given filename (under the data folder) and stores the list of malls in the file. (You should include column names or header in the file)
  • Any additional methods that would help you complete the task can be added.

Task Related - Exception handling (10 %)

  • Please, carefully follow the instructions above.
  • Your program should properly enforce encapsulation, file i/o, collections, and streams
  • Your program should prevent invalid operations using proper exceptions and exception handling. Some of them are the following:
    • specified file is not found
    • given string cannot be parsed to a mall instance
    • attempt to overwrite an existing file
    • etc.

Task Related - Testing all together (50 %)

You will need to define a MallsDemo class which demonstrates all the functionality of your program. However, it is strongly encouraged to test each class and each method as soon as they are completed to have less errors and easy debugging in the end.
When you compile, make sure your .class files are totally isolated from the rest and are never commited and pushed.

Queries (to be executed in MallsDemo):

  • Load all the malls from Largest-Malls.csv
  • Sorting:
    • (10 %)Define a method sort(List malls, String fieldName, String order) method to sort the list of all malls based on the given field and order
    • Call the sort method to sort all malls based on the country names (first) and city names (second)
    • Save the result in a .csv file (name the file as descriptive as possible)(5 %)
    • Call the sort method again to sort all malls based on the descending order of the number of shops
    • Save the result in a .csv file (name the file as descriptive as possible)(5 %)
  • Filtration:
    • (10 %)Define a method filterByCountry(List malls, String countryName) method to select only those malls that are in the given country
    • Call the filterByCountry method to find the info about malls in China
    • Save the result in a .csv file (name the file as descriptive as possible)(5 %)
    • (10 %)Define a method filterByAreaSqFt(List malls, Integer lower, Integer upper) method to select those malls whose GLA in square feets falls in the given range
    • Call the filterByAreaSqFt method to find the info about malls whose GLA in square feet is in the range of [4,000,000;6,000,000]
    • Save the result in a .csv file (name the file as descriptive as possible)(5 %)
  • Note: in case of an invalid field name, country name, throw a meaningful exception instance and handle it back in main

Task Related - Class diagrams (5 %)

Draw the class diagrams including all the classes and their associations. Add the image(s) to the project folder so that they are submitted to the repository as well. You may use any tool to draw the diagrams. Make sure you submit image format (.jpg or .png).

Submission related: (5%)

  • Record a short video not exceeding 5 minutes to explain the code as well as the way users can interact with the end product
      Show:
    • main blocks of the code base
    • each of the features mentioned above
    • files that are generated (discuss either in a text editor or in an Excel sheet)
  • Upload the video to YouTube and share the link by adding it to your README.md file as the first line.
  • Submissions without a video recording will not be graded.

Important notes:

- Codes that do not compile and run for any reason will not be graded. Test properly before you submit your work.
- Please, also refer to the course syllabus about the assignments.
- Each completed feature must be commited and pushed works submitted in just one or two commits are not acceptable.
- This assignment will give you 10 % of the overall.

as2_pp2s's People

Contributors

ggurbanov12098 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.