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 a program to handle a college class grades

Create a program to handle a college class grades - The program should ask how many students are in the class

  Calculate the total of a purchase from a farmer''s market

You will develop a program that can calculate the total of a purchase from a farmer's market that sells apples, bananas, and oranges. At this particular market, apples are $1.99/lb., bananas are $0.99/lb., and oranges are $1.50/lb. Users should be..

  Winning number combinations from the missouri lottery

The file input.txt contains all of the winning number combinations from the Missouri Lottery since it took its current form on January 3, 1998.  The data is in a file called "input.txt"  All of the data in the file is integer.

  What input parameters the function takes

What input parameters the function takes.  What results it returns to the calling program.  How it is called in the main.  Do not forget to create a prototype for it at the top of the program.

  Write a program to simulate the process

Write a program to simulate the process of an n-bit (n x n) shift-and-add syn-chronous multiplier - Compare performance of an unsigned shift-and-add multiplier with one using a shift-over technique.

  Represent the real numbers

Assume you are given a set of N

  Print out contents of the vector

Write C++ program to provide the subsequent functionality - Ask users to enter 10 integer numbers and Print out contents of the vector.

  Research paper on overloading operators

Write a 2 page research paper (excluding title and reference pages / double spaced) on overloading operators. Explain the concepts discussed in the textbook using at least an example not included in the textbook.

  What are data declaration statements

I need an example of a flow chart and specification sheet of a C program.

  Implement c code for drawing filled triangles

Calculate the size of a rectangle that is just large enough to contain the triangle. The bx, by, bw, and bh fields of the triangle data structure should be initialized with the appropriate values.

  Your main function will still prompt the user

Your main function will still prompt the user for the account number and service code. Based on the service code, main will ask for the correct number of minutes, then call your functions above as needed to finish the job. In addition you must.

  Write a program that simulates the dial of a phone number

Write a program that simulates the dial of a phone number. The program will accept a phone number as input, and it will acknowledge the call by either writing an error message or the 8 digit phone number to the console window. The phone number may..

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