Write program that asks the user to enter two decimal number

Assignment Help C/C++ Programming
Reference no: EM131149239

Computer science

Discussion Question

What is a function? What is the difference between the calling function and the called function? What is the scope of a variable? Why should you avoid using global variables?

Homework

There are two components to this homework.

Part 1

This assignment uses functions and conditional structures.

Write a program that asks the user to enter two decimal numbers. The program should display the larger of the two numbers. Use a function Max() to find the larger number. Max 0 should have two arguments, which are the numbers that the user input. Max 0 should return the larger of the two numbers.

Part 2

You will be writing a program using an array.

1. Bluebird Airlines has flights from Phoenix to six other cities in Arizona. The cities are referred to by number, 1 to 6.The price for a round-trip ticket to each of the cities is shown here.

City

1

2

3

4

5

6

Price

56.79

105.69

93.49

155.99

87.49

73.99

Write a program that computes the total price of tickets that a customer orders. The program should prompt the user for the number of the destination city and the number of tickets desired. If the user enters an invalid city number, the pro¬gram should display an error message and terminate. The program should display the total price of the ticket order. Use an array to store the ticket price table.

2. Rewrite the program of Programming Problem 1 so that it processes any number of ticket orders: The program also should continually prompt the user for a valid city number. When the user indicates that there are no more customers to process, the program should display the total number of tickets sold to each of the six cities, the total price of the tickets sold to each city, and the grand total of all the ticket prices. Use an array of accumulators to store the number of tickets sold to each city.

Reference no: EM131149239

Questions Cloud

What makes the process of independence so difficult : How would you describe the record and impact of Charles Taylor? How would you describe the record and impact of Ellen Johnson-Sirleaf? What makes the process of independence so difficult?
Do you think that the stages of human development : To what extent do you as a human service and public service leader feel constrained by age norms and life course expectations? How aware are you and your friends of your expectations?
What were the goals of the web site : What were the goals of the web site? Did you meet the goals? How did your design decisions affect the target audience? Can the target audience easily navigate this site?
Which of the following is the proper use of a 3d formula : Which of the following is the proper use of a 3D formula? Which of the following functions do NOT work with 3D formulas
Write program that asks the user to enter two decimal number : Write a program that asks the user to enter two decimal numbers. The program should display the larger of the two numbers. Use a function Max() to find the larger number.
What is the theme behind the disneyland of consciousness : What is the theme behind the Disneyland of Consciousness?-  Is Consciousness physical? -  Do you believe we are living in a computer simulation?
Represents a firm ability to achieve market superiority : Which of the following terms best represents a firm's ability to achieve market superiority
Identify one or more of perspectives presented in the video : Identify one or more of the perspectives presented in the video which seem to resonate with your perceptions of your own writing processes.
What are your responsibilities as a physician : You have been working for a physician in private practice for 8 months.- What are your responsibilities, and what would you do?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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