Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Coursework – _Programming Assignment and In-Class Test A. Core Coursework Assignment – _Hotel Program: 1. Using incremental development, design a program for a hotel with 10 rooms using an array where...

1 answer below »
Coursework – _Programming Assignment and In-Class Test
A. Core Coursework Assignment – _Hotel Program:
1.    Using incremental development, design a program for a hotel with 10 rooms using an a
ay where each entry is the name of the main customer while the index represents the room number. Your code should allow the user to view the status of all rooms, to add a customer to a room as well as to initialise each room to empty by storing a specific character – say “e”.
Once the basic code runs, then put the code that ‘Views All rooms’ and ‘Adds customer to room’, into separate procedures, and test how it works. Then add a menu system, which allow the user to choose what they want to select. Enter an ‘I’ to initialise, an ‘A’ to add a customer to a room, and a ‘V’ to view all rooms. When an ‘A’ is pressed, it should do the Add procedure, or a ‘V’ should do the View procedure and so on.

B. Extras:
2.    One by one, add extra procedures to do each of the following. The user should be able to choose from the menu below what the program does.
E: Display Empty rooms,
D: Delete customer from room,
F: Find room from customer name,
S: Store program data in to file,
L: Load program data from file.
O: View rooms Ordered alphabetically by the main customer’s name.
3.    Create a second version of the program using hotel room a
ay of structs and/or objects.

Problem 1
Write a programme that defines two different namespaces (you can use the names of teammembers). Within each namespace define three variables:
double width;
double height;
double length;
and initialise them accordingly to the sizes of the rooms you live in. Use different techniques to print the values to the three variables from one or another namespace. Suggested techniques:
a) Use scope resolution operator :: in front of each variable used
) Use #define directive to change the name of the namespace (as in the example on the next page)
c) use using statement to access the appropriate namespace
Sample programme for solution b):
#include namespace Helen
{
double length(3.5);
double width=2.3;
double height(2.5);
}
namespace Ro
{
double length=7.5;
double width=5.3;
double height=2.95;
}
using std::cout;
using std::endl;
#define nmsp Ro
int main()
{
cout
"The length of the room is "
nmsp::length
endl;
cout
"The width of the room is "
nmsp::width
endl;
cout
"The height of the room is "
nmsp::height;
eturn 0;
}
If time permits:
- use different techniques to format the output
- display information about the area of the floor of the room
- display information about the area of the walls of the room
- calculate and display information about the size of the room in cubic meters.
Problem 2
Write a programme calculating how many rolls of wallpaper is needed to decorate a room.
The programme should ask about and read information:
a) about the size of the room: width, length and height,
) about size of a single roll of wallpaper: width and length
c) if details of calculations should be presented
Then
d) perform all necessary calculations
e) if details of calculations are to be presented the programme should print:
i. total width of all four walls to be wallpapered
ii. the number of stripes of wallpaper needed for this room
iii. the number of stripes that could be obtained from one roll of wallpape
iv. the total number of wallpaper rolls needed for this room
f) if details of calculations are not to be presented the programme should print:
i. the total number of wallpaper rolls needed for this room
Use appropriate rounding up or down of various numbers to make sure that:
g) If a piece of wallpaper is used to cover the a gap that is na
ower than the width of
the wallpaper the remaining stripe is discarded rather then used
h) If a reminder of a roll is shorter than the height of the room then it is also discarded
ather than used to partially cover the next strip.
There are the following rounding function that you may consider for use: ceil(), floor() and
ound(). Type the name of the function in the text of your programme and press F1 to get
help information.
Problem 3.
Write a programme that declares two unsigned short variables and then reads their values
and shows the result of calculating:
the reminder of dividing one by another,
itwise “and” between the variables,
itwise “or” between the variables,
itwise “exclusive or” between the variables
shifting leftwards one of the variables by one, two, and three bits.
Check the programme results by performing manual calculations and making sure that you
esults are the same as those produced by the programme
Problem 4
Write two programmes that have the same functionality, i.e. they read two int numbers ?
and ?, and then calculate either:
the sum of all even numbers between ? and ? when ? < ?.
the sum of all number between ? and ? when ? ≤ ?
The first programme should be using a “for” loop to accomplish this task while the second
one should use the “while” loop.
None of the numbers ? or ? should be less than −10,000 or greater than 10,000. Request
the user to enter any of these numbers again if the value entered is from outside the
permitted range.
Problem 5.
Write a programme that reads two double numbers and then requests the code of
operation to be performed on these numbers. The operation should be either +, -, * or /.
Then it performs the operation and prints the result. If the operation code is not entered
co
ectly the programme should ask for it again but no more than three times. After three
attempts it should inform the user that the code was not entered properly and the
programme should terminate.
Problem 6
Write C++ code that prints out whether or not a thrill-seeking person standing in line for a roller coaster should be allowed on the ride. A pregnant person (usually she is a woman) is not allowed on the roller coaster. Additionally, an altitudinally-challenged (i.e., a short) person is not allowed on a roller coaster if the person is shorter than 48 inches.
If the person is not allowed on the ride, output the string "So
y".
Otherwise, output the string "OK: have fun!". Assume the following variables have been defined and initialized to the person's height and state of pregnancy:
int height;
holds the person's height in inches.
int is_pregnant;
is true if the person is pregnant.
Problem 7
Write a programme that reads an a
ay of 10 numbers of type double. Then
a. Prints all the numbers from the first one to the last one
. Prints the first, third and the last number
c. Prints all the numbers from the last to the first one
d. Prints every second number starting with the second read
e. Calculates and prints the average of all numbers
f. Calculates and prints the average of all non‐negative numbers.
Problem 8
Write a programme that reads three double numbers A, B and C.
a. Then it uses a pointer to access the values of each of the numbers and then prints each of them (still using the pointer).
. It calculates and prints the sum of the three numbers (still with use of the pointer)
Problem 9
A. Write a programme that takes as input a text file and prints its contents on the screen.
B. Write two collaborating programmes. The first one stores a sequence of numbers of type double in a binary format that are typed in by the user. The second programme opens the file, determines how many double numbers are stored in the file and then reads them into dynamically allocated memory block of suitable size and also prints them on the screen.
Problem 10
A. Write a function that prints a line of 20 stars:
********************
Use this function to print your name between two lines of stars. Put your name at the centre of the area marked by the stars. E.g.
********************
John Smith
********************
B. Write a function that takes two input parameters and does not return any value. The first parameter states how many times your name should be printed on the screen and the second one how many empty lines should be left between two consecutive printouts of your name. Both parameters should be of type int. In the main programme prepare a short dialogue with the user to let them decide the actual values of the parameters of your function.
C. Write two versions of a function calculating factorial of an integer number. The definition of the factorial is:
0! = 1
n! = (n-1)! ×n
Therefore:
0! =1,
1!=1,
2!=2,
3!=6,
4!=24 etc.
The first programme should calculate the factorial using a loop. The second version should use the recursive call where the factorial function calls itself with the decremented value of the argument.
Use this function to calculate factorials of selected numbers. The function should return unsigned long long number.
Problem 11.
The database storing collection of your books uses the records represented by the following Structure
struct a_Book
{
char Title[30];
char Author[30];
unsigned PublicationYear;
bool NotReadYet;
}
1. Write a programme that declares a variable of the type a_Book, initialises it and prints the values of all three its elements on the screen;
2. Write a programme that declares an a
ay of length 2 of variables of type a_Book, initialises both of them and prints them on the screen.
3. Write a programme that dynamically allocates memory to an a
ay to N variables of type a_Book, where N is a number entered by the user. Then the programme prompts the user to enter data for each book and prints it on the screen. Allow the user to have the data written to the disk before terminating the programme.

Scenario: Cld Hospital
Mr. Ha
y, the IT director at Cld Hospital, is responsible for managing the network. Mr. Ha
y has requested your help in proposing a network solution that will meet the hospital’s requirements. The hospital is growing (of course), and the management has released funds for network improvements.
Existing network:
The cu
ent network has ten segments that are connected to a single router which also serves the Internet. The router is running Routing Information Protocol Version 1 (RIPv1). The back-end new servers are located in the same segment as those used on floor 1. Mr. Ha
y mentions that users have complained of slow access to the servers. He also hands your team a table with
Answered Same Day Mar 25, 2021

Solution

Meenakshi answered on Apr 01 2021
143 Votes
Cld Hospital Case Study Solution
Executive Summary
This report we study and analysis the Cld hospital network system .The cu
ent network system have single router that router working based on RIP protocol version 1.
The cu
ent network system router is connected with ten segments.
The advantage of RIPv1 protocol is sharing the routing information with the help of local
oadcasts (Thomas,n.d).The RIPv1 having issue related with authentication and VLSM.
This cu
ent network system has 10 segments. The all segments is connected with one router ,that router works for internet also.
The RIPv1 protocol is a Classful Routing.
The hospital cu
ent network lots of issue therefore speed of network is slow .
The hospital cu
ent system is very slow and not satisfy the hospital staff requirement.
The hospital staff having their laptop and they prefer to connected medical instrument with own laptop .This cu
ent network is important for hospital The hospital staff working depend on cu
ent network . Patient medical report , X-Ray report , daily patient data adaptation is important for patient treatment. The slow network some time creating an issue at the time of data access by medical staff.
Review the IP Address:
Cu
ent IP Addresses of the Hospital
Hospital cu
ent IP Address network topology all 6 floor IP network offers 255 Class C IP addresses. The first floor as follows
1)    The allotted IP address (Class C) range from 192.168.1.0 192.168.1.255
2)    The total number of system in first floor 65 systems
3)    The number of 189 addresses wasted
Recommend how switching speed can be increased:
After the hospital cu
ent network analysis our recommendation would be hospital must change their switches .The new network system must be implemented Cisco switch to increase the speed.
The cu
ent network switches replace with modular switches.
We did study and analysis the top five network switches vendors .Our decision is based on hospital structure and their requirement. We did compare the top five switches vendor
Our recommendation according to hospital cu
ent problem the Cisco is the best option for future growth and budget.
There are different type of switches.
We will do more analysis of cu
ent network IT requirement. Then we got the optimal solutions of cu
ent network problem
Level    IP Network    No. of Servers    No. of Clients
1    192.168.1.0/24        15    60
2    192.168.2.0/24        0    50
3    192.168.3.0/24        0    42
4    192.168.4.0/24        0    33
5    192.168.5.0/24        0    39
6    192.168.6.0/24        0    20
7    192.168.7.0/24        0    58
8    192.168.8.0/24        0    55
9    192.167.9.0/24        0    44
10    192.168.10.0/24    0    14
New IP Addressing Scheme and New Network
Level Network     Starting IP      Last IP     No. of      Default      Subnet
     Address     Address Address     System         Gateway     Mask
1    192.168.1.0    192.168.1.1    192.168.1.254     15 servers    192.168.1.1    255.255.255.0
1    192.168.1.0    192.168.1.1    192.168.1.254     60 clients    192.168.1.1    255.255.255.0
2    192.168.1.0    192.168.1.1    192.168.1.254    50 clients    192.168.1.1    255.255.255.0
3    192.168.1.0    192.168.1.1    192.168.1.254    42clients    192.168.1.1    255.255.255.0
4    192.168.2.0    192.168.2.1    192.168.2.254    33 clients    192.168.2.1    255.255.255.0
5    192.168.2.0    192.168.2.1    192.168.2.254    39clients    192.168.2.1    255.255.255.0
6    192.168.2.0    192.168.2.1    192.168.2.254    20 clients    192.168.2.1    255.255.255.0
7    192.168.2.0    192.168.2.1    192.168.2.254    58 clients    192.168.2.1    255.255.255.0
8    192.168.2.0    192.168.2.1    192.168.2.254    55 clients    192.168.2.1    255.255.255.0
9    192.168.2.0    192.168.2.1    192.168.2.254    44 clients    192.168.2.1    255.255.255.0
10    192.168.2.0    192.168.2.1    192.168.2.254    14 clients    192.168.2.1    255.255.255.0
I The hospital cu
ent network topology is Class C type. The cu
ent network is 24 –bit network prefix. The 3 highest order bits were set to 1-1-0 and this is followed by an 8-bit host number...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here