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 »
files are attached


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 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 array 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 b) 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 Rob { double length=7.5; double width=5.3; double height=2.95; } using std::cout; using std::endl; #define nmsp Rob 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;="" return="" 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,="" b)="" 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="" wallpaper="" 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="" narrower="" 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="" rather="" than="" used="" to="" partially="" cover="" the="" next="" strip.="" there="" are="" the="" following="" rounding="" function="" that="" you="" may="" consider="" for="" use:="" ceil(),="" floor()="" and="" round().="" 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,="" bitwise="" “and”="" between="" the="" variables,="" bitwise="" “or”="" between="" the="" variables,="" bitwise="" “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="" your="" results="" 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 correctly 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 "sorry". 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 array of 10 numbers of type double. then a. prints all the numbers from the first one to the last one b. 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). b. 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 array 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 array 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. harry, the it director at cld hospital, is responsible for managing the network. mr. harry 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 current 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. harry mentions that users have complained of slow access to the servers. he also hands your team a table with .="" 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="" correctly="" 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="" "sorry".="" 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="" array="" of="" 10="" numbers="" of="" type="" double.="" then="" a.="" prints="" all="" the="" numbers="" from="" the="" first="" one="" to="" the="" last="" one="" b.="" 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).="" b.="" 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="" array="" 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="" array="" 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.="" harry,="" the="" it="" director="" at="" cld="" hospital,="" is="" responsible="" for="" managing="" the="" network.="" mr.="" harry="" 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="" current="" 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.="" harry="" mentions="" that="" users="" have="" complained="" of="" slow="" access="" to="" the="" servers.="" he="" also="" hands="" your="" team="" a="" table="">
Answered Same DayMar 25, 2021

Answer To: Coursework – _Programming Assignment and In-Class Test A. Core Coursework Assignment – _Hotel...

Meenakshi answered on Apr 01 2021
141 Votes
Cld Hospital Case Study Solution
Executive Summary
This report we study and analysis the Cld hospital network system .The current network system have single router that router working based on RIP protocol version 1.
The current network system router is connected with ten segments.
The advantage of RIPv1 protocol is sharing the routing information with the help of local bro
adcasts (Thomas,n.d).The RIPv1 having issue related with authentication and VLSM.
This current 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 current network lots of issue therefore speed of network is slow .
The hospital current 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 current network is important for hospital The hospital staff working depend on current 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:
Current IP Addresses of the Hospital
Hospital current 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 current 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 current 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 current problem the Cisco is the best option for future growth and budget.
There are different type of switches.
We will do more analysis of current network IT requirement. Then we got the optimal solutions of current 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 current network topology is Class C type. The current 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