Question
Convert LongWord.java to the equivalent C program named longword.c. While you are converting it into C, make following changes: file read and write: read lines
Convert LongWord.java to the equivalent C program named longword.c. While you are converting it into C, make following changes:
file read and write: read lines from standard input and print the results to standard output
string return in getLongestWord: take a pointer to a pre-allocated buffer and save the longest word in it. Hint: your function will look like void getLongestWord( const char line[], char word[] )
That is, your converted C program should continuously read lines from standard input, find the longest word using the function getLongestWord, and print the results to standard output. The program ends when it hits EOF. Make sure that your converted C program generates the same output to the Java programs.
LongWord.java :
import java.io.BufferedReader; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter;
public class LongWord {
public static void main( String[] args ) { BufferedReader fileIn = null; PrintWriter fileOut = null; String inputLine; String longWord; int lineCount = 0; try { fileIn = new BufferedReader( new FileReader( "cat_wiki.txt" ) ); fileOut = new PrintWriter( new FileWriter( "out.txt" ) ); inputLine = fileIn.readLine( ); while( inputLine != null ) { lineCount++; longWord = getLongestWord( inputLine ); if( longWord.length( ) > 0 ) { fileOut.println( "Line #" + lineCount + ": " + longWord ); } inputLine = fileIn.readLine( ); } fileIn.close( ); fileOut.close( ); } catch( IOException ex ) { System.out.println( ex.getMessage( ) ); ex.printStackTrace( ); } finally { if( fileIn != null ) { try { fileIn.close( ); } catch( IOException ex ) { // Ignore. Errors should be already handled above } } if( fileOut != null ) { fileOut.close( ); } } }
public static String getLongestWord( String line ) { String longest = ""; int longestLength = 0; String current = ""; int currentLength = 0; int pos = 0; char ch; while( pos < line.length( ) ) { ch = line.charAt( pos ); if( ch == ' ' || ch == '\t' || ch == ' ' || ch == ' ' ) { if( currentLength > longestLength ) { longest = current; longestLength = currentLength; } current = ""; currentLength = 0; } else if( (ch == '\'' || ch == '-') && pos > 0 && Character.isLetter( line.charAt( pos - 1 ) ) && pos < line.length( ) - 1 && Character.isLetter( line.charAt( pos + 1 ) ) ) { current += ch; } else { current += ch; currentLength++; } pos++; } if( currentLength > longestLength ) { longest = current; longestLength = currentLength; } return longest; } }
cat_wiki.txt :
Retrieved from https://en.wikipedia.org/wiki/Cat on January 5, 2018
INTRODUCTION
The domestic cat[1][5] (Felis silvestris catus or Felis catus) is a small, typically furry, carnivorous mammal. They are often called house cats[6] when kept as indoor pets or simply cats when there is no need to distinguish them from other felids and felines. They are often valued by humans for companionship and for their ability to hunt vermin. There are more than seventy cat breeds recognized by various cat registries.
Cats are similar in anatomy to the other felids, with a strong flexible body, quick reflexes, sharp retractable claws, and teeth adapted to killing small prey. Cat senses fit a crepuscular and predatory ecological niche. Cats can hear sounds too faint or too high in frequency for human ears, such as those made by mice and other small animals. They can see in near darkness. Like most other mammals, cats have poorer color vision and a better sense of smell than humans. Cats, despite being solitary hunters, are a social species and cat communication includes the use of a variety of vocalizations (mewing, purring, trilling, hissing, growling, and grunting), as well as cat pheromones and types of cat-specific body language.[7]
Cats have a high breeding rate.[8] Under controlled breeding, they can be bred and shown as registered pedigree pets, a hobby known as cat fancy. Failure to control the breeding of pet cats by neutering, as well as the abandonment of former household pets, has resulted in large numbers of feral cats worldwide, requiring population control.[9] In certain areas outside cats' native range, this has contributed, along with habitat destruction and other factors, to the extinction of many bird species. Cats have been known to extirpate a bird species within specific regions and may have contributed to the extinction of isolated island populations.[10] Cats are thought to be primarily responsible for the extinction of 33 species of birds, and the presence of feral and free-ranging cats makes some otherwise suitable locations unsuitable for attempted species reintroduction.[11]
Since cats were venerated in ancient Egypt, they were commonly believed to have been domesticated there,[12] but there may have been instances of domestication as early as the Neolithic from around 9,500 years ago (7,500 BC).[13] A genetic study in 2007[14] concluded that all domestic cats are descended from Near Eastern wildcats, having diverged around 8,000 BC in the Middle East.[12][15] A 2016 study found that leopard cats were undergoing domestication independently in China around 5,500 BC, though this line of partially domesticated cats leaves no trace in the domesticated populations of today.[16][17] A 2017 study confirmed that domestic cats are descendants of those first domesticated by farmers in the Near East around 9,000 years ago.[18][19]
As of a 2007 study, cats are the second most popular pet in the US by number of pets owned, behind freshwater fish.[20] In a 2010 study they were ranked the third most popular pet in the UK, after fish and dogs, with around 8 million being owned.[21]
TAXONOMY AND EVOLUTION
The domestic cat is believed to have evolved from the Near Eastern wildcat, whose range covers vast portions of the Middle East westward to the Atlantic coast of Africa.[22][23] Between 70,000 and 100,000 years ago the animal gave rise to the genetic lineage that eventually produced all domesticated cats,[24] having diverged from the Near Eastern wildcat around 8,000 BC in the Middle East.[12][15]
The felids are a rapidly evolving family of mammals that share a common ancestor only 1015 million years ago[25] and include lions, tigers, cougars and many others. Within this family, domestic cats (Felis catus) are part of the genus Felis, which is a group of small cats containing about seven species (depending upon classification scheme).[1][26] Members of the genus are found worldwide and include the jungle cat (Felis chaus) of southeast Asia, European wildcat (F. silvestris silvestris), African wildcat (F. s. lybica), the Chinese mountain cat (F. bieti), and the Arabian sand cat (F. margarita), among others.[27]
The domestic cat was first classified as Felis catus by Carl Linnaeus in the 10th edition of his Systema Naturae published in 1758.[1][2] Because of modern phylogenetics, domestic cats are usually regarded as another subspecies of the wildcat, F. silvestris.[1][28][29] This has resulted in mixed usage of the terms, as the domestic cat can be called by its subspecies name, Felis silvestris catus.[1][28][29] Wildcats have also been referred to as various subspecies of F. catus,[29] but in 2003, the International Commission on Zoological Nomenclature fixed the name for wildcats as F. silvestris.[30] The most common name in use for the domestic cat remains F. catus. Sometimes, the domestic cat has been called Felis domesticus[31] as proposed by German naturalist J.C.P. Erxleben in 1777,[32] but these are not valid taxonomic names and have been used only rarely in scientific literature.[33] A population of Transcaucasian black feral cats was once classified as Felis daemon (Satunin 1904) but now this population is considered to be a part of domestic cat.[34]
All the cats in this genus share a common ancestor that is believed to have lived around 67 million years ago in the Near East (the Middle East).[35] The exact relationships within the Felidae are close but still uncertain,[36][37] e.g. the Chinese mountain cat is sometimes classified (under the name Felis silvestris bieti) as a subspecies of the wildcat, like the North African variety F. s. lybica.[28][36]
In comparison to dogs, cats have not undergone major changes during the domestication process, as the form and behavior of the domestic cat is not radically different from those of wildcats and domestic cats are perfectly capable of surviving in the wild.[38][39] Fully domesticated house cats often interbreed with feral F. catus populations,[40] producing hybrids such as the Kellas cat. This limited evolution during domestication means that hybridisation can occur with many other felids, notably the Asian leopard cat.[41] Several natural behaviors and characteristics of wildcats may have predisposed them for domestication as pets.[39] These traits include their small size, social nature, obvious body language, love of play and relatively high intelligence.[42]:12-17 Several small felid species may have an inborn tendency towards tameness.[39]
Cats have either a mutualistic or commensal relationship with humans. Two main theories are given about how cats were domesticated. In one, people deliberately tamed cats in a process of artificial selection as they were useful predators of vermin.[43] This has been criticized as implausible, because the reward for such an effort may have been too little; cats generally do not carry out commands and although they do eat rodents, other species such as ferrets or terriers may be better at controlling these pests.[28] The alternative idea is that cats were simply tolerated by people and gradually diverged from their wild relatives through natural selection, as they adapted to hunting the vermin found around humans in towns and villages.[28]
NOMENCLATURE AND ETYMOLOGY
The origin of the English word cat (Old English catt) and its counterparts in other Germanic languages (such as German Katze), descended from Proto-Germanic *katton-, is controversial. It has traditionally thought to be a borrowing from Late Latin cattus "domestic cat", from catta (used around 75 AD by Martial),[44][45] compare also Byzantine Greek ??tta, Portuguese and Spanish gato, French chat, Maltese qattus, Lithuanian kate, and Old Church Slavonic kot? (kotka), among others.[46] The Late Latin word is generally thought to originate from an Afro-Asiatic language, but every proposed source word has presented problems. Many references refer to "Berber" (Kabyle) kaddka "wildcat" and "Nubian kadis" as possible sources or cognates, but M. Lionel Bender says the Nubian term is a loan from Arabic ?????? qi??a.[47] Jean-Paul Savignac suggests the Latin word is from an Egyptian precursor of Coptic ??? (u) "tomcat" or its feminine form suffixed with -t,[48] but John Huehnergard says "the source [...] was clearly not Egyptian itself, where no analogous form is attested."[47] Huehnergard opines it is "equally likely that the forms might derive from an ancient Germanic word, imported into Latin and thence to Greek and to Syriac and Arabic". Guus Kroonen also considers the word to be native to Germanic (due to morphological alternations) and Northern Europe, and suggests that it might ultimately be borrowed from Uralic, cf. Northern Sami gadfe "female stoat" and Hungarian hgy "stoat; lady, bride" from Proto-Uralic *kw "female (of a fur animal)".[49] In any case, cat is a classic case of a Wanderwort.
An alternative word is English puss (extended as pusy and pusycat). Attested only from the 16th century, it may have been introduced from Dutch poes or from Low German puuskatte, related to Swedish kattepus, or Norwegian pus, pusekatt. Similar forms exist in Lithuanian pui and Irish puis or puisc. The etymology of this word is unknown, but it may have simply arisen from a sound used to attract a cat.[50][51]
A group of cats is referred to as a clowder or a glaring,[52] a male cat is called a tom or tomcat[53] (or a gib,[54] if neutered), an unaltered female is called a queen,[55] and a juvenile cat is referred to as a kitten. The male progenitor of a cat, especially a pedigreed cat, is its sire,[56] and its female progenitor is its dam.[57] In Early Modern English, the word kitten was interchangeable with the now obsolete word catling.[58]
A pedigreed cat is one whose ancestry is recorded by a cat fancier organization. A purebred cat is one whose ancestry contains only individuals of the same breed. Many pedigreed and especially purebred cats are exhibited as show cats. Cats of unrecorded, mixed ancestry are referred to as domestic short-haired or domestic long-haired cats, by coat type, or commonly as random-bred, moggies (chiefly British), or (using terms borrowed from dog breeding) mongrels or mutt-cats.
While the African wildcat is the ancestral subspecies from which domestic cats are descended, and wildcats and domestic cats can completely interbreed (being subspecies of the same species), several intermediate stages occur between domestic pet and pedigree cats on one hand and entirely wild animals on the other. The semiferal cat, a mostly outdoor cat, is not owned by any one individual, but is generally friendly to people and may be fed by several households. Feral cats are associated with human habitation areas and may be fed by people or forage for food, but are typically wary of human interaction.[40]
BIOLOGY
ANATOMY
Domestic cats are similar in size to the other members of the genus Felis, typically weighing between 4 and 5 kg (9 and 10 lb).[36] Some breeds, such as the Maine Coon, can occasionally exceed 11 kg (24 lb). Conversely, very small cats, less than 2 kg (4 lb), have been reported.[59] The world record for the largest cat is 21 kg (50 lb).[60] The smallest adult cat ever officially recorded weighed around 1 kg (2 lb).[60] Feral cats tend to be lighter as they have more limited access to food than house cats. In the Boston area, the average feral adult male will weigh 4 kg (9 lb) and average feral female 3 kg (7 lb).[61] Cats average about 2325 cm (910 in) in height and 46 cm (18 in) in head/body length (males being larger than females), with tails averaging 30 cm (12 in) in length.[62]
Cats have seven cervical vertebrae, as do almost all mammals; 13 thoracic vertebrae (humans have 12); seven lumbar vertebrae (humans have five); three sacral vertebrae like most mammals (humans have five); and a variable number of caudal vertebrae in the tail (humans retain three to five caudal vertebrae, fused into an internal coccyx).[63]:11 The extra lumbar and thoracic vertebrae account for the cat's spinal mobility and flexibility. Attached to the spine are 13 ribs, the shoulder, and the pelvis.[63] :16 Unlike human arms, cat forelimbs are attached to the shoulder by free-floating clavicle bones which allow them to pass their body through any space into which they can fit their head.[64]
The cat skull is unusual among mammals in having very large eye sockets and a powerful and specialized jaw.[65]:35 Within the jaw, cats have teeth adapted for killing prey and tearing meat. When it overpowers its prey, a cat delivers a lethal neck bite with its two long canine teeth, inserting them between two of the prey's vertebrae and severing its spinal cord, causing irreversible paralysis and death.[66] Compared to other felines, domestic cats have narrowly spaced canine teeth, which is an adaptation to their preferred prey of small rodents, which have small vertebrae.[66] The premolar and first molar together compose the carnassial pair on each side of the mouth, which efficiently shears meat into small pieces, like a pair of scissors. These are vital in feeding, since cats' small molars cannot chew food effectively, and cats are largely incapable of mastication.[65]:37 Although cats tend to have better teeth than most humans, with decay generally less likely because of a thicker protective layer of enamel, a less damaging saliva, less retention of food particles between teeth, and a diet mostly devoid of sugar, they are nonetheless subject to occasional tooth loss and infection.[67]
Cats, like dogs, are digitigrades. They walk directly on their toes, with the bones of their feet making up the lower part of the visible leg.[68] Cats are capable of walking very precisely because, like all felines, they directly register; that is, they place each hind paw (almost) directly in the print of the corresponding fore paw, minimizing noise and visible tracks. This also provides sure footing for their hind paws when they navigate rough terrain. Unlike most mammals, when cats walk, they use a "pacing" gait; that is, they move the two legs on one side of the body before the legs on the other side. This trait is shared with camels and giraffes. As a walk speeds up into a trot, a cat's gait changes to be a "diagonal" gait, similar to that of most other mammals (and many other land animals, such as lizards): the diagonally opposite hind and fore legs move simultaneously.[69]
Like almost all members of the Felidae, cats have protractable and retractable claws.[70] In their normal, relaxed position, the claws are sheathed with the skin and fur around the paw's toe pads. This keeps the claws sharp by preventing wear from contact with the ground and allows the silent stalking of prey. The claws on the fore feet are typically sharper than those on the hind feet.[71] Cats can voluntarily extend their claws on one or more paws. They may extend their claws in hunting or self-defense, climbing, kneading, or for extra traction on soft surfaces. Most cats have five claws on their front paws, and four on their rear paws.[72] The fifth front claw (the dewclaw) is proximal to the other claws. More proximally is a protrusion which appears to be a sixth "finger". This special feature of the front paws, on the inside of the wrists, is the carpal pad, also found on the paws of big cats and dogs. It has no function in normal walking, but is thought to be an antiskidding device used while jumping. Some breeds of cats are prone to polydactyly (extra toes and claws).[72] These are particularly common along the northeast coast of North America.[73]
PHYSIOLOGY
Cats are familiar and easily kept animals, and their physiology has been particularly well studied; it generally resembles those of other carnivorous mammals, but displays several unusual features probably attributable to cats' descent from desert-dwelling species.[31] For instance, cats are able to tolerate quite high temperatures: Humans generally start to feel uncomfortable when their skin temperature passes about 38 (100 ), but cats show no discomfort until their skin reaches around 52 (126 ),[65]:46 and can tolerate temperatures of up to 56 (133 ) if they have access to water.[74]
Cats conserve heat by reducing the flow of blood to their skin and lose heat by evaporation through their mouths. Cats have minimal ability to sweat, with glands located primarily in their paw pads,[76] and pant for heat relief only at very high temperatures[77] (but may also pant when stressed). A cat's body temperature does not vary throughout the day; this is part of cats' general lack of circadian rhythms and may reflect their tendency to be active both during the day and at night.[78]:1 Cats' feces are comparatively dry and their urine is highly concentrated, both of which are adaptations to allow cats to retain as much water as possible.[31] Their kidneys are so efficient, they can survive on a diet consisting only of meat, with no additional water,[79] and can even rehydrate by drinking seawater.[80][78]:29While domestic cats are able to swim, they are generally reluctant to enter water as it quickly leads to exhaustion.[81]
NUTRITION
Cats are obligate carnivores: their physiology has evolved to efficiently process meat, and they have difficulty digesting plant matter.[31] In contrast to omnivores such as rats, which only require about 4% protein in their diet, about 20% of a cat's diet must be protein.[31] A cat's gastrointestinal tract is adapted to meat eating, being much shorter than that of omnivores and having low levels of several of the digestive enzymes needed to digest carbohydrates.[82] These traits severely limit the cat's ability to digest and use plant-derived nutrients, as well as certain fatty acids.[82] Despite the cat's meat-oriented physiology, several vegetarian or vegan cat foods have been marketed that are supplemented with chemically synthesized taurine and other nutrients, in attempts to produce a complete diet. However, some of these products still fail to provide all the nutrients cats require,[83] and diets containing no animal products pose the risk of causing severe nutritional deficiencies.[84] However, veterinarians in the United States have expressed concern that many domestic cats are overfed.[85]
Cats do eat grass occasionally. A proposed explanation is that cats use grass as a source of folic acid. Another is that it is used to supply dietary fiber, helping the cat defecate more easily and expel parasites and other harmful material through feces and vomit.[86]
Cats are unusually dependent on a constant supply of the amino acid arginine, and a diet lacking arginine causes marked weight loss and can be rapidly fatal.[87] Arginine is an essential additive in cat food because cats have low levels of the enzymes aminotransferase and pyrroline-5-carboxylate which are responsible for the synthesis of ornithine and citrulline in the small intestine.[88] Citrulline would typically go on to the kidneys to make arginine, but because cats have a deficiency in the enzymes that make it, citrulline is not produced in adequate quantities to make arginine. Arginine is essential in the urea cycle in order to convert the toxic component ammonia into urea that can then be excreted in the urine. Because of its essential role, deficiency in arginine results in a build up of toxic ammonia and leads to hyperammonemia.[88] The symptoms of hyperammonemia include lethargy, vomiting, ataxia, hyperesthesia and can be serious enough to induce death and coma in a matter of days if a cat is being fed a arginine free diet. The quick onset of these symptoms is due to the fact that diets devoid in arginine will typically still contain all of the other amino acids, which will continue to be catabolized by the body producing mass amounts of ammonia that very quickly build up with no way of being excreted.
Another unusual feature is that the cat cannot produce taurine, with a deficiency in this essential amino acid causing macular degeneration, wherein the cat's retina slowly breaks down, causing irreversible blindness.[31] This is due to the hepatic activity of cystinesulfinic acid decarboxylase being low in cats.[89] This limits the ability of cats to biosynthesize the taurine they need from its precursor amino acids ethionine and cysteine, which ultimately results in inadequate taurine production needed for normal function.[89] Deficiencies in taurine result in compensated function of feline cardiovascular and reproductive systems.[89] These abnormalities can also be accompanied by developmental issues in the central nervous system along with degeneration of the retina.[89]
In order to produce the essential vitamin niacin for use in the cat, tryptophan is needed for conversion purposes. However, due to a competing pathway with acetyl coenzyme A (acetyl-CoA), niacin can become deficient and require supplementation.[90] This process occurs when an overactive enzyme, picolinic acid carboxylase, converts the vitamin B6 precursor picolinic acid into the alternate compound acetyl-CoA, instead of converting quinolinate into nictotinic acid mononlucleotide (niacin).[91] Niacin is required in cats as it supports enzyme function. If niacin is deficient in the diet, anorexia, weight loss and an increase in body temperature can result.[92]
Preformed vitamin A is required in the cat for retinal and reproductive health. Vitamin A is considered to be a fat-soluble vitamin and is seen as essential in a cat's diet. Normally, the conversion of beta-carotenes into vitamin A occurs in the intestine (more specifically the mucosal layer) of species, however cats lack the ability to undergo this process.[90] Both the kidney and liver are contributors to the use of vitamin A in the body of the majority of species while the cats liver does not produce the enzyme Beta-carotene 15,15'-monooxygenase which converts the beta-carotene into retinol (vitamin A).[93] To summarize: cats do not have high levels of this enzyme leading to the cleavage and oxidation of carotenoids not taking place.[91]
Vitamin D3 is a dietary requirement for cats as they lack the ability to synthesize vitamin D3 from sunlight.[94] Cats obtain high levels of the enzyme 7-dehydrocholestrol delta 7 reductase which causes immediate conversion of vitamin D3 from sunlight to 7-dehydrocholesterol.[95] This fat soluble vitamin is required in cats for bone formation through the promotion of calcium retention, along with nerve and muscle control through absorption of calcium and phosphorus.[95]
Cats, like all mammals, need to get linoleic acid, an essential fatty acid, from their diet. Most mammals can convert linoleic acid to arachidonic acid, as well as the omega 3 fatty acids (eicosapentaenoic acid and docosahexaenoic acid) through the activity of enzymes, but this process is very limited in cats.[90] The ?6-desaturase enzyme eventually converts linoleic acid, which is in its salt form linoleate, to arachidonate (salt form of arachidonic acid) in the liver, but this enzyme has very little activity in cats.[90] This means that arachidonic acid is an essential fatty acid for cats as they lack the ability to create required amounts of linoleic acid. Deficiency of arachidonic acid in cats is related to problems in growth, can cause injury and inflammation to skin (e.g. around the mouth) decreased platelet aggregation, fatty liver, increase in birth defects of kittens whose queens were deficient during pregnancy, and reproductive failure in queens.[90] Arachidonic acid can also be metabolized to eicosanoids that create inflammatory responses which are needed to stimulate proper growth and repair mechanisms in the cat.[96]
The nutrient chart provides a list of the many nutrients cats require as well as the use of the nutrients in the body and the effects of the deficiency.
SENSES
Cats have excellent night vision and can see at only one-sixth the light level required for human vision.[65]:43 This is partly the result of cat eyes having a tapetum lucidum, which reflects any light that passes through the retina back into the eye, thereby increasing the eye's sensitivity to dim light.[97] Another adaptation to dim light is the large pupils of cats' eyes. Unlike some big cats, such as tigers, domestic cats have slit pupils.[98] These slit pupils can focus bright light without chromatic aberration, and are needed since the domestic cat's pupils are much larger, relative to their eyes, than the pupils of the big cats.[98] At low light levels a cat's pupils will expand to cover most of the exposed surface of its eyes.[99] However, domestic cats have rather poor color vision and (like most nonprimate mammals) have only two types of cones, optimized for sensitivity to blue and yellowish green; they have limited ability to distinguish between red and green.[100] A 1993 paper reported a response to middle wavelengths from a system other than the rods which might be due to a third type of cone. However, this appears to be an adaptation to low light levels rather than representing true trichromatic vision.[101]
Cats have excellent hearing and can detect an extremely broad range of frequencies. They can hear higher-pitched sounds than either dogs or humans, detecting frequencies from 55 Hz to 79,000 Hz, a range of 10.5 octaves, while humans and dogs both have ranges of about 9 octaves.[102][103] Cats can hear ultrasound, which is important in hunting[104] because many species of rodents make ultrasonic calls.[105] However, they do not communicate using ultrasound like rodents do. Cats' hearing is also sensitive and among the best of any mammal,[102] being most acute in the range of 500 Hz to 32 kHz.[106] This sensitivity is further enhanced by the cat's large movable outer ears (their pinnae), which both amplify sounds and help detect the direction of a noise.[104]
Cats have an acute sense of smell, due in part to their well-developed olfactory bulb and a large surface of olfactory mucosa, about 5.8 cm2 (0.90 in2) in area, which is about twice that of humans.[107] Cats are sensitive to pheromones such as 3-mercapto-3-methylbutan-1-ol,[108] which they use to communicate through urine spraying and marking with scent glands.[109] Many cats also respond strongly to plants that contain nepetalactone, especially catnip, as they can detect that substance at less than one part per billion.[110] About 7080% of cats are affected by nepetalactone.[111] This response is also produced by other plants, such as silver vine (Actinidia polygama) and the herb valerian; it may be caused by the smell of these plants mimicking a pheromone and stimulating cats' social or sexual behaviors.[112]
Cats have relatively few taste buds compared to humans (470 or so versus more than 9,000 on the human tongue).[113] Domestic and wild cats share a gene mutation that keeps their sweet taste buds from binding to sugary molecules, leaving them with no ability to taste sweetness.[114] Their taste buds instead respond to amino acids, bitter tastes, and acids.[115] Cats and many other animals have a Jacobson's organ located in their mouths that allows them to taste-smell certain aromas in a way of which humans have no experience. Cats also have a distinct temperature preference for their food, preferring food with a temperature around 38 (100 ) which is similar to that of a fresh kill and routinely rejecting food presented cold or refrigerated (which would signal to the cat that the "prey" item is long dead and therefore possibly toxic or decomposing).[113]
To aid with navigation and sensation, cats have dozens of movable whiskers (vibrissae) over their body, especially their faces. These provide information on the width of gaps and on the location of objects in the dark, both by touching objects directly and by sensing air currents; they also trigger protective blink reflexes to protect the eyes from damage.[65]:47
Most breeds of cat have a noted fondness for settling in high places, or perching. In the wild, a higher place may serve as a concealed site from which to hunt; domestic cats may strike prey by pouncing from a perch such as a tree branch, as does a leopard.[116] Another possible explanation is that height gives the cat a better observation point, allowing it to survey its territory. During a fall from a high place, a cat can reflexively twist its body and right itself using its acute sense of balance and flexibility.[117] This is known as the cat righting reflex. An individual cat always rights itself in the same way, provided it has the time to do so, during a fall. The height required for this to occur is around 90 cm (3.0 ft). Cats without a tail (e.g. Manx cats) also have this ability, since a cat mostly moves its hind legs and relies on conservation of angular momentum to set up for landing, and the tail is little used for this feat.[118]
HEALTH
The average lifespan of pet cats has risen in recent years. In the early 1980s, it was about seven years,[119]:33[120] rising to 9.4 years in 1995[119]:33 and 1215 years in 2014.[121][unreliable source?] However, cats have been reported as surviving into their 30s,[122] with the oldest known cat, Creme Puff, dying at a verified age of 38.[123]
Spaying or neutering increases life expectancy: one study found neutered male cats live twice as long as intact males, while spayed female cats live 62% longer than intact females.[119]:35 Having a cat neutered confers health benefits, because castrated males cannot develop testicular cancer, spayed females cannot develop uterine or ovarian cancer, and both have a reduced risk of mammary cancer.[124]
Despite widespread concern about the welfare of free-roaming cats, the lifespans of neutered feral cats in managed colonies compare favorably with those of pet cats.[125]:45[126]:1358 [127][128][129][130]
DISEASES
A wide range of health problems may affect cats, including infectious diseases, parasites, injuries, and chronic disease. Vaccinations are available for many of these diseases, and domestic cats are regularly given treatments to eliminate parasites such as worms and fleas.[131]
POISONING
In addition to obvious dangers such as rodenticides, insecticides, and herbicides, cats may be poisoned by many chemicals usually considered safe by their human guardians,[132] because their livers are less effective at some forms of detoxification than those of many other animals, including humans and dogs.[31][133] Some of the most common causes of poisoning in cats are antifreeze and rodent baits.[134] Cats may be particularly sensitive to environmental pollutants.[132][135] When a cat has a sudden or prolonged serious illness without any obvious cause, it has possibly been exposed to a toxin.
Many human medicines should never be given to cats. For example, the painkiller paracetamol (or acetaminophen, sold as Tylenol and Panadol) is extremely toxic to cats: even very small doses need immediate treatment and can be fatal.[136][137] Even aspirin, which is sometimes used to treat arthritis in cats, is much more toxic to them than to humans[137] and must be administered cautiously.[132] Similarly, application of minoxidil (Rogaine) to the skin of cats, either accidentally or by well-meaning guardians attempting to counter loss of fur, has sometimes been fatal.[138] Essential oils can be toxic to cats and cases have been reported of serious illnesses caused by tea tree oil, including flea treatments and shampoos containing it.[139]
Other common household substances that should be used with caution around cats include mothballs and other naphthalene products.[132] Phenol-based products (e.g. Pine-Sol, Dettol/Lysol or hexachlorophene)[132] are often used for cleaning and disinfecting near cats' feeding areas or litter boxes, but these can sometimes be fatal.[140] Ethylene glycol, often used as an automotive antifreeze, is particularly appealing to cats, and as little as a teaspoonful can be fatal.[141] Some human foods are toxic to cats; for example chocolate can cause theobromine poisoning, although (unlike dogs) few cats will eat chocolate.[142] Large amounts of onions or garlic are also poisonous to cats.[132] Many houseplants are also dangerous,[143] such as Philodendron species and the leaves of the Easter lily (Lilium longiflorum), which can cause permanent and life-threatening kidney damage.[144]
GENETICS
The domesticated cat and its closest wild ancestor are both diploid organisms that possess 38 chromosomes[145] and roughly 20,000 genes.[146] About 250 heritable genetic disorders have been identified in cats, many similar to human inborn errors.[147] The high level of similarity among the metabolism of mammals allows many of these feline diseases to be diagnosed using genetic tests that were originally developed for use in humans, as well as the use of cats as animal models in the study of the human diseases.[148][149]
BEHAVIOR
Outdoor cats are active both day and night, although they tend to be slightly more active at night.[150][151] The timing of cats' activity is quite flexible and varied, which means house cats may be more active in the morning and evening, as a response to greater human activity at these times.[152] Although they spend the majority of their time in the vicinity of their home, housecats can range many hundreds of meters from this central point, and are known to establish territories that vary considerably in size, in one study ranging from 7 to 28 hectares (1769 acres).[151]
Cats conserve energy by sleeping more than most animals, especially as they grow older. The daily duration of sleep varies, usually between 12 and 16 hours, with 13 and 14 being the average. Some cats can sleep as much as 20 hours. The term "cat nap" for a short rest refers to the cat's tendency to fall asleep (lightly) for a brief period. While asleep, cats experience short periods of rapid eye movement sleep often accompanied by muscle twitches, which suggests they are dreaming.[153]
SOCIABILITY
Although wildcats are solitary, the social behavior of domestic cats is much more variable and ranges from widely dispersed individuals to feral cat colonies that form around a food source, based on groups of co-operating females.[154][155] Within such groups, one cat is usually dominant over the others.[33] Each cat in a colony holds a distinct territory, with sexually active males having the largest territories, which are about 10 times larger than those of female cats and may overlap with several females' territories.[109] These territories are marked by urine spraying, by rubbing objects at head height with secretions from facial glands, and by defecation.[109] Between these territories are neutral areas where cats watch and greet one another without territorial conflicts. Outside these neutral areas, territory holders usually chase away stranger cats, at first by staring, hissing, and growling, and if that does not work, by short but noisy and violent attacks. Despite some cats cohabiting in colonies, they do not have a social survival strategy, or a pack mentality, and always hunt alone.[156]
However, some pet cats are poorly socialized. In particular, older cats may show aggressiveness towards newly arrived kittens, which may include biting and scratching; this type of behavior is known as feline asocial aggression.[157]
Though cats and dogs are often characterized as natural enemies, they can live together if correctly socialized.[158]
Life in proximity to humans and other domestic animals has led to a symbiotic social adaptation in cats, and cats may express great affection toward humans or other animals. Ethologically, the human keeper of a cat may function as a sort of surrogate for the cat's mother,[159] and adult housecats live their lives in a kind of extended kittenhood,[160] a form of behavioral neoteny. The high-pitched sounds housecats make to solicit food may mimic the cries of a hungry human infant, making them particularly hard for humans to ignore.[161]
COMMUNICATION
Domestic cats use many vocalizations for communication, including purring, trilling, hissing, growling/snarling, grunting, and several different forms of meowing.[7] (By contrast, feral cats are generally silent.)[162]:208 Their types of body language, including position of ears and tail, relaxation of the whole body, and kneading of the paws, are all indicators of mood. The tail and ears are particularly important social signal mechanisms in cats;[163][164] for example, a raised tail acts as a friendly greeting, and flattened ears indicates hostility. Tail-raising also indicates the cat's position in the group's social hierarchy, with dominant individuals raising their tails less often than subordinate animals.[164] Nose-to-nose touching is also a common greeting and may be followed by social grooming, which is solicited by one of the cats raising and tilting its head.[155]
Purring may have developed as an evolutionary advantage as a signalling mechanism of reassurance between mother cats and nursing kittens. Post-nursing cats often purr as a sign of contentment: when being petted, becoming relaxed,[165][166] or eating. The mechanism by which cats purr is elusive. The cat has no unique anatomical feature that is clearly responsible for the sound.[167] It was, until recent times, believed that only the cats of the Felis genus could purr. However, felids of the Panthera genus (tiger, lion, jaguar, and leopard) also produce sounds similar to purring, but only when exhaling.[168]
GROOMING
Cats are known for spending considerable amounts of time licking their coat to keep it clean.[169] The cat's tongue has backwards-facing spines about 500 long, which are called papillae. These contain keratin which makes them rigid[170] so the papillae act like a hairbrush. Some cats, particularly longhaired cats, occasionally regurgitate hairballs of fur that have collected in their stomachs from grooming. These clumps of fur are usually sausage-shaped and about 23 cm (0.81.2 in) long. Hairballs can be prevented with remedies that ease elimination of the hair through the gut, as well as regular grooming of the coat with a comb or stiff brush.[169]
FIGHTING
Among domestic cats, males are more likely to fight than females.[171] Among feral cats, the most common reason for cat fighting is competition between two males to mate with a female. In such cases, most fights are won by the heavier male.[172] Another common reason for fighting in domestic cats is the difficulty of establishing territories within a small home.[171] Female cats also fight over territory or to defend their kittens. Neutering will decrease or eliminate this behavior in many cases, suggesting that the behavior is linked to sex hormones.[173]
When cats become aggressive, they try to make themselves appear larger and more threatening by raising their fur, arching their backs, turning sideways and hissing or spitting.[163] Often, the ears are pointed down and back to avoid damage to the inner ear and potentially listen for any changes behind them while focused forward. They may also vocalize loudly and bare their teeth in an effort to further intimidate their opponent. Fights usually consist of grappling and delivering powerful slaps to the face and body with the forepaws as well as bites. Cats also throw themselves to the ground in a defensive posture to rake their opponent's belly with their powerful hind legs.[174]
Serious damage is rare, as the fights are usually short in duration, with the loser running away with little more than a few scratches to the face and ears. However, fights for mating rights are typically more severe and injuries may include deep puncture wounds and lacerations. Normally, serious injuries from fighting are limited to infections of scratches and bites, though these can occasionally kill cats if untreated. In addition, bites are probably the main route of transmission of feline immunodeficiency virus.[175] Sexually active males are usually involved in many fights during their lives, and often have decidedly battered faces with obvious scars and cuts to their ears and nose.[176]
HUNTING AND FEEDING
Cats hunt small prey, primarily birds and rodents,[177] and are often used as a form of pest control.[178][179] Domestic cats are a major predator of wildlife in the United States, killing an estimated 1.43.7 billion birds and 6.920.7 billion mammals annually.[180][181] The bulk of predation in the United States is done by 80 million feral and stray cats. Effective measures to reduce this population are elusive, meeting opposition from cat enthusiasts.[180][181] In the case of free-ranging pets, equipping cats with bells and not letting them out at night will reduce wildlife predation.[177]
Free-fed feral cats and house cats tend to consume many small meals in a single day, although the frequency and size of meals varies between individuals.[156] Cats use two hunting strategies, either stalking prey actively, or waiting in ambush until an animal comes close enough to be captured.[182] Although it is not certain, the strategy used may depend on the prey species in the area, with cats waiting in ambush outside burrows, but tending to actively stalk birds.[183]:153
Perhaps the best known element of cats' hunting behavior, which is commonly misunderstood and often appalls cat owners because it looks like torture, is that cats often appear to "play" with prey by releasing it after capture. This behavior is due to an instinctive imperative to ensure that the prey is weak enough to be killed without endangering the cat.[184] This behavior is referred to in the idiom "cat-and-mouse game" or simply "cat and mouse".
Another poorly understood element of cat hunting behavior is the presentation of prey to human guardians. Ethologist Paul Leyhausen proposed that cats adopt humans into their social group and share excess kill with others in the group according to the dominance hierarchy, in which humans are reacted to as if they are at, or near, the top.[185] Anthropologist and zoologist Desmond Morris, in his 1986 book Catwatching, suggests, when cats bring home mice or birds, they are attempting to teach their human to hunt, or trying to help their human as if feeding "an elderly cat, or an inept kitten".[186][187] Morris's hypothesis is inconsistent with the fact that male cats also bring home prey, despite males having negligible involvement with raising kittens.[183]:153
Domestic cats select food based on its temperature, smell and texture; they dislike chilled foods and respond most strongly to moist foods rich in amino acids, which are similar to meat.[84][156] Cats may reject novel flavors (a response termed neophobia) and learn quickly to avoid foods that have tasted unpleasant in the past.[156] They may also avoid sugary foods and milk. Most adult cats are lactose intolerant; the sugars in milk are not easily digested and may cause soft stools or diarrhea.[156][188] They can also develop odd eating habits. Some cats like to eat or chew on other things, most commonly wool, but also plastic, cables, paper, string, aluminum foil, or even coal. This condition, pica, can threaten their health, depending on the amount and toxicity of the items eaten.[189][190]
Though cats usually prey on animals less than half their size, a feral cat in Australia has been photographed killing an adult pademelon of around the cat's weight at 4 kg (8.8 lb).[191]
Since cats lack lips[192] to create suction, they use a lapping method with the tongue to draw liquid upwards into their mouths. Lapping at a rate of four times a second, the cat touches the smooth tip of its tongue to the surface of the water, and quickly retracts it, drawing water upwards.[193]
PLAY
Domestic cats, especially young kittens, are known for their love of play. This behavior mimics hunting and is important in helping kittens learn to stalk, capture, and kill prey.[194] Cats also engage in play fighting, with each other and with humans. This behavior may be a way for cats to practice the skills needed for real combat, and might also reduce any fear they associate with launching attacks on other animals.[195]
Owing to the close similarity between play and hunting, cats prefer to play with objects that resemble prey, such as small furry toys that move rapidly, but rapidly lose interest (they become habituated) in a toy they have played with before.[196] Cats also tend to play with toys more when they are hungry.[197] String is often used as a toy, but if it is eaten, it can become caught at the base of the cat's tongue and then move into the intestines, a medical emergency which can cause serious illness, even death.[198] Owing to the risks posed by cats eating string, it is sometimes replaced with a laser pointer's dot, which cats may chase.[199]
REPRODUCTION
Female cats are seasonally polyestrous, which means they may have many periods of heat over the course of a year, the season beginning in spring and ending in late autumn. Heat periods occur about every two weeks and last about 4 to 7 days.[200] Multiple males will be attracted to a female in heat. The males will fight over her, and the victor wins the right to mate. At first, the female rejects the male, but eventually the female allows the male to mate. The female utters a loud yowl as the male pulls out of her because a male cat's penis has a band of about 120150 backwards-pointing penile spines, which are about 1 mm long; upon withdrawal of the penis, the spines rake the walls of the female's vagin, which acts to induce ovulation. This act also occurs to clear the vagin of other sperm in the context of a second (or more) mating, thus giving the later males a larger chance of conception.[201]
After mating, the female washes her vulva thoroughly. If a male attempts to mate with her at this point, the female will attack him. After about 20 to 30 minutes, once the female is finished grooming, the cycle will repeat.[200]
Because ovulation is not always triggered by a single mating, females may not be impregnated by the first male with which they mate.[202] Furthermore, cats are superfecund; that is, a female may mate with more than one male when she is in heat, with the result that different kittens in a litter may have different fathers.[200]
At 124 hours after conception, the morula forms. At 148 hours, early blastocysts form. At 1012 days, implantation occurs.[203][204]
The gestation period for cats is between 64 and 67 days, with an average of 66 days.[205] The size of a litter usually is three to five kittens, with the first litter usually smaller than subsequent litters. Kittens are weaned between six and seven weeks old, and cats normally reach sexual maturity at 510 months (females) and to 57 months (males), although this can vary depending on breed.[200] Females can have two to three litters per year, so may produce up to 150 kittens in their breeding span of around ten years.[200]
Cats are ready to go to new homes at about 12 weeks of age,[206] when they are ready to leave their mother. They can be surgically sterilized (spayed or castrated) as early as 7 weeks to limit unwanted reproduction.[207] This surgery also prevents undesirable sex-related behavior, such as aggression, territory marking (spraying urine) in males and yowling (calling) in females. Traditionally, this surgery was performed at around six to nine months of age, but it is increasingly being performed prior to puberty, at about three to six months.[208] In the US, about 80% of household cats are neutered.[209]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started