1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
const2013 [10]
3 years ago
14

ABC Resort and Hotel has approached you to write a program to keep track of the number of rooms needed for an event. Customers c

an request any one of the following types of rooms to be reserved. Because the hotel has limited rooms available for a given event, it can only reserve up to 39 rooms. However, the hotel does not know how many rooms, in total, will be reserved because the rooms are reserved on demand.
Create a program for use by the hotel staff to take reservation orders for rooms for an event. All events are single night stay events. So you do not need to worry about the number of nights they are staying. An order occurs when the user enters a room type by name (e.g. Single). Until the user has indicated they are finished entering room types, continue to prompt the user to enter a room type. You must validate the room type, providing an error message and re-prompting the user if an invalid room type is entered. Keep track of the number of rooms that will be reserved for each room type.

Room Type Price/per night
Single $79.95
Single Deluxe $99.95
Double $149.95
Double Deluxe $179.95

Once the user has indicated they are finished entering room types, display a well-formatted report containing a list of each room type with its associated price, the number of rooms needed for that room type, the total revenue from all rooms for the event, and the average revenue from a room for the event.
Your solution must demonstrate the concept of one-dimensional arrays.
Solution Design:
1) Create a defining diagram that shows the input, processing, and output.
2) Create a solution algorithm using pseudocode.
3) Show testing using the desk checking table method, to include test data, expected results, and a desk checking table. Make sure your desk checking considers multiple cases including both valid and invalid test data to prove your algorithm will work in all cases.
Computers and Technology
1 answer:
nexus9112 [7]3 years ago
5 0

Answer:

Check the explanation

Explanation:

/ Pseudocode for tracking the reservation of rooms for an event

Declaration

 

  string roomInput;

  string roomNames[4];

  number roomPrice[4];

  number roomCount[4];

  number i;

  boolean roomFound;

  number totalRevenue, avgRevenue;

  number totalRoomsNeeded;

Start

 

  // initialize the room names, and price for each room

  // array index starts from 0 and goes to n-1 where n is the total number of elements in the array

  roomNames[0] = "Single";

  roomNames[1] = "Single Deluxe";

  roomNames[2] = "Double";

  roomNames[3] = "Double Deluxe";

 

  roomPrice[0] = 79.95;

  roomPrice[1] = 99.95;

  roomPrice[2] = 149.95;

  roomPrice[3] = 179.95;

 

  // initialize each room count to 0 at the start

  for(i=0;i<4;i++)

  do

      roomCount[i] = 0;

  end for  

 

  // input the room type, user should type exit to indicate they are done

  Display "Enter room type ('exit' to quit ) : ";

  Input roomInput;

 

  // loop that continues till user types quit

  while(roomInput != "quit")

  do  

      roomFound = false;

      // loop to determine if user input is valid and increment the associated room count

      for(i=0;i<4;i++)

      do

          if(roomNames[i] == roomInput) then

              roomCount[i] = roomCount[i] + 1;

              roomFound = true;

          end if

      end for

     

      // if invalid room type, display error

      if(roomFound == false) then

          Display "Invalid input for Room type. Room type can be Single or Single Deluxe or Double or Double Deluxe ";

      end if  

     

      Display "Enter room type ('exit' to quit ) : ";

      Input roomInput;

  end while

 

  // set totalRevenue and totalRoomsNeeded to 0

  totalRevenue = 0;

  totalRoomsNeeded = 0;

  Display("Room Type Price($) Rooms Needed");

  // loop to display each room type details and calculate the totalRevenue and totalRoomsNeeded

  for(i=0;i<4;i++)

  do

      Display(roomNames[i],roomPrice[i],roomCount[i])

      totalRevenue = totalRevenue + (roomPrice[i]*roomCount[i]);

      totalRoomsNeeded = totalRoomsNeeded + roomCount[i];

  end for  

 

  // calculate average revenue

  if(totalRoomsNeeded > 0) then

      avgRevenue = totalRevenue/totalRoomsNeeded;

  else

      avgRevenue = 0;

  end if

 

  // display the total revenue and average revenue

  Display("Total revenue from all rooms : $",totalRevenue);

  Display("Average revenue from a room : $",avgRevenue);

 

End  

//end of pseudocode

You might be interested in
All margins of a report are _____ inch. *<br><br> 1<br> 2<br> 3<br> 4
MA_775_DIABLO [31]

Answer:

The answer is "1 inch"

Explanation:

The margin is also known as space, it is the distance between the document 's text and edge. In default, its distance is 1, and it also allows you to customize, the new document, which is set to standard.

  • In other words, we can say that it implies the one-inch gap between the text and each edge, which is based on your specifications.
  • It also allows you to customize the margin size of the document, and other choices were wrong because it is the customize size.

6 0
3 years ago
The variables within the class all are related to help describe the object.
lawyer [7]
This does not make sense
3 0
3 years ago
If you entered data into row 4 and it should be in row 3, you should
jeka94
 the answer in my opinion would have to be B.

3 0
3 years ago
Read 2 more answers
Which exercise can help you prevent Carpel Tunnel Syndrome?
g100num [7]
Make a Fist, hold, and stretch your fingers is the correct answer
8 0
4 years ago
Read 2 more answers
Which of the following statements is false?
maks197457 [2]

Answer: C. Hardware controls software.

Explanation:

It is the software which controls all the functionalities of the hardware. The hardware is the backbone of the system so when a software is being developed it is kept in mind of the hardware it will require to support. We as a client we cannot access the hardware directly, as for using the hardware we need a third party.

Here the third party is the software which make use of the hardware such as ram, memory, registers etc. For example we have a software where we need to perform calculation. So this software will to access the memory and the registers for storing the values. Then the calculations need to be performed in the ALU and then again store the output in the memory.

So, in this way we can say that the software controls the hardware.

6 0
3 years ago
Other questions:
  • Pendant Publishing edits multi-volume manuscripts for many authors. For each volume, they want a label that contains the author'
    14·1 answer
  • ​to add notes or comments, insert a comment tag using the syntax _____.
    5·2 answers
  • You send a report to your boss for feedback and she returns it to you with her edits noted in the electronic file. This Word fea
    11·1 answer
  • Research at least two articles on the topic of managerial issues of a networked organization. Write a brief synthesis and summar
    8·1 answer
  • Which of the following identifies the patterns used for each data series in a chart?
    13·1 answer
  • Which is a circuit board located behind an LCD screen on a laptop?
    7·1 answer
  • Which of these field types allows multiple, non-exclusive options?
    13·1 answer
  • Write the definition of a function isSenior, that receives an integer parameter and returns true if the parameter's value is gre
    13·1 answer
  • Which statement describes how to insert the IF, COUNTIF, or SUM function into a cell?
    11·1 answer
  • How can I call moderator in braily app ???
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!