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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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