Write the code that will prompt them for the category

Assignment Help Computer Engineering
Reference no: EM132107249

The program you will create is to allow a user to enter the type of seats on an airplane they would like (first class, business class, coach, economy) and you will write the code that will prompt them for the category they want to purchase and you will print out the number of seats available for that type of seat category.

You will use the 2 parallel arrays, seats[] ={5, 3,1,2} and price[] ={1200, 850, 600, 450} ; seats[] represents the number of seats available for each category - seats[0] = 5, which means there are 5 seats available in first class. seats[1] = 3 which means there are 3 seats available in business class, etc. price[] represents the price for each of these categories of seats: price[0] = 1200 which means a first class seat costs 1200 dollars

The output should look like

Welcome to Delta Airlines!

Please enter the amount of money you have to spend on a seat:

550

You can buy a seat in category 3.

Which category would you like to inquire about?

0

Category 0 has 5 seats available

Would you like a seat in category 0?

No

Which category would you like to inquire about?

1

Category 1 has 3 seats available

Would you like a seat in category 1?

Yes

Thank you for flying with us! You have a seat in category 1 for 850 dollars

New values for arrays:

seats[] = 5 2 1 2

prices[] = 1200 850 600 450

Reference no: EM132107249

Questions Cloud

Manage the information of employees in a company : You will have an array of Employee structs to keep the information of all employees. The employees.txt file may be in different size.
Nutritional needs and changes to requirements : Review the nutritional needs and changes to requirements during pregnancy. Name 2 key nutritional changes and the importance of meeting the guidelines
Which version of the program would be faster : A new compiler can reduce the number of load instructions by half. Load account for 2/3 of all load/store instructions.
What is the estimated energy requirement for olivia : What is the estimated energy requirement for Olivia? Determine the difference in the estimated energy requirement between Maggie and Olivia.
Write the code that will prompt them for the category : Write the code that will prompt them for the category they want to purchase and you will print out the number of seats available for that type of seat category.
Explain how the different stages of iron deficiency : Explain how the different stages of iron deficiency can be identified based on clinical evidence.
How many sets of numbers would you like to be displayed : A separate function should choose the first five numbers and also check that there are no repeats. You must make sure there are no repeats!
Compare and contrast the different types of eating disorders : Describe how your approach to healthcare might differ from someone who does versus does not have an eating disorder.
Maintain a nutritional diet : Would you be able to maintain a nutritional diet based on this? Why or why not? Fully explain your answer.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Create a new numarraylist initializing it with the parameter

The NumArrayList class has a single private instance variable L of type ArrayList where T is a type that extends the abstract class Number.

  Make modifications so that the code can handle any screen

The weather station implementation is only suitable for a 600 x 800 screen display. Make modifications so that the code can handle any screen dimensIOns.

  State diagram for coffee machine controller

Raw behavioural specs utilizing the state diagram for the coffee machine controller explained as follow. State events, State actions.

  Suggesting the dss solution

Now you are asked to suggest a DSS solution in order to help the claim adjusters recognizes and red flag various types of fraud.

  What is the history of osi model and benefits

Why you will recommend either asymmetric key encryption, symmetric key encryption, or no encryption at all for the Email correspondence.

  Which optional internet protocols might you implement

Which Internet protocols will your network and workstations need to support? Which optional Internet protocols might you implement?

  Which type of network devices would be supported

You have been asked to generate a paper that compares and contrasts guided versus wireless media for inclusion in your company's knowledge database.

  Discuss about the penetration testing

In information security, penetration testing may be wrongly perceived as being a "hacker-like" activity.

  Describe dma transfer

Describe DMA transfer

  Discuss the method for reducing the frustrations

Suggest one (1) method for reducing the frustrations for each of the reasons you supplied in Question one (1). Describe methods for determining.

  Identify types of input control and explain function of each

Identify four types of input control and explain the function of each. Provide an example of a data integrity error that could occur if each of these types of input control were not in place.

  Questionsome of your friends work on wireless networks and

questionsome of your friends work on wireless networks and theyre at present studying the properties of a network of n

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