File input: strings and numbers Use cin to ask the user the name of the file....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
File input: strings and numbers Use cin to ask the user the name of the file. Open the file the user named. Read in two strings (a movie title and a movie snack) and an integer (year the movie was released) from the file. Close the file and print the two string variables. Print the year movie reaches its 100th anniversary. A file to test your lab (right-click or ctrl-click to download): movieinfo.txt Sample Output: What is the name of the file? movieinfo.txt Movie title: Back to the Future The movie will be 100 years old in 2085 Movie snack: popcorn with butter Back to the Future 1985 popcorn with butter File input: strings and numbers Use cin to ask the user the name of the file. Open the file the user named. Read in two strings (a movie title and a movie snack) and an integer (year the movie was released) from the file. Close the file and print the two string variables. Print the year movie reaches its 100th anniversary. A file to test your lab (right-click or ctrl-click to download): movieinfo.txt Sample Output: What is the name of the file? movieinfo.txt Movie title: Back to the Future The movie will be 100 years old in 2085 Movie snack: popcorn with butter Back to the Future 1985 popcorn with butter
Expert Answer:
Answer rating: 100% (QA)
Here is the C code to implement the program as described include include include using namespace std ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Modify the program above to ask the user to enter floating-point values and store them in double variables. Compare the outputs of the two programs for some inputs of your choice. Are the results the...
-
Name it Biggest Losses. Have a column named 1985 Opening Price, one column named 2003 closing price. Compute the range of the stocks, then sort them to determine the company with the greatest loss....
-
A student runs an experiment to test four different popcorn brands, recording the number of kernels left un popped. She pops measured batches of each brand 4 times, using the same popcorn popper and...
-
In the Young's double slit experiment, interference fringes are formed using Na-light of 589 nm and 589.5 nm. Obtain the region on the screen where the fringe pattern will disappear. You may assume...
-
The data below was obtained from a creep test performed at room temperature on a wire composed of 40% tin, 60% lead, and solid core solder. This was done by measuring the increase in strain over time...
-
bright corperation has a line of credit with trust company bank allowing bc to borrow up to 300000 at annual interest rate of 6.5%
-
Modifying default configurations to improve security is called a. encryption hardening b. patching dialing c. hardening d. war dialing
-
Rockwell Company has three operating divisions. Gross margin computations for these three divisions for 2012 are given below. Rockwell has determined that its total manufacturing overhead cost of...
-
As discussed in our reading this week, suppliers consider the market that they and their customers operate in when setting prices. Using the table that follows, find the market structure that...
-
Alice J. and Bruce M. Byrd are married taxpayers who file a joint return. Their Social Security numbers are 123-45-6784 and 111-11-1113, respectively. Alices birthday is September 21, 1974, and...
-
The enthalpy of hydrogenation of benzene is -49.8 kcal/mol while its resonance energy is 37.8 kcal/mol. The magnitude of enthalpy of hydrogenation of cyclohexene in Kcal/ mol is? Backspace 7 8 9 4 5...
-
The steel industry has always been considered the bedrock for economic growth and development. The steel sector in the Middle East and North Africa (MENA) region has witnessed major transformations...
-
The U.S. macroeconomy has experienced many booms and recessions since the beginning of the 20 th century, and perhaps in pursuant of the Employment Act of 1946, the federal government has implemented...
-
A land yacht is a low mass three-wheeled wind-powered vehicle with a sail. Suppose you are in the desert, observing a land yacht race. Consider your location to be the origin. When a particular land...
-
In our market-directed economy, producers provide goods and services that consumers demand as long as they can collect the selling price and can make a profit. However, there are some products and...
-
Consider Country A that produces a large amount of chicken, keeping part of them for local consumption and exporting the surplus amount of chicken to other countries. Due to increasing price of...
-
You do 90 J of work on a gas in a cylinder that maintains a constant pressure of 1 atm, and the container initially had a volume of 1L, then what is the new volume of the container?
-
Sue Deliveau opened a software consulting firm that immediately paid $2,000 for a computer. Was this event a transaction for the business?
-
Matthew borrows $250,000 to invest in bonds. During 2012, his interest on the loan is $30,000. Matthew's interest income from the bonds is $10,000. This is Matthew's only investment income. a....
-
Marty is a sales consultant. Marty incurs the following expenses related to entertainment of his clients in 2012: Dues to a country club......................................................$4,500...
-
Larry Gaines, age 42, sells his personal residence on November 12, 2012, for $144,000. He lived in the house for 7 years. The expenses of the sale are $10,500, and he has made capital improvements of...
-
Match the concept listed in items 1 through 6 with the most appropriate description listed in items a through \(f\). Description Concept 1. Enterprise Resource Planning (ERP) a. system 2. Brands of...
-
Indicate which type of data analytics, 1 through 4, is described in each of the following statements, a through \(h\). Data Analytics 1. Descriptive analytics 2. Diagnostic analytics 3. Predictive...
-
Match each item in the value chain, 1 through 7 , with an impact of an artificial intelligence initiative, choosing from items a through g. Value Chain 1. Research and development 2. Design 3. Supply...
Study smarter with the SolutionInn App