Write a party class program

Assignment Help C/C++ Programming
Reference no: EM13760509

Write a complete program that stores and prints participants in a party. As part of your program, write a Party class that implements these members:

  • An instance constant that holds the maximum number of guests. Three instance variables that hold, respectively, the actual number of guests, an array of the names of the guests, and the party host's name. A constructor that stores the maximum number of guests and the host's name.
  • An addGuest method that adds a guest to the guest list or prints an error message if the guest is already on the list or there's no more room on the guest list. A helper method, isOnList, that receives a parameter named guest. The method returns true if guest is on the guest list and returns false otherwise. A printParty method that prints the party's host and guests.

Provide a driver class that tests your Party class. Your driver class should contain this main method:

public static void main(String[] args)
{
Party party = new Party(3, "David Beckham");

party.addGuest("Roberto Baggio");

party.addGuest("Zinedine Zidane");

party.addGuest("Roberto Baggio");

party.addGuest("Johan Cruyff");

party.addGuest("Diego Maradona");

party.printParty();

} // end main

When compiled and run, your driver class and Party class together should produce this output: Roberto Baggio is already on the guest list.Diego Maradona cannot come to the party. The guest list is full.

Guest list for David Beckham's party: Roberto Baggio Zinedine Zidane Johan Cruyff

Reference no: EM13760509

Questions Cloud

How would you respond to the criticism : How would you respond to the criticism that a proposed IT architecture is not feasible based on today's technology?
Fundamental concepts and principles in accounting : Identify and explain the fundamental concepts and principles in accounting, the components of the accounting equation, the primary financial accounting equation, and financial statements and reports.
What will you use in place of your handy cell phone : What do you need to bring with you to connect your laptop's modem to the local telephone network - what will you use in place of your handy cell phone?
Myths creation : Paper about the selected creation myths that answers the following questions
Write a party class program : Write a complete program that stores and prints participants in a party. As part of your program, write a Party class that implements these members:
Airvalue airways strategic planning : Airvalue Airways is a regional carrier whose strategy is to expand gradually as they can identify routes that offer an attractive return on the investment necessary to support successful coverage of the route
Synopsis on money laundering : Write a 400-500 words synopsis on Money Laundering use at least three sources in your review of the topic. Your review should be similar to a "literature review lite" which covers the topic in some detail, but not fully, due to the constraints in..
Advantages and disadvantages of organization forms : Compare the advantages and disadvantages of organization forms, include why most large public health care organizations use the corporate form.
Evaluate the online crm system of your bank : Evaluate the online CRM system of your bank. What are the key functions included? What is missing? Is it a factor in your banking choice?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Determines and displays what the amount of his gross pay

Write a program that determines and displays what the amount of his gross pay will be for each pay period if he is paid twice a month (24 pay checks per year) and if he paid bi-weekly.

  Flipflaps - game based on pancake sorting

The project is to design and write a C++ 11/FLTK game program with a graphical user interface.The game is based on "pancake sorting,", which actually has some mathematical significance.

  Write a for loop that displays the following set of numbers

Write a for loop that displays the following set of numbers 0, 5, 10, 15, 20, 25 ...... 500.

  Prepare a cc program that uses the pthread library to

prepare a cc program that uses the pthread library to create threads and mutexes to synchronize them. the program must

  Write a program to display the total salary for assistant

Write a program to display the total salary for assistant professors, associate professors, full professors, and all faculties, respectively, and show the average salary for assistant professors, associate professors, full professors, and all facu..

  Winning number combinations from the missouri lottery

The file input.txt contains all of the winning number combinations from the Missouri Lottery since it took its current form on January 3, 1998.  The data is in a file called "input.txt"  All of the data in the file is integer.

  Write c program which has parent process and child process

Write a C program that has a parent process, a child process, and a grandchild process. The parent process should print its id and the square or 5.

  Write a c function to convert gallons-quarts-pints and cups

Write a C function named liquid() that is to accept an integer number and the addresses of the variables gallons, quarts, pints, and cups.

  Define the class bankaccount

Define the class bankAccount to implement the basic properties of a bank account. An object of this class should store the following data: Account holder's name (string), account number (int), account type (string, checking/saving), balance (double),..

  Supposed to swap numbers

The program is supposed to swap numbers, but I am stuck something is wrong! It does not swap them it repeats the second number, please help to fix! Thanks, this is in C++.

  Write a pseudocode statement

Assume that a program has two string variables named str1 and str2. Write a pseudocode statement that assigns an all uppercase version of str1 to the str2 variable. is str.add(str1,str2) part of it?

  Using array subscript notation

Using array subscript notation, base/offset notation with the array name as the pointer, array notation with  vPtr , and pointer/offset notation with  vPtr , add 3 to the value in the 3 rd element and display that number. (Do not modify the value in ..

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