Computers and Technology

ProgrammingAssignment3 Project Goals
Please Code using C
The goal of this project is to:

Familiarize students with functions
Provide students with continued practice with expressions and selection.

Important Notes:

Formatting: Make sure that you follow the precise recommendations for the output content and formatting. For your testing purposes, the autograder will be comparing your output to that of the example executable.
Comments: Header comments are required on all files and recommended for the rest of the program. Points will be deducted if no header comments are included.
Filename: Save your program as hotels. c

Program

Hope you enjoyed your stay!

We're going to create a reservation making system to incorporate discounts for longer stays.

We’ll be getting the customer’s number of nights and we’ll also be getting the type of the room, which should be one of the following letters: D, Q, or K (for Double, Queen, or King). We’ll do that for two reservations.

To be able to advise the user on which reservation they should choose, we're going to have to make some calculations. First we'll need to determine the price per night. Double rooms go for $59.99 per night, Queen rooms are $69.99 per night, and King rooms are $79.99 per night.

Then we'll need to determine the discount. For every night over 2, a 15% discount should be applied. For example, if the stay is for 4 nights, then a 30% discount would be applied to the overall price.

Finally, we need to let the user know which stay is the cheapest or if they're the same cost.
Input:

The user should be prompted for a set of two values which represent the number of nights and the room type for the first reservation. The number of nights should be a whole number. The room type should be a single letter. The user should enter both values on one line, separated by spaces. The user should then be prompted for the remaining reservation.

Example (the highlighted part is what the program displays and the italicized part is the user input): Reservation 1 (#nights type): 3 D
The example executable:

An example executable is provided in this repository. You should be able to run it from your project folder. If you encounter a “permission denied” error when attempting to run the executable, type chmod u+x hotelsExecutable into the terminal and try running the executable again.
Requirements

main()
Functionality: The main function should prompt the user for two reservations. The room rate for each room for each reservation must be determined. Then the reservation total for each reservation can be calculated. A message should be displayed advising the user on which reservation is the better deal.

In addition to the main functions, your program should have 2 more functions:

getRoomRate()
Input Parameters: room type
Returned Output: room rate
Functionality: Given the type of room, this function should return the appropriate room rate.

calcReservation()
Input Parameters: room rate, number of nights
Returned Output: total reservation price
Functionality: Given the room rate and number of nights, this function should return the total reservation price with any applicable discount applied.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 18:30, Angelanova69134
Technician a says that a shop towel should never be used to clean around the flange area before replacing an automatic transmission filter. technician b says that a dimpled transmission fluid pan can be repaired. who is right
Answers: 3
image
Computers and Technology, 22.06.2019 22:00, bbysl15
What is the name of the option in most presentation applications with which you can modify slide elements? 1. the option enables you to modify a slide element in most presentation applications.
Answers: 3
image
Computers and Technology, 22.06.2019 23:00, brooklynmikestovgphx
Suppose s, t, and w are strings that have already been created inside main. write a statement or statements, to be added to main, that will determine if the lengths of the three strings are in order by length, smallest to largest. that is, your code should determine if s is strictly shorter than t, and if t is strictly shorter than w. if these conditions hold your code should print (the boolean value) true. if not, your code should print false. (strictly means: no ties) example: if s, t, and w are "cat", "hats", and "skies" your code should print true - their lengths are 3-4-5; but if s, t, and w are "cats" "shirt", and "trust", then print false - their lengths are 4-5-5 enter your code in the box below
Answers: 2
image
Computers and Technology, 23.06.2019 13:00, jaelynnm
Donnie does not have powerpoint. which method would be best for elana to save and share her presentation as is? a pdf a doc an rtf a ppt
Answers: 3
Do you know the correct answer?
ProgrammingAssignment3 Project Goals
Please Code using C
The goal of this project is to...

Questions in other subjects:

Konu
Biology, 31.08.2019 08:10
Konu
Biology, 31.08.2019 08:10