Algorithm analysis with advanced data structures

Assignment Help JAVA Programming
Reference no: EM13282718

Algorithm Analysis with Advanced Data Structures, 

Your good friend, a Rock Star, asked you to create a Time Manager app for him

The Rock Star performs gigs at certain dates, all around the country - at most one gig per day

His memory is poor, though – he often forgets if (and where) he is supposed to play on a certain date

After confirming he has a gig at a certain night, the Rock Star often wants to know when and where the next performance will be 

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 not3 – 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

Reference no: EM13282718

Questions Cloud

How is the external environment analyzed : How is the external environment analyzed? External environmental analysis is the process of identifying and monitoring the environment in which a client exists and the opportunities and threats that are present.
Explain what mass (g) of nf3 can be produced : N2(g)+3F2(g)-->2NF3(g). If 1.7 g of nitrogen and an excess of fluorine is used in the reaction, what mass (g) of NF3 can be produced
How much thermal energy is created : A 1200 crate slides 15 down a ramp that makes an angle of 30 with the horizontal. how much thermal energy is created
Determine the fundamental period and time of signal : For each of the following signals, determine whether it isperiodic; if it is, determine its fundamental (i.e., smallest) period T0 and fundamental frequency f0. (a) x(t) =sin2(2t) (b) x(t) =cos(√3t) +sin(2t)
Algorithm analysis with advanced data structures : Algorithm Analysis with Advanced Data Structures, Your good friend, a Rock Star, asked you to create a Time Manager app for him, The Rock Star performs gigs at certain dates, all around the country - at most one gig per day
Explain how many moles of sodium ions are contained : How many moles of sodium ions are contained in a 100.4 g sample of sodium sulfate, Na2SO4? Round to one decimal place.
What is the change in thermal energy of the seat of her pant : A 22 child slides down a 2.4 -high playground slide. She starts from rest, and her speed at the bottom is 1.9 What is the change in thermal energy of the seat of her pants
For what fraction of acycle does each diode conduct : A half-wave rectifier circuit with a 1-Kwload operates from a 12-v(rms) 60-Hz household a 5-to 1 transformer having a center-tappedsecondary winding. It use two silicon diodes that can be modeled tohave a 0.7-v drop for all currents.
Explain the absorption of the standard solution : This results in the formation of the highly colored FeSCN2+ complex ion. To do this analysis, a standard solution containing 5.00x10^-5 M Fe3+ was prepared. After addition of excess SCN-, the absorption of the standard solution =0.363 at 580 nm.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a complete program which computes the sum

Write a complete program (actually complete the one on the exam) which computes the following sum: ( 100 / 1 ) + ( 99 / 2 ) + ( 98 / 3 ) + ( 97 / 4 ) + ... + ( 3 / 98 ) + ( 2 / 99 ) + ( 1 / 100 ) Use a FOR loop in your program (where indicated) to..

  A common useful equation

In physics, a common useful equation for finding the position s of a body in linear motion at a given time t, based on its initial position s0, initial velocity v0, and rate of acceleration a, is the following: ??= ??0+??0??+12????2. Write code to de..

  Create an array that stores in integers from the keyboard

create an array that stores in integers from the keyboard and then I can scan that array to check numbers in order, if the number I check is greater than the previous then I will set the next number in the array to the higher value.

  Die class that can hold an integer

Design a die class that can hold an integer from 1 to 6. use the dice class to create a dice game. in this game, the user chooses a number between 2 and 12 inclusive

  Program that initializes an array with ten random integers

Write a JAVA program that initializes an array with ten random integers and then prints four lines of output, containing

  Study the code and implement the operator overloading

The Table Q3 on the next page is the code of a class named Circle. Study the code and implement the operator overloading for these relational operators ( , >=) for the Circle class. Then, write a test program that creates two instances of the Circle ..

  Develop view for order number and order total in file

Develop a view named OrdTot. It comprises of order number and order total for each order currently on file. Order total is the sum of number ordered.

  Display random numbers to simulate rolling a die

1. Display random numbers to simulate rolling a die2. Create a java program that simulate a casino game. (rollin a die)

  Specify, design, and implement a class

Specify, design, and implement a class that can be used in a program that simulates a combination lock. The lock has a circular knob with the numbers 0 through 39 marked on the edge, and it has a three-number combination, which we will call x,y,z.

  Quadratic that solves quadratic equations

Write a method called quadratic that solves quadratic equations and prints their roots. Recall that a quadratic equation is a polynomial equation in terms of a variable x of the form ax2 + bx + c = 0. The formula for solving a quadratic equation is ?..

  Implement 4 sorting algorithms in a java "sort" class.

Implement 4 sorting algorithms in a Java " Sort " class. ( insertion sort, selection sort and quicksort, and mergesort). count the number of comparisons made.

  Write a java program that reads a five-line address

Write a Java program that reads a five-line address from an input file and produces an output file with the address repeated 50 times in three columns.

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