Question
1. A small airline has just purchased a computer for its new automated reservations system. You have been asked to develop the new system. You
1.
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 write an application to assign seats on each flight of the airlines only plane (capacity: 10 seats).
Your application should display the following alternatives: Please type 1 for First Class and Please type 2 for Economy. If the user types 1, your application should assign a seat in the first-class section (seats 15).
If the user types 2, your application should assign a seat in the economy section (seats 610). Your application should then display a boarding pass indicating the persons seat number and whether it is in the first-class or economy section of the plane.
Use a one-dimensional array of primitive type Boolean to represent the seating chart of the plane. Initialize all the elements of the array to false to indicate that all the seats are empty. As each seat is assigned, set the corresponding elements of the array to true to indicate that the seat is no longer available.
Your application should never assign a seat that has already been assigned. When the economy section is full, your application should ask the person if it is acceptable to be placed in the first-class section (and vice versa). If yes, make the appropriate seat assignment. If no, display the message "Next flight leaves in 3 hours."
2. Use a one-dimensional array to solve the following problem: Write an application that inputs five numbers, each between 10 and 100, inclusive. As each number is read, display it only if it is not a duplicate of a number already read. Use the smallest possible array to solve this problem. Display the complete set of unique values input after the user enters each new value.
3. Use a one-dimensional array to solve the following problem: A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who grosses $5000 in sales in a week receives $200 plus 9% of $5000, or a total of $650. Write an application (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assume that each salespersons salary is truncated to an integer amount):
a) $200299
b) $300399
c) $400499
d) $500599
e) $600699
f) $700799
g) $800899
h) $900999
i) $1000 and over
Summarize the results in tabular format.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started