0% found this document useful (0 votes)
13 views

Java 1

Uploaded by

Maya Sani
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Java 1

Uploaded by

Maya Sani
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

COMP 101 – Art of Computing – Spring 2020

Java Project

Abbreviation Data Base Project


Outline: In this project, you are expected to write a basic abbreviation data base program. The program will read several
abbreviations. Then, the program will check if the same abbreviation already exists in the data base. If not, it will add this
new abbreviation to the correct place in the database.
The input will be given as a series of String values until the String value of “STOP” is given.
Example input:
ABR ADSL CBR IOT NLP PTT ST VOY BIT STOP
The abbreviation data base will be composed of a 2D String array with 7 columns and 18 rows. Abbreviations starting
with „A‟ to „C‟ will be kept in the first column, abbreviations starting with „D‟ to „F‟ will be kept in the second column,
and so on as seen in the figure below. For the input above, the 2D String array will look this:

A-C D-F G-J K-N O-R S-V W-Z


ABR ENF IOT NLP PTT ST ZEX
ADSL JIT VOY
CBR
BIT

While inserting a new abbreviation to the data base, the program will check if the same abbreviation exists in the data
base or not. If it does, the program will NOT add this abbreviation to the data base a second time.
After checking over all the input, the program will write the data base to the screen as seen below:
A – C: ABR ADSL CBR BIT
D – F:
G– J: IOT JIT
K – N: NLP
O – R: PTT
S – V: ST VOY
W – Z: ZEX

Input:

 The abbreviations as Strings

Output:

 The data base as 7 rows of output as seen above in the example.

NOTE: For each column there can be no more than 18 abbreviations. You do NOT need to check this in the input.

1
NOTE: Abbreviations will ALWAYS be given as capital letters and they will ALWAYS start with an English letter. You
need to check this in the input.

NOTE: YOU CANNOT USE ARRAYLISTS, LISTS OR THESE KIND OF MORE COMPLEX DATA
STRUCTURES IN THIS PROJECT.

HINT: For checking if a given String exists in the data base, it would be a good idea to write a method like
(doesExistInDB). Using such a method will reduce a lot of code repetition.

HINT: Do not forget to use the “.equals” method for comparing two Strings with each other.

HINT: If you cannot make the “checking if the String exists in the data base” you might get PARTIAL points. So, submit
your project.

Sample Input/Outputs:

Input Output
SQL AHT NFK IOS C64 SQL AHT STOP A – C: AHT C64
D – F:
G– J: IOS
K – N: NFK
O – R: PTT
S – V: SQL
W – Z:
HTTP CS SC TNG TOS DS9 SC DOS WIN STOP A – C: CS
D – F: DS9 DOS
G– J: HTTP
K – N:
O – R:
S – V: SC TNG TOS
W – Z: WIN

You might also like