Book name:Programming Fundamentals Answer the questions below concerning the following fragment of code. int n; cout <
Fantastic news! We've Found the answer you've been seeking!
Question:
Book name:Programming Fundamentals
Transcribed Image Text:
Answer the questions below concerning the following fragment of code. int n; cout << "Enter an integer: "; cin >> n; if (n < 10&&n>0) cout << "less than 10" << endl; else if (n > 5||n>1) cout << "greater than 5" << endl; else cout << "not interesting" << endl; a. What will be the output of the fragment above if the interactive user enters the integer value 1? b. What will be the output of the fragment above if the interactive user enters the integer value 16? What will be the output of the fragment above if the interactive user enters the integer value 8? с. d. What values for n will cause the output of the fragment above to be "not interesting"? Answer the questions below concerning the following fragment of code. int n; cout << "Enter an integer: "; cin >> n; if (n < 10&&n>0) cout << "less than 10" << endl; else if (n > 5||n>1) cout << "greater than 5" << endl; else cout << "not interesting" << endl; a. What will be the output of the fragment above if the interactive user enters the integer value 1? b. What will be the output of the fragment above if the interactive user enters the integer value 16? What will be the output of the fragment above if the interactive user enters the integer value 8? с. d. What values for n will cause the output of the fragment above to be "not interesting"?
Expert Answer:
Answer rating: 100% (QA)
a The output will be less than 10 The if statement uses an AND operator So both of the comparison op... View the full answer
Related Book For
Principles Of Managerial Finance
ISBN: 978-0136119463
13th Edition
Authors: Lawrence J. Gitman, Chad J. Zutter
Posted Date:
Students also viewed these programming questions
-
Name the five PLC programming methods identified in the International Standard for Programmable Controllers (IEC 1131-3).
-
Name four radio station programming formats.
-
Fundamentals explain less of the variation in TRS than in market-valuet-o- book-value or market-value-to-earnings ratios (as measured by the R2 shown in Exhibits 15.7 and 15.10). This holds true even...
-
Evenflow Power Co. is considering a new project that is a little riskier than the current operations of the company. Thus, management has decided to add an additional 1.5% to the company's overall...
-
A random sample of n1 = 650 individuals results in x1 = 156 successes. An independent sample of n2 = 550 individuals results in x2 = 143 successes. Does this represent sufcient evidence to conclude...
-
What is an e-marketplace?
-
The 2014 financial statements of LVMH Moet Hennessey-Louis Vuitton S.A. are presented in Appendix C of this book. LVMH is a Paris-based holding company and one of the worlds largest and best-known...
-
Ware Manufacturing Company produced 2,000 units of inventory in January 2018. It expects to produce an additional 14,000 units during the remaining 11 months of the year. In other words, total...
-
Help me to draw a visual Hydrid Topology for a finacial company
-
Prince Albert Canning PLC had a net loss of 26,832 on sales of 294,813. What was the company's profit margin? Does the fact that these figures are quoted in a foreign currency make any difference?...
-
How much money will the child earn if all 50 cards are sold and the agreed upon $15 is sent back to the company? Suppose a company offered to send 50 greeting cards to a child to sell to relatives,...
-
Calculate the beta of a company. a. What data do we need to collect and what calculations we need to do? b. Draw the graph show how to find the beta, please label the axes.
-
Use Excel to prepare in good form a statement of revenues, expenditures, and changes in fund balance for the General Fund for the year ended December 31, 2023. (See Illustration 4-5 in the textbook...
-
Compute cash flows from financing activities using the above company information. Note: Amounts to be deducted should be indicated by a minus sign. Financing Activities
-
Ali sold 1700 quantity of rings and the price per unit is $11 The company offered 42% trade discount. Calculate the total sales made by Ali
-
The table represents values of differentiable functions f and g and their first derivatives. Use the table of values to answer the questions that follow. Work all of the parts below the line. X f g...
-
Problem 8-29 (Algo) Completing a Master Budget (LO8-2, LO8-4, LO8-7, LO8-8, LO8-9, LO8-10] The following data relate to the operations of Shilow Company, a wholesale distributor of consumer goods:...
-
What is the difference between the straight-line method of depreciation and the written down value method? Which method is more appropriate for reporting earnings?
-
Cushing Corporation is considering the purchase of a new grading machine to replace the existing one. The existing machine was purchased 3 years ago at an installed cost of $20,000; it was being...
-
Raina Herzig wishes to choose the best of four immediate-retirement annuities available to her. In each case, in exchange for paying a single premium today, she will receive equal, annual,...
-
Eastern Clock Company has an outstanding issue of convertible bonds with a $1,000 par value. These bonds are convertible into 50 shares of common stock . They have a 10% annual coupon interest rate...
-
Rose Ubens, buys and sells goods. Her trial balance is presented below. Note: 1. Closing inventory is 4,000 Required: Prepare Rose Ubens, income statement for the year ended 31 December 2012 and a...
-
Paul Icasso has the following trial balance. Required: Prepare Paul Icassos trading and income statement for the year ended 31 March 2013 and a statement of financial position as at 31 March 2013. P....
-
Michael Anet has the following trial balance. Required: Prepare Michael Anets income statement for the year ended 31 December 2012 and statement of financial position as at 31 December 2012. M. Anet...
Study smarter with the SolutionInn App