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...
-
Compare your motivations to behave ethically with those listed in Figure. Do the reasons given in that figure agree with your personal assessment? Discuss the similarities and differences between...
-
The uniform 30-kg bar OB is secured to the accelerating frame in the 30 position from the horizontal by the hinge at O and roller at A. If the horizontal acceleration of the frame is a = 20 m/s 2 ,...
-
Refer to Exercise 4.2. (a) Determine the cumulative probability distribution \(F(x)\). (b) Graph the probability distribution of \(f(x)\) as a bar chart and below it graph \(F(x)\). Data From...
-
The Pension Trust Fund maintained by the City of Linden had the following transactions during 2012. Record each transaction in the Pension Trust Fund. Ignore any other funds that may be involved in a...
-
In your opinion, how does financial aid contribute to student success in the for-profit and not-for-profit institutions? Is there any value in viewing the higher education industry from a business...
-
Which series has the highest beta. BraveNewCoin Liquid Index for Bitcoin 1D BNC Trading Brave Ne Yellow Green Blue Orange
-
A firm currently operates a machine that was purchased at a cost of $200,000 two years ago. It has a current market value of $135,000. A new improved version of the equipment is now on the market at...
-
Consider your use of social media and your career development. How separate are these two activities? Identify ways you could utilize social media for your development and for your enhancement.
-
With a group of four or five students, determine which workplace rights or benefits illegal immigrant employees and regular employees share, and which ones employees who are citizens or legal...
-
The Internet is having a pervasive impact on how organizations manage their human resources. How has the Internet impacted HR management? What would you consider the most significant impact? Justify...
-
According to one observer, not too long ago professional employees bragged about their long hours and disdained overtime pay as the mark of a clock-watcher. The class is divided into teams of five....
-
A lot of the growth in the HR practices over the past four decades can be attributed to its crucial role in keeping a company out of trouble with the law. Why has this become such a difficult task?
-
7) Let a be the integral part of 2 e of a - b +. late the value of a-b- 1 2-3 and b the decimal part (0 < b < 1). Calcu-
-
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...
-
Calculate the evolution operator for the interaction picture in the case in exercise 4. Data From Exercise 4:- Consider a harmonic oscillator perturbed by \(H_{1}=\lambda\left(a+a^{\dagger}...
-
Write down the time evolution equation for Heisenberg operators, calculating explicitly the evolution Hamiltonian, in the case of a free particle, and then calculate explicit expressions for...
-
Write down the time evolution operator and the differential equation that it satisfies for a onedimensional particle in a potential \(V(x)\).
Study smarter with the SolutionInn App