Ask Question, Ask an Expert


Ask Programming Language Expert

problem 1: (Airline Reservations System): A small airline has just purchased a computer for its new automated reservations system. You have been asked to develop the new system. You are to prepare an application to assign seats on each flight of the airline's only plane (capacity: 10 seats).

Your application must display the given alternatives: Please type 1 for First Class and Please type 2 for Economy. If the user types 1, your application must assign a seat in the first-class section (seats 15). If the user types 2, your application must assign a seat in the economy section (seats 610).

Use a 1-dimensional array of simple type bool to symbolize the seating chart of the plane. Initialize all the elements of the array to false to point out that all the seats are empty. As each seat is assigned, set the corresponding element of the array to True to point out that the seat is no longer available.

Your application must never assign a seat which has already been assigned. When the economy section is full, your application must ask the person if it is acceptable to be placed in the first-class section (and vice-versa). If yes, make the proper seat assignment. If no, display the message ‘Next flight leaves in 3 hours’.

problem 2: (Set of Integers): Make class IntegerSet. Each IntegerSet object can hold integers in the range 0 - 100. The set is represented by an array of bools. Array element a[i] is true if integer i is in the set. Array element a[j] is false if integer j is not in the set. The parameter less constructor initializes the array to the ‘empty set’ (that is, a set whose array representation contains all false values).

Provide the given methods:

a) Method Union makes a third set which is the set-theoretic union of two existing sets (that is, an element of the third set’s array is set to true if that element is true in either or both of the existing sets - or else, the element of the third set is set to false).

b) Method Intersection makes a third set which is the set-theoretic intersection of two existing sets (that is, an element of the third set’s array is set to false if that element is false in either or both of the existing sets - or else, the element of the third set is set to true).

c) Method InsertElement inserts a new integer k to a set (by setting a[k] to true).

d) Method DeleteElement deletes integer m (by setting a[m] to false).

e) Method ToString returns a string containing a set as a list of numbers separated by spaces. Comprise only such elements which are present in the set. Use --- to represent an empty set.

f) Method IsEqualTo finds out whether two sets are equivalent.

prepare an application to test class IntegerSet. Instantiate some IntegerSet objects. Test that all your methods work suitably.

problem 3: (Tic-Tac-Toe): Make class TicTacToe which will enable you to prepare a complete application to play the game of Tic-Tac-Toe. The class comprises of a private 3-by-3 rectangular array of integers. The constructor must initialize the empty board to all 0s. Allow two human players. Wherever the first player moves, place a 1 in the specified square and place a 2 wherever the second player moves. Each move should be to an empty square. After each move, find out whether the game has been won and whether it’s a draw. If you feel ambitious, alter your application so that the computer makes the moves for one of the players. As well, permit the player to specify whether he or she wants to go first or second. If you feel exceptionally ambitious, develop an application which will play three-dimensional Tic-Tac-Toe on a 4-by-4-by-4 board.

problem 4: (Package Inheritance Hierarchy): Package-delivery services, like FedEx®, DHL® and UPS®, offer a number of various shipping options, each with specific costs associated. Make an inheritance hierarchy to represent different kinds of packages. UsePackage as the base class of the hierarchy, then comprise classes TwoDayPackage and OvernightPackage that derive from Package. Base class Package must comprise the name, address, city, state and zip code for the package’s sender and recipient, and instance variables that store the weight (in ounces) and cost per ounce to ship the package. Package’s constructor must initialize such private instance variables with public properties. Make sure that the weight and cost per ounce contain positive values. Package must provide a public method find outCost which returns a decimal pointing out the cost related with shipping the package. Package’s find outCost method must find out the cost by multiplying the weight by the cost per ounce. Derived class TwoDayPackage must inherit the functionality of base class Package, however as well comprises an instance variable which represents a flat fee the shipping company charges for two-day delivery service. TwoDayPackage’s constructor must receive a value to initialize this instance variable. TwoDayPackage must redefine method find outCost so that it find outs the shipping cost by adding the flat fee to the weight-based cost computed by base class Package’s find outCost method. ClassOvernightPackage must inherit directly from class Package and contain an instance variable representing an additional fee per ounce charged for overnight delivery service. OvernightPackage must redefine method find outCost so that it adds the additional fee per ounce to the standard cost per ounce before computing the shipping cost. prepare a test application which makes objects of each kind of Package and tests method find outCost.

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M91962

Have any Question? 

Related Questions in Programming Language

This assignment introduces you to the perl language and cgi

This assignment introduces you to the Perl language and CGI programming. You will use your scripting and html skills to build a Perl program that will gather user input to then generate a personal webpage. This program w ...

Consider the following three programswhere i k l are low

Consider the following three programs: where i, k, l are low variables and a, b, c, d, h, n are high variables. Assume db is a database with two columns (shown as array, where the index represents the row), lookup and is ...


Computer Science Program- Write all of the following: main program: Call a function to open an input file. Call a function to read 3 integers in from the input file. Call a function that will find 3 normalized doubles, g ...

Questioncomplete tutorial 10 case problem 2 - ridgewood

Question: Complete Tutorial 10 Case Problem 2 - Ridgewood Herald Tribune found on pages 734-736 of your textbook. Complete the entire website assignment and upload your files to your 000WebHost account. After uploading t ...

Programming assignment 1 grocery storethis assignment

Programming Assignment #1: Grocery Store This assignment attempts to serve as a refresher for concepts that I hope you learned in CS 122. In this assignment, you will be building a simple storefront for a small grocery s ...

1 implement dfs by using prolog2 implement bfs by using

1. Implement DFS by using PROLOG. 2. Implement BFS by using PROLOG. 3.  Solve the problem of Question 3 in Assignment 1 by using your PROLOG programs of DFS and BFS, respectively. Question 3 from Assignment 1 to Solve wi ...

Assignmentyou will write a program that acts like a simple

Assignment You will write a program that acts like a simple calculator for binary numbers. You should read in a string of input that has the format: number operator number. Each of the numbers should be presented in two' ...

The briefyour small development team of ideally three

The Brief Your small development team of (ideally) three people has been asked to implement and test the Human Resource Information System desktop application. Your software product will be a database- backed desktop app ...

The given machine description will provide the basis for

The given machine description will provide the basis for this assignment. You will create a virtual machine/operating system for the machine described below that will accept programs in the target machine language. The d ...

Write a program that calculates several possible tips to

Write a program that calculates several possible tips to give to a waiter at a restaurant. Ask the user to enter the total cost of the meal and then calculate a tip at 10%, 12.5%, 15%, 17.5%, and 20%. Write the original ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate