Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++



It''s that spooky time of year when the dead walk the Earth, things go bump in the night, and the
Centers for Disease Control (CDC) recognizes the need for zombie preparedness
(http://www.cdc.gov/phpr/zombies.htm). See also http://www.cdc.gov/phpr/_media/cymkPrint/11_225700_A_Zombie_Final.pdf
Like the CDC, we computer scientists must also plan for dire times. We may even be forced to behave as the ''Cycle Sluts'' did in the cult classic ‘Chopper Chicks in Zombietown’
(http://en.wikipedia.org/wiki/Chopper_Chicks_in_Zombietown ). A movie that yours truly even tried out for a part in (as a zombie, not a chopper chick), but I digress.
Regardless, in such dire times, we may be forced to rely upon our circle of friends to get us through. Assuming that you actually have a circle of friends and that your friends and family are not the same and that you probably have a list of business associates (dentist, car insurance agent, etc) and that you may even have a list of former friends (that you want to avoid like the plague - because all they want is to borrow money, or have become zombies!) you might find that a doubly-linked FAT would prove useful to manage your circle of friends. So, for this homefun assignment, let''s write one! Just in case the end really is nigh…
Note the figure below:
* For what we are about to code next, we must enter quietly into the realm of genius.
Our directory (an array of structs) must contain a string (char[42]) for the name of the “circle” and and int pointing to the starting point in the FAT. You can fix the directory at length 10 (no need for malloc/calloc). Our FAT (an array of structs) must contain two strings (char[42] and char[8]) for the name of the person, their phone number, and two ints pointing to the next block and the previous block. Note in the figure that a negative previous block tells you what entry in the directory you should refer too. You can fix the FAT at length 100 (no need for malloc/calloc).

* Compile! Do you hear me? Give my code... LIFE!
To populate your circle of friends open the hw7.data file and read in the contents. The file format is as follows:
circle_membership name phone_number op_code
For example:
Family Vlad 2181234 a
Family Cullen 2615555 a
Friends Morticia 2357879 a
Friends Ophelia 2339001 a
Enemies Smurf 2615595 a
Search Morticia 2357878 q
The circle_membership will be a string. The name will be a string. The phone number will be a string (e.g. 7774013). The op_code will be a character (‘a’, ‘d’, ‘q’), where ‘a’ indicates that you should add this person to the FAT (and possibly add the circle_membership to the directory), ‘d’ indicates that you should delete this person from the FAT (and possibly the circle_membership from the directory), ‘q’ indicates a query and means that you need to traverse the list and find all other persons who belong to this person’s circle_membership and print their names and phone numbers. Note that actions requiring a query will have the circle_membership set to search.
* Ah! You do not know the weight and length of the assignment you bear yourself! It is as full and as long as HW6 and you will labor on it these next fourteen eves. It is a wondrous assignment. Ohhhh, it is a ponderous assignment!
For example: What do you do when you are inserting the first name of a circle? What about when you are deleting the last name of a circle? What about deleting a non-existing entry? What about querying a non-existing entry? Test your code for all of these cases.
You also need to provide output that proves your program works. After the last data item has been processed, your program must display the text “DIRECTORY” followed by the contents of the Directory (array index, circle name and start block) where each entry is on a separate line. In addition your program is only to print output for directory entries that have actual data. Follow this output by a blank line. Your program must then display the text “FAT” followed by the contents of the FAT (array index, name, phone, previous, next – in this order!) where each entry is on a separate line. In addition your program is only to print output for FAT entries that have actual data.

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M9513903

Have any Question?


Related Questions in C/C++

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As