Write a java console application

Assignment Help JAVA Programming
Reference no: EM132648944

Assignment task

Write a java console application that allows the user to read, validate, store, display, sort and search COVID-19 vaccine data (vaccine name - String type, vaccine id - int type, trial phase -int type and cost - double type) for N vaccines. N should be declared as a constant and it should be equal to the largest digit of your student id number (e.g. if your id number is S382112 then N should be equal to 8 and you can declare it as final int N=8;). If largest digit is less than 3 then N should be equal to 3.

The vaccine name, vaccine id, trial phase and predicted cost must be read from the keyboard and must be stored in an Array or ArrayList (index 0 for vaccine 1 and index N-1 for vaccine N). The minimum and maximum cost which can be stored are $10 and $220. A validation for minimum and maximum values must be done during the reading of vaccine cost.

Your application should display and execute a menu with the following options. A switch statement must be used to execute the following menu options.
1. Read, validate and store vaccine data for N vaccines
2. Calculate and store the real cost for each vaccine
3. Display all vaccines
4. Display all vaccines in trial phase 3
5. Search a vaccine by id
6. Sort and display vaccines by name
7. Exit from the application

1. Read, validate and store vaccine data for N vaccines
This option reads vaccine name, vaccine id, trial phase and predicted cost for N vaccines from the keyboard and stores them in an Array or ArrayList. If the trial phase is less than 1 and greater than 4 then an appropriate message should be displayed and the user should be asked to enter the trial phase again. Similarly if the predicted cost is less than $10 and greater than $220 then an appropriate message should be displayed and the user should be asked to enter the cost again.

2. Calculate and store the real cost for each vaccine
This option calculates the real cost for each vaccine and then stores the real cost in Array or ArrayList. The formula to calculate the real cost is as follows: real cost = predicted cost - government rebate; where government rebate can be declared as a constant.

3. Display all vaccines
This option displays the vaccine data (vaccine name, vaccine id, trial phase, predicted cost and real cost) for all vaccines.

4. Display all vaccines in trial phase 3
This option displays the vaccine name and vaccine id of all vaccines in trial phase 3. If there is no vaccine in trial phase 3 then it displays an appropriate message.

5. Search a vaccine by id
This option asks user to enter the vaccine id and searches for it. If the id is found then it displays vaccine name, vaccine id, trial phase, predicted cost and real cost. If vaccine is not found then it displays an appropriate message "vaccine with given id is not found". If there is more than one vaccine with the given id then it displays all of them. A built-in search algorithm is not allowed in this assignment.

6. Sort and display vaccines
This option sorts (by name) all vaccines stored in Array or ArrayList in ascending order and displays all sorted vaccines (vaccine name, vaccine id, trial phase, predicted cost and real cost). You can use any sorting algorithm. A built-in sort algorithm for sorting is not allowed in this assignment.

7. Exit from the application
The application should display an appropriate message with student id and then exit from the application.

The application should work in a loop to enable the user to read, validate and store vaccine data for N vaccines, calculate and store the real cost for each vaccine, display all vaccines, display all vaccines in trial phase 3, search a vaccine by id, sort and display vaccines by name and exit from the application.

Program design
You may use any design that meets the specification. However, a good design will adhere to the following guidelines:
• be logically correct
• be easy to read and maintain
• be well-designed
• use a flowchart/UML activity diagram
• use appropriate classes, methods and fields

Your design MUST use the classes as listed below. public class Vaccine
{
//fields to store vaccine name, vaccine id, trial phase, predicted cost and real cost
//relevant methods including set and get methods
}
public class VaccineTest
{
public static void main(String[] args)
{
//menu options using switch statement
//data reading, Vaccine object creation, data storing in array/arrayList, etc.
}
//other static methods
}

You may add/use methods, parameters, fields/variables, constants, etc. which you need to complete the application.

Testing
Testing is important. You should test your application using many different types of test cases before you submit it for marking.

What to submit
You should submit online the following files.
• Vaccine.java (this file contains java code for class Vaccine)
• Vaccine Test.java (this file contains java code for class VaccineTest).
• Report.docx (this file contains a brief report that includes student name, student ID, unit name, unit code, UML activity diagram for menu option 2 (calculate and store real cost for all vaccines) and test results (screenshots for different test cases with results to show that your application is correctly working)).

Attachment:- Java assignment.rar

Reference no: EM132648944

Questions Cloud

PHYS2134 Advanced Medical Imaging Assignment : PHYS2134 Advanced Medical Imaging Assignment Help and Solution, RMIT University - Assessment Writing Service - Describe any image enhancements you do to ease
301235 Applied Cybersecurity Assignment : 301235 Applied Cybersecurity Assignment Help and Solution, Western Sydney University - Assessment Writing Service - analysis and requirements of key research
Write a description of the selected dataset and project : Write a description of the selected dataset and project, and its importance for your chosen company. Information must be appropriately referenced.
BUMAN201A Business Maths and Statistics Assignment : BUMAN201A Business Maths and Statistics Assignment Help and Solution, TAFE NSW - Assessment Writing Service - Calculate the GST exclusive and GST inclusive
Write a java console application : Write a java console application that allows the user to read, validate, store, display, sort and search COVID-19 vaccine data - vaccine name
Prepare a business process report based on a case study : Prepare a business process report based on a case study and should use their own initiative regarding any assumptions and cycle times if needed
Strategy Map and IT Assessment : Strategy Map and IT Assessment - Explain what constitutes value for an organisation and Lead a discussion on the role of EA to support business strategic goals
Reflection of personal learning process : Provide a critical reflection of their personal learning process, as experienced during this unit - A significant aspect of the reflective journal
ISY202 Information Systems Networking Assignment : ISY202 Information Systems Networking Assignment Help and Solution, Australian Institute of Higher Education - Assessment Writing Service

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd