Skip to main content

Command Line Arguments ~ String, Numeric Vaues and Employee Object ~ Java Test

Write a Java command line program that takes a list of arguments as follows:
operator arg1 arg2 arg3 ... argx argN can be of the form:
  1. abcd (a String)
  2. 123 (an int)
  3. 123.33 (a double)
  4. employee(John,Smith,33000) (an Employee)

Employee can be defined by a class with firstName (String), lastName (String), and salary (double)
properties operator is one of the following: opAdd, opConcatenate, opSortAsc

  • opAdd: add numbers. Adds any argument that is numeric. Ignores non-numeric arguments.
  • opConcatenate: concatenate strings. Concatenates any argument that is a string or numeric. Ignores employee arguments.
  • opSortAsc: sort numbers and strings in ascending order. If an employee is encountered, use its lastName.
Your solution should take into consideration that other operators might be added in the future. Your code should change as little as possible in order to accommodate this requirement.

Your program should demonstrate your understanding of the following concepts:
  • Object and classes
  • Inheritance
  • Interfaces
  • Polymorphism
  • Collections
  • Exception Handling
  • Text input and String parsing
Feel free to add any comments / documentation that would help explain your reasoning.

** IMPORTANT NOTE **
Please make sure to provide a ZIP file including your Java Project along with the source code. The Java project should be ready to be imported into eclipse and it should compile successfully.

CONTACT DETAILS

For any other questions or other tasks please feel free to contact me
via email: mhassnainjamil@gmail.com
via WhatsApp: +92-324-7042178
via skype: hassnainjamil1

Comments

Popular posts from this blog

Are you looking for the article. Congratulations! you are at the right place

Please comment on this post for Article requests Kindly Write Following things in comment: 1)  Name 2)  Article Link 3)  Your Email Id We will process your request as soon as possible. Note: Share this post with friends to help them.

Human Physiology by Stuart Ira Fox [PDF] (12th edition) free download

Body Mass Index (BMI) calculator with JUnitTesting in Java

Introduction: Aitor Tilla S.L. clinic specializes on the endocrine treatment of people with diverse needs in relation to weight control. The clinic wants to launch a number of technological solutions (mobile app and web pages) that will allow its clients to have an effective monitoring of the dietary plans suggested by the clinic doctors. To this end, Aitor Tilla, S.L. requires to evolve the component that measures metrics for a healthy life developed during the previous guided exercises. The component will be reusable and will allow the calculation of new necessary metrics. The component will be developed in Java, J2EE platform, and will be delivered in a JAR format that will allow the access to the methods, and the programming interface that integrates with the mobile app and web pages. In addition, the code will be delivered with a user manual that explains programmers how the integration with other components should be done. The function to consider consists of characterizing the B...