Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

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

Programming lab assignment set awhat to submitcomplete

Programming Lab Assignment (Set A) What to Submit Complete Problem Solving Steps 1 - 3 (check plan, data analysis, initial algorithm, and refinement algorithm) for the following programs. 1. (Name: lab1a-1.cpp) Write a p ...

Add a swift class file to the project that illustrates and

Add a SWIFT class file to the project that illustrates and contains the following: • The class name is 'Calculator' • Has public variables of the type float called numerator, denominator and total. • Has a method called ...

You must do this assignment correctly as described

You must do this assignment correctly as described below.  If you do not follow the directions or break the rules you will receive a 0 score. Simulation of checking tic-tac-toe board for wins by counting X and O in rows, ...

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 ...

Complete the attached code and do junit testing can you

Complete the attached code and do junit testing. Can you help with this? Testing class tests Check Date methods serves as a "test plan" for developer's testing. Complete/correct and test/demonstrate using Junit with test ...

Purposethe purpose of this assignment is to practice using

Purpose: The purpose of this assignment is to practice using loops, selections, and other basic features of Java in order to solve a real-world problem. Program Description: The Jeddah Broker Company is one of the compan ...

Your problem is as followswrite a program that will ask the

Your problem is as follows: Write a program that will ask the user to enter 4 quiz scores for 3 students.  You will need to fine the lowest quiz grade and drop it out when you calculate the average. You will need to disp ...

Object oriented system analysis and design1non-functional

Object Oriented System Analysis and Design 1. Non-Functional Requirements a) Analysis of NFRs Analyse the Case Study documents and determine the non-functional requirements (NFRs) or system quality attributes necessary t ...

Assignmentcase problem1 - online trivia found on pages

Assignment: Case Problem1 - Online Trivia found on pages 794-795 of your textbook. Complete the web pages and upload them to your 000WebHost account. After uploading the files make sure to update your index.html page to ...

Operating systems assignment-1 binary record sorting in

Operating Systems Assignment- 1. Binary Record Sorting in Ascending Order| You will write a simple sorting program. This program should be invoked as follows: shell% ./fastsort -i inputfile -o outputfile The above line m ...

  • 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