Write some Software

Finalizat Postat la acum 7 ani S-au achitat serviciile după ce au fost prestate
Finalizat S-au achitat serviciile după ce au fost prestate

Your program will use a binary search tree to maintain the set of campers enrolled in Camp Posanivee. Your program should not be case-sensitive.

Your program will consist of a loop to process commands. The commands should come from a text file (say, "[url removed, login to view]"). The program quits when the command 'Q' is given. Below is a list of commands your program should support:

H

Help: print a list of commands

E name age gender

Enroll a new camper (insert)

W name

Withdraw a camper (delete)

D name

Display the age and gender of a camper

A

Print the average age of the campers

L

List all campers names in alphabetical order

S

Print the number of boy and girl campers

P

List all campers names in preorder

Q

Quit

Here name is a string of at most 20 non-blank characters, age is an integer, and gender is either M or F. You may assume command arguments are separated by one or more spaces.

Be sure to echo the input, especially for commands that give no output (like E or W), and handle special cases in a clean way (for example, computing the average age of an empty tree should not crash your program).

Example

Here is a sample input file:

A

E Kanga 26 F

E Tigger 28 M

E Pooh 31 M

L

D Tigger

E Rabbit 30 M

A

S

E Eeyore 36 M

W Kanga

P

Q

Here is the output that corresponds:

Welcome to Camp Posanivee!!

Command: A

There are no campers.

Command: E Kanga 26 F

New camper added.

Command: E Tigger 28 M

New camper added.

Command: E Pooh 31 M

New camper added.

Command: L

Alphabetical List of Campers:

Kanga

Pooh

Tigger

Command: D Tigger

Name: Tigger

CISC 503 Lab #3 Dr. Jeremy Lanman

Page 3 of 3

Age: 28

Gender: M

Command: E Rabbit 30 M

New camper added.

Command: A

Average age = 28.75

Command: S

Camper count by gender:

boys = 3

girls = 1

Command: E Eeyore 36 M

New camper added.

Command: W Kanga

Camper withdrawn.

Command: P

Preorder Traversal:

Pooh

Eeyore

Tigger

Rabbit

Command: Q

End of program.

Bring plenty of calomine lotion!

Java

ID Proiect: #11944471

Detalii despre proiect

10 propuneri Proiect la distanță Activ acum 7 ani

Acordat lui:

xeathprynx

Hello, I am expert in java/c/c++ and i can deliver your task in the least time and least payments. The code will be well commented and well formatted for better understanding. I believe in long term relations so first Mai multe

%selectedBids___i_sum_sub_4%%project_currencyDetails_sign_sub_5% USD în 1 zi
(43 Recenzii)
4.6

10 freelanceri plasează o ofertă medie de 131$ pentru proiect

Softeria

My Degree is MS Computer Software Engineering. I teach Data structure and Algorithm. I have Excellent concepts linked lists, pointers, Trees, Binary Trees, stack and queues, FIFO, LIFO, recursion Graphs, Complexity an Mai multe

$150 USD în 5 zile
(8 recenzii)
4.3
rajdeepa555

Hello Sir, I have 6 years of experience in J2EE,c#,C, php, python based technologies. Regarding front end technologies, I am proficient in html, java script, jquery. My recent java works are as follows - I'm Mai multe

$250 USD în 3 zile
(5 recenzii)
3.6
abubakar4248

Hi... i read the descriptions and understand i will provide quality work according to your requirement in given time period i will work on our project until you satisfy i am professionally software engineer(P Mai multe

$133 USD în 3 zile
(2 recenzii)
1.8
yogisharma66

Hey there, I have read your job description and i am very confident about doing this project. Let me introduce myself, My name is Sumit Kumar and have done my Engineering from University of South Carolina. I am a ve Mai multe

$155 USD în 3 zile
(0 recenzii)
0.0
DevJones

Hi Jones here, I hope you will consider me for your project. I will assure you a quality end product at a competitive price. I know you will be swamped with bids so thank you for the time. Hoping to hear from you soon Mai multe

$155 USD în 3 zile
(0 recenzii)
0.0
quickwriter24

We are highly experienced Post Graduate Engineers, Doctors, IT, ITES, Software, Infrastructure Professionals, Web Designers and IT Architects. We can redo, improve, and publish any engineering, scientific MATLAB, S Mai multe

$150 USD în 3 zile
(0 recenzii)
1.5