Enrolling and withdrawing from camp faster

Assignment Help Basic Computer Science
Reference no: EM13934468

The director of Camp Posanivee is frustrated. Campers are enrolling and withdrawing from camp faster than her primitive filing system can handle, and she has turned to you. You have been offered free meals at the mess hall in return for a program that will help her keep track of who is enrolled for the two-week summer camp. 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 s hould come from a text file (say,"camp.txt"). 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)

Reference no: EM13934468

Questions Cloud

Advantages and disadvantages of business regulations : Research, identify and discuss the advantages and disadvantages of business regulations
Java source code listing : Java class files for all parts and a short report (word document) the report should include details of: 1.Input 2.output 3.Problem analysis and Algorithm design 4.Variables 5. Formatting the output 6. Main Algorithm 7. Java source code Listing 8...
Assuming positive interest rates-holding other constant : Which of the following statements is CORRECT, assuming positive interest rates and holding other things constant?
Industrial firms paying dividends has increased : Which of the following are factors that help explain why the percentage of U.S. industrial firms paying dividends has increased since the early 2000s?
Enrolling and withdrawing from camp faster : The director of Camp Posanivee is frustrated. Campers are enrolling and withdrawing from camp faster than her primitive filing system can handle, and she has turned to you. You have been offered free meals at the mess hall in return for a program ..
Major depression in the population : What would you ask the community health workers in order to identify if maternal depression may be an important factor in this scenario?
Describe myoglobin structure : Define the following: prosthetic group, fractional saturation, allosterism, cooperativity, Bohr effect, isohydric carriage, respiratory acidosis & alkalosis, metabolic acidosis & alkalosis. Please provide examples.
Find the value of a small general-use building : Using the cost approach, find the value of a small general-use building with the following characteristics.
Describe what the company has done to address the issue : Describe what the company has done to address the issue and describe the leadership's role in this issue - Briefly describe one of the major strategic issues that Starbucks currently faces.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Ways to avoid communication pitfalls

Based on the section on "Watch out for communication pitfalls" in the Bateman and Snell text, describe some ways that Lei could have avoided this situation.

  Preparing company-wide migration to windows 8

Crescent Manufacturing Inc. (CMI) is a luxury leader in crafted and customized home furnishings. The corporate headquarters and a production facility are located in Texas, with additional manufacturing facilities located in Nebraska and Maryland.

  The mft data block allocation algorithm

Write a program that implements the MFT data block allocation algorithm

  What do you feel are the benefits and pitfalls of recursion

What do you feel are the benefits and pitfalls of recursion? Share examples, experiences, and recommendations.

  Write an output statement that displays the question mark

Write an output statement that displays the question mark from someString followed by a newline.

  Calculate and display height and cost of container

Compute and display the height and cost of the container. Use the following formulas, where V is the volume, r is the radius, h is the height, and C is the cost.

  Preparing simple er diagram or schema

Composite and multi-valued attributes can be nested to any number of levels. Suppose we want to design an attribute (one attribute) for a STUDENT entity type to keep track of previous college education.

  What is x after the following if-else statement is executed

What is x after the following if-else statement is executed? Use a switch statement to rewrite it and draw the flowchart for the new switch statement.

  Develop a web-based student registration system

In a previous assignment you were tasked to develop a Web-based student registration system. This Web-based system allows students to register for classes, authenticate their credentials, and select classes for which they are eligible to register.

  What is the psuedocode

What is the psuedocode?

  Privacy-related matrix

This assignment gives you an opportunity to analyze a key IT-related organizational ethical privacy issue subject to relevant laws, regulations, and policies. Both of the following sites provide sources and an excellent backdrop for issues relating t..

  A continual management problem

A continual management problem

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