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

  What is a memory location

Assume that memory location 1200 is allocated for p and memory location 1800 is allocated for num.

  Design a calculator program

Design a calculator program that will add, subtract, multiply, or divide two numbers input by a user. Your program design should contain the following: The main menu of your program is to continue to prompt the user for an arithmetic choice until th..

  Implement database having array of pointers

One way to implement this database is to have an array of pointers pointing to Employee objects. You will obviously require a function named Calculate_salary() which will be different for each employee class. Write code in c++

  Each person in your team will complete one sequence

each person in your team will complete one sequence problem problem 1 or 2. one selection problem problems 3 4 or

  Dynamic array of a string that takes in names

Can you please show me an example of a C++ Class that has a dynamic array of a string that takes in names by user input??

  Write the class definition for a class called complex

. Write the class definition for a class called complex.

  Provide public member functions that perform the given task

Provide public member functions that perform the given tasks setComplex function to set complex number to set the real part and imaginary part of the complex number

  Write original program that declares a two dimensional array

Write an original program that declares a two dimensional array. You can either initialize it with value or input values and then output all the contents.

  Program consisting of multiple objects

Write a program consisting of multiple objects which interact with each other by following appropriate design practices

  Implement the delivery company

Implement the delivery company using the classes given in the class diagram above.

  List the names of the members in the structure

Name the file and the line number, or the range of numbers, in that file where this structure type is defined. List the names of the members in the structure.

  Execution goes back to the caller by default

The execution goes back to the caller by default, when the last statement in a method is reached? Assuming that no return statement is used, do you agree with the preceding statement?

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