Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This homework is about Process/Thread Synchronization. PLEASE label your answer

ID: 3592567 • Letter: T

Question

This homework is about Process/Thread Synchronization. PLEASE label your answer a) and b) so I know which one is which. Also keep the code simple as you can. Thanks!!!

3. Consider simulating a roller coaster amusement ride with one car of capacity CAPACITY passengers. The passengers arrive, wait until the car is ready for boarding, then board (one by one). When the roller coaster car is full, it leaves for the ride. When it returns, the passengers leave the car (no leaving in the middle of the ride!). When all passengers have left the car, new passengers can start boarding a) Is it possible that a passenger enjoys the ride before the roller coaster car has left (that is prints the message before the ride starts)? If no, justify why. If yes, correct the code - you may need to introduce a new semaphore or so. (No need to fully rewrite the code here, you may write/insert into the code provided on the next page.) b) Assume there are VIPs who would also like to take a ride. However a VIP is so important and has bodyguards, so he/she will use 5 spaces instead of 1. Moreover, VIPs don't like to wait: if VIP boards, the roller coaster car should leave even if it is nowhere near full. If there are less then 5 spaces left, the VIP cannot fit and the roller coaster car must leave (without the VIP) so it returns sooner and the VIP does not wait unnecessarily. Your task: Write the code for the VIP. Make sure that even if there are plenty of waiting passengers and the VIP process boards the roller coaster car first (assume that the VIP process has the same scheduling priority as the other processes).

Explanation / Answer

Table Design 101

THE ANNOYANCE: I’ve heard that I’m supposed to “normalize” my tables, but the books that discuss this are really confusing. “Primary keys,” “foreign keys"…what are they talking about? And “Boyce-Codd normal form” sounds like a disease. Why do I need an advanced degree to create a simple contacts database?

THE FIX: Normalizing basically means organizing data to reduce redundancy. As the esteemed Webopedia (http://www.pcwebopedia.com) pithily puts it, it involves “dividing a database into two or more tables and defining relationships between the tables. The objective is to isolate data so that additions, deletions, and modifications of a field can be made in just one table and then propagated through the rest of the database via the defined relationships.”

Such well-designed tables are essential to maintaining data integrity and the long-term health of your database. They also make a big difference in performance as your database grows. Fortunately, you can leave the theoretical stuff to the experts; following a few simple rules will suffice for most needs. The essence of data normalization is just this: pull out repeating and reusable items and put them in their own, separate tables.

Some table-design rules to follow:

Split up your data by topic. Think of tables as file folders in a filing cabinet. Identify the main topic headings for your data, and create tables for each distinct topic. For example, if you were running a business, you wouldn’t file your customer data in the same folder with suppliers’ addresses and price lists, nor would you mix accounts payable with receivables. Apply the same organizational logic to the information you plan to store in your Access database.

OK, that sounds sensible enough, but when it comes time to do it it’s hard to know where to start. For instance, you have a customers table (see Figure 3-1), but what data should be stored there? Orders, billing addresses, shipping addresses, phone numbers, everything? That’s where the other data normalization rules come in.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote