Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The input file has white space and $, the code must read all. There is a file of a few movies (in more or less

The input file has white space and $, the code must read all. There is a file of a few movies (in more or less random order) that contains the following data: Date of release, Movie name, Production cost, Gross profit Your assignment is: for each movie, 1. Without changing the data, read in the Date of release, the Movie name, the Production cost and the Gross profit for all of the movies and put the information into an array of structs (or classes). 2. Sort the array of movies by Movie Name alphabetically 3. Print the array of movies with a heading. The fields should be printed in the following order: Movie Name, Release Date, Production cost and Gross profit 4. Sort the array of movies by Gross profit 3. Print the array of movies with a heading. The fields should be printed in the following order: Movie Name, Production cost, Gross profit and Release Date 

Click here to see the Input File

Jan 25, 1970 MASH $3,025,000 $81,600,000 Aug 5, 1983 The Star Chamber $8,000,000 $5,555,305 Oct 2, 1977 Julia $7,840,000 $20,714,400 May 25, 1979 Alien $11,000,000 $104,931,801 June 3, 1988 Big $18,000,000 $151,668,774 Dec 25, 1992 Hoffa $35,000,000 $29,302,121 Nov 1, 1996 Romeo + Juliet $14,500,000 $147,554,999 April 9, 1999 Never Been Kissed $25,000,000 $84,565,230 Dec 15, 1974 Young Frankenstein $2,780,000 $86,273,333 Dec 27, 1991 Naked Lunch $18,000,000 $2,641,357 May 17, 1974 Dirty Mary Crazy Larry $1,140,000 $28,401,735 March 2, 1979 Norma Rae $4,500,000 $22,228,000 Nov 26, 1997 Alien Resurrection $75,000,000 $161,295,658 Sept 23, 1970 Tora! Tora! Tora! $25,485,000 $29,548,291 June 21, 1991 Dying Young $26,000,000 $82,264,675 June 15, 1979 Butch and Sundance: The Early Days $9,000,000 $2,260,000 Aug 12, 1974 Harry and Tonto $980,000 $4,600,000 July 31, 1992 Buffy the Vampire Slayer $7,000,000 $16,624,456 March 19, 1982 Porky's $500,000 $111,289,673 July 17, 1981 Zorro, The GayS Blade $12,600,000 $5,100,000 June 19, 1998 The X-Files: Fight the Future $66,000,000 $189,176,423 Feb 15, 1985 Turk 182 $15,000,000 $3,594,997 Nov 16, 1990 Home Alone $18,000,000 $476,684,675 Nov 2, 1990 Frankenstein Unbound $11,500,000 $334,748 Nov 20, 1992 Home Alone 2: Lost in New York $20,000,000 $358,994,850 Oct 15, 1993 The Beverly Hillbillies $25,000,000 $57,405,220 July 2, 1996 Independence Day $75,000,000 $817,400,891 Dec 12, 1997 Home Alone 3 $32,000,000 $79,082,515 Sept 24, 1972 Sounder $900,000 $16,889,761 June 30, 1972 Conquest of the Planet of the Apes $1,700,000 $9,700,000 Dec 11, 1985 The Jewel of the Nile $25,000,000 $96,773,200 March 27, 1998 The Newton Boys $27,000,000 $10,452,012 July 20, 1984 Revenge of the Nerds $6,000,000 $60,400,000 July 10, 1987 Revenge of the Nerds II $10,000,000 $30,063,289 May 21, 1975 French Connection II $4,340,000 $12,484,444 Nov 22, 1991 For the Boys $40,000,000 $23,202,444 Dec 25, 1977 High Anxiety $4,015,000 $31,063,038 June 24, 1970 Myra Breckinridge $5,385,000 $4,000,000 Nov 24, 1993 Mrs. Doubtfire $25,000,000 $441,286,195 Sept 26, 1997 Soul Food $7,500,000 $43,700,855 Dec 23, 1990 Come See the Paradise $15,000,000 $947,306 Dec 11, 1987 Wall Street $15,000,000 $43,848,100 May 25, 1977 Star Wars $11,000,000 $775,398,007 May 19, 1999 Star Wars Episode I: The Phantom Menace $115,000,000 $1,027,044,677 Nov 5, 1982 The Man from Snowy River $3,000,000 $17,228,160 July 19, 1985 The Man with One Red Shoe $16,000,000 $8,645,411 Dec 17, 1999 Anna and the King $92,000,000 $113,996,937 June 19, 1981 The Cannonball Run $18,000,000 $72,179,579 Dec 8, 1989 The War of the Roses $50,000,000 $160,188,546 July 4, 1990 Die Hard 2 $70,000,000 $240,031,094 Nov 14, 1997 Anastasia $53,000,000 $139,804,348 July 27, 1973 The Last American Hero $2,130,000 $1,250,000 March 27, 1974 Conrack $2,370,000 $2,000,000 Sept 30, 1994 The Scout $20,000,000 $2,694,234 Dec 7, 1990 Edward Scissorhands $20,000,000 $86,024,005 June 17, 1970 Beyond the Valley of the Dolls $2,090,000 $9,000,000 Aug 15, 1980 Willie & Phil $5,500,000 $4,400,000 Feb 19, 1999 Office Space $10,000,000 $10,827,810 June 15, 1973 Battle for the Planet of the Apes $1,710,000 $8,844,595 May 21, 1971 Escape from the Planet of the Apes $2,060,000 $12,348,905 Oct 1, 1993 Freaked $12,000,000 $29,296 Dec 25, 1998 The Thin Red Line $52,000,000 $98,126,565 December 19, 1997 Titanic $200,000,000 $2,185,372,302 March 29, 1970 The Sicilian Clan $4,170,000 $1,000,000 Feb 18, 1983 The King of Comedy $19,000,000 $2,536,242 Feb 8, 1991 Sleeping with the Enemy $19,000,000 $174,999,005 June 20, 1980 Brubaker $9,000,000 $37,121,708 April 5, 1976 The Blue Bird $12,000,000 $3,500,000 Aug 15, 1986 The Fly $9,000,000 $60,629,159 April 2, 1970 Patton $12,625,000 $61,749,765 June 21, 1985 Cocoon $17,500,000 $85,313,124 Nov 23, 1988 Cocoon: The Return $17,500,000 $18,924,919 March 6, 1987 Raising Arizona $6,000,000 $22,847,564 Dec 21, 1988 Working Girl $28,600,000 $102,953,112 March 1, 1975 At Long Last Love $5,140,000 $2,500,000 Jan 21, 1970 The Only Game in Town $10,235,000 $1,500,000 Sept 26, 1975 The Rocky Horror Picture Show $1,400,000 $175,000,000 April 21, 1995 Kiss of Death $40,000,000 $14,942,422 May 23, 1973 Emperor of the North Pole $3,705,000 $2,000,000 Nov 7, 1979 The Rose $9,250,000 $29,174,648 Dec 13, 1972 The Poseidon Adventure $4,700,000 $93,300,000 Jan 17, 1986 The Boy in Blue $7,700,000 $275,000 Dec 18, 1973 Cinderella Liberty $2,465,000 $3,700,000 May 26, 1976 Mother, Jugs & Speed $3,220,000 $7,630,000 June 16, 1976 Silent Movie $4,055,000 $36,145,695 July 17, 1992 Man Trouble $30,000,000 $4,096,030 June 12, 1981 History of the World, Part I $10,000,000 $31,672,908 Dec 14, 1983 Silkwood $10,000,000 $35,615,609 July 18, 1986 Aliens $18,500,000 $131,060,248 July 6, 1988 License to Drive $8,000,000 $22,433,275 Dec 14, 1980 Tribute $8,000,000 $4,000,000 May 26, 1970 Beneath the Planet of the Apes $4,675,000 $18,999,718 Oct 21, 1977 Damnation Alley $8,000,000 $4,000,000 Dec 19, 1980 Nine to Five $10,000,000 $103,290,500 Jan 9, 1998 Firestorm $19,000,000 $8,165,212 April 1, 1976 The Duchess and the Dirtwater Fox $4,590,000 $4,120,000 April 10, 1992 FernGully: The Last Rainforest $22,000,000 $32,710,894 June 30, 1995 Mighty Morphin Power Rangers: The Movie $15,000,000 $66,433,194 June 26, 1998 Doctor Dolittle $70,500,000 $294,456,605 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 12c SQL

Authors: Joan Casteel

3rd edition

1305251032, 978-1305251038

More Books

Students also viewed these Databases questions

Question

5. Have you any experience with agile software development?

Answered: 1 week ago