Question: Mandatory ) Write a program that uses a switch - statement and loops to decide how to assign airline passengers to a particular class of

Mandatory) Write a program that uses a switch-statement and loops to decide how
to assign airline passengers to a particular class of seating on a plane. Prompt for
passengers to add, and then (for each passenger) prompt for both class, and destination.
As each passenger is entered, print out what flight, and what class they are in. At the end,
after all the passengers are entered, list the total passengers added to each flight. The
flights are: Flight#1 Headed to Miami, or Flight#2 Headed to Los Angeles. Passenger
classes are 3,4 and 5(three classes possible). Include cases for handling classes outside
the range (i.e.1,2,6, etc.) and include appropriate messages for these non-supported
classes...you need to be able to differentiate between the requested classes (i.e.No first
class seating available., etc.)
(Optional) Voltage Signal-To-Noise-Ratio ( SNRV ) is a measure of how clean a
voltage signal is (i.e. a signal coming from a GPS satellite.) The overall SNRV depends
on the value of the 1-second SNR,
, according to the following formulas (from JPL
paper: Lowe, S. T., TMO Progress Report 42-137, May 15,1999):
SNRV k
4
2
4
4
64
6
768
1.6755
k 2
4
21
2
1
8
33
16
5
1.6755
Assume k is equal to 1. Write a program that prompts for a value of
and
(depending of the value of
) prints out the correct calculation for SNRV .
Test Cases:
=1.2 ; SNRV =0.63415589635931
=25 ; SNRV =36.27747549346561
(Optional) A Taylor series expansion can approximate various functions with its
terms...the more terms, the closer to the real function value it is. The Taylor series
expansion of ex xn
n! x0
0! x1
1! x2
2!n0
.... Write a program that calculates ex until the
amount a new term adds is less than 1012. Prompt for x and calculate ex . Print out the
result, and the number of terms needed. Test case: e1=2.71828182846

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!