Write a program cmsc401 java

Assignment Help JAVA Programming
Reference no: EM13246501

Write a program cmsc401.java that receives a sequence of commands (from 1 up to 10000 commands)

 a command can be one of: 

1 - an insert – add the date and city to “gig plan”

2 - a ‘date’ query – check if there’s a gig planned at a certain 

date (and if yes, which city)

 3 - a ‘next gig’ query – for the gig found using most recent 

“command 2”, check when and where the next performance is

 4 – end of sequence of commands, quit the program the sequence of commands always ends with Command 4 Command 3 always is preceded immediately by Command 2 Command 3 is given only if Command 2 returned data & city  (that is, there was a gig planed at a queried date) the sequence of commands is presented at standard input, 

each line is a new command

 format of the commands and responses to them:

1 - insert a gig, 

input format is “1 YYYYMMDD STRING”, no output

YYYYMMDD represents the date – date can by anything in the 21st century

STRING represents the city and is up to 10 characters in length

2 – a ‘date’ query, 

input format is “2 YYYYMMDD”, 

output format is “YYYYMMDD STRING” if there is a gig on that date, or 

“YYYYMMDD NO GIG” if not

3 – a ‘next gig’ query

input format is “3”

output format is data and place of next gig: “YYYYMMDD STRING”, 

or “NO NEXT GIG” if there’s no next gig in database

4 – quit

input format is “4”, no output, program exits

? Use Standard I/O to read input and write the result

? In Java, it’s System.in for input, System.out for output

 

Implement the database as a tree

Only implement the required functionality from the tree Using existing tree code (e.g. Built into Java) is NOT allowed Remember that the state of the database changes with each  insert, and queries correspond to the current state of the database

Only inserts that happened prior to the query count  Inserts will never use the same date more than once  There is only one correct result for each query As always: no other text, comments, questions, prompts  should be printed on standard output

 Prepare the source code as cmsc401.java Put your name, and a short description of  your approach (including which tree  operations are used for each command) as a  comment at the start of the cmsc401.java

Reference no: EM13246501

Questions Cloud

Linear regression analyzing total overhead cost : Discuss company overhead you determine that the majority of your indirect costs are related to four primary activities and linear regression analyzing total overhead cost and units sold and linear regression analyzing total overhead cost and machine ..
Which countrys govt is more heavily involved in economy : Governments of country A and country B spend the same amounteach year. Spending on functions relating to dealing with marketexternalities and public goods accounts for 25 percent ofgovernment expenditures in country A
Explain ammonia is produced by the reaction of hydrogen : Ammonia is produced by the reaction of hydrogen and nitrogen N2(g)+3H2(g)--->2NH3(g). a) How many moles of H2 are needed to react with 1.0 mol of N2? b) How many moles of N2 reacted if 0.60 mol of NH3 is produced?
Was everyone eligible for citizenship in ancient greece : Was everyone eligible for citizenship in Ancient Greece? If not, who was excluded? Would Ancient Greece still be considered a democracy today?
Write a program cmsc401 java : Write a program cmsc401.java that receives a sequence of commands (from 1 up to 10000 commands)
Find the torque on the loop : A 10cm diameter circular wire loop carries a current of 2.4A, Find the torque on the loop in a 1.2T magnetic field directed perpendicular to the loop
Explain copper has two naturally occurring isotopes : Copper has two naturally occurring isotopes. Cu-63 has a mass of 62.939 amu and relative abundance of 69.17%. Use the atomic weight of copper to determine the mass of the other copper isotope. Express your answer using four significant figures
What is scc the monthly operating income advantage : The Production Division has no alternative use for the facilities used to manufacture the stuffing. What is SCC's the monthly operating income advantage (disadvantage) if the goods are purchased internally?
What are some of the reason why mergers happen : In many industries, such as supermarkets, banks, cell phonecompanies, etc., because of mergers our choices as consumers are reduced to two or three competitors. Do you think thisis good for the economy

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