subject

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.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
Your task this week is to write a very simple spam classifier in python. it will classify messages as either spam (unwanted) or ham (wanted). the program will have a set of spam_words, words that are known to appear in spam messages. that set is included in the template file spam.pypreview the document. you will also define a spam threshold which reflects the allowed percentage of spam words in the message. you'll compute a 'spam indicator', which is the ratio of spam words to the total number of unique words in the message. if the spam indicator exceeds the spam threshold, the message is classified as spam. otherwise it is classified as ham. we'll assume that the spam threshold is a constant and has a value of 0.10. your program will prompt the user for a message and then will print the corresponding spam indicator with two decimal digits and the corresponding classification (spam or ham). the program will be case insensitive. the spam words are detected whether they are in lower case or upper case or mixed case. each word, spam or not, is counted once (even if it appears multiple times in the message.) the program will remove punctuation from the message before identifying the words and computing the spam indicator. for example '! ' must be identified as the spam word 'now'.
Answers: 3
question
Computers and Technology, 23.06.2019 14:30
The option enables you to modify a slide element in most presentation applications.
Answers: 2
question
Computers and Technology, 24.06.2019 06:30
Adrawing that places all lines parallel to the z axis at an angle from the horizon is 99 ! a. an oblique drawing b. a perspective drawing c. an auxiliary view d. a one-point perspective drawing
Answers: 2
question
Computers and Technology, 24.06.2019 10:00
Each time you save a document, you will need to type in the file type in which it should be saved you can select the save button to save it with the same file name if it has been previously saved you will need to select the location to save the file you will need to use the save as dialog box
Answers: 1
You know the right answer?
ProgrammingAssignment3 Project Goals
Please Code using C
The goal of this project is to...
Questions
question
Physics, 28.01.2021 06:40
question
History, 28.01.2021 06:40
question
English, 28.01.2021 06:40
question
Chemistry, 28.01.2021 06:40
question
Biology, 28.01.2021 06:40
question
Chemistry, 28.01.2021 06:40
Questions on the website: 13722367