Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here is the movies.txt file content: The Shawshank Redemption (1994) The Godfather (1972) The Godfather: Part II (1974) Pulp Fiction (1994) The Good the Bad

image text in transcribedimage text in transcribed

Here is the movies.txt file content:

The Shawshank Redemption (1994) The Godfather (1972) The Godfather: Part II (1974) Pulp Fiction (1994) The Good the Bad and the Ugly (1966) The Dark Knight (2008) 12 Angry Men (1957) Schindler's List (1993) The Lord of the Rings: The Return of the King (2003) Fight Club (1999) Star Wars: Episode V - The Empire Strikes Back (1980) The Lord of the Rings: The Fellowship of the Ring (2001) One Flew Over the Cuckoo's Nest (1975) Goodfellas (1990) Inception (2010) Seven Samurai (1954) Star Wars: Episode IV - A New Hope (1977) Forrest Gump (1994) The Matrix (1999) The Lord of the Rings: The Two Towers (2002) City of God (2002) Once Upon a Time in the West (1968) The Silence of the Lambs (1991) Se7en (1995) Casablanca (1942) The Usual Suspects (1995) Raiders of the Lost Ark (1981) Rear Window (1954) It's a Wonderful Life (1946) Psycho (1960) Leon: The Professional (1994) Sunset Blvd (1950) American History X (1998) Memento (2000) Terminator 2: Judgment Day (1991) Apocalypse Now (1979) Saving Private Ryan (1998) City Lights (1931) Dr. Strangelove (1964) Alien (1979) Spirited Away (2001) Gravity (2013) Modern Times (1936) North by Northwest (1959) Back to the Future (1985) Life Is Beautiful (1997) The Pianist (2002) Citizen Kane (1941) The Shining (1980) The Departed (2006) M (1931) Paths of Glory (1957) Vertigo (1958) American Beauty (1999) The Intouchables (2011) Django Unchained (2012) Gladiator (2000) Aliens (1986) The Green Mile (1999) The Dark Knight Rises (2012) Taxi Driver (1976) Double Indemnity (1944) WALLE (2008) The Lives of Others (2006) Toy Story 3 (2010) The Prestige (2006) The Great Dictator (1940) A Clockwork Orange (1971) Amlie (2001) Lawrence of Arabia (1962) To Kill a Mockingbird (1962) Reservoir Dogs (1992) Das Boot (1981) The Treasure of the Sierra Madre (1948) The Lion King (1994) Cinema Paradiso (1988) Once Upon a Time in America (1984) Requiem for a Dream (2000) Star Wars: Episode VI - Return of the Jedi (1983) The Third Man (1949) Eternal Sunshine of the Spotless Mind (2004) Braveheart (1995) Full Metal Jacket (1987) Oldboy (2003) L.A. Confidential (1997) Metropolis (1927) Singin' in the Rain (1952) Chinatown (1974) Some Like It Hot (1959) Rashomon (1950) Amadeus (1984) Monty Python and the Holy Grail (1975) Princess Mononoke (1997) Bicycle Thieves (1948) 2001: A Space Odyssey (1968) All About Eve (1950) The Sting (1973) The Apartment (1960) Unforgiven (1992) Witness for the Prosecution (1957) 

I need a program for this project in C++14

The lab exercise is a simple one: input movie names from a file, and output the total # of movies, the first movie, and the last movie. The input file contains the movie names, one per line there is nothing special at the end. Example: suppose the file moviestxt', contains The Shawshank Redemption (1994) The Godfather (1972) The Godfather: Part Il (1974) Pulp Fiction (1994) The Good the Bad and the Ugly (1966) The Dark Knight (2008) 12 Angry Men (1957) Schindler's List (1993) The Lord of the Rings: The Return of the King (2003) Fight Club (1999) Your program should input the name of the file from the keyboard movies.txt The output from your program should be the # of movies, first movie name, and last movie name 10 The Shawshank Redemption (1994) Fight Club (1999) Cloud9 File Edit Find Under "Labs", open "Week-09", and download the file "movies.txt" - use the "download" button in the upper-right to download the file to your local computer. For c9 users, you need to upload that file to your workspace: "File" menu, select "Upload Local Files...", and then drag-drop the file into your workspace. It should appear in the "cs109" folder along with your main.cpp" file as shown here cs109 main.cpp main.cpp.0 Makefile movies.bxt README The exercise is to write a complete C++ program to perform this task; note that arrays and functions are not required but it's good practice to use them if you want. Assume the input file contains at least 1 movie, and at most 1000 movies. There are two aspects of this exercise that are new... First, since the movies names contain spaces, we cannot use the >>operator to input a movie name. Instead, we must use the C++ getline() function which reads an entire line: string moviename; getline (file, moviename); // read entire line as the movie name

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 Database 19c DBA By Examples Installation And Administration

Authors: Ravinder Gupta

1st Edition

B09FC7TQJ6, 979-8469226970

More Books

Students also viewed these Databases questions

Question

LO5 Illustrate the steps in developing a base pay system.

Answered: 1 week ago

Question

LO3 Outline strategic compensation decisions.

Answered: 1 week ago