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...
-
How does e-business strategy relate to strategy on the corporate level?
-
You are considering investing in two securities, X and Y, and have the following information: (a) Calculate the expected return for each security separately and for a portfolio of 60 per cent X and...
-
What does the retained earnings account measure? (a) Cash held by the company since its inception. (b) Payments made to shareholders in the form of cash or stock dividends. (c) All undistributed...
-
The Office Mart store in South Beach experienced the following events during the current year: 1. Incurred $200,000 in marketing costs. 2. Purchased $600,000 of merchandise. 3. Paid $20,000 for...
-
How does MariaDB address the evolving demands of compliance and regulatory frameworks such as GDPR, HIPAA, and SOC 2, by incorporating features like audit logging, data masking, and transparent data...
-
Dwight Donovan, the president of Donovan Enterprises, is considering two investment opportunities. Because of limited resources, he will be able to invest in only one of them. Project A is to...
-
My name is Alvin, and I live in Virginia. I am a veteran, and I served ten years with the United States Army. My military occupation specialty was Automated Logistics Specialist (92A). I deployed...
-
1. Month-end payments of $1,530 are made to settle a loan of $149,540 in 9 years. What is the effective interest rate? Round to two decimal places 2. Alexis wants to accumulate at least $50,000 by...
-
Assume that you acquire a (net) debt-free company for $1,000.00 with 65% of the acquisition financing (i.e., purchase price) coming from debt borrowings. You have created a five-year plan to use all...
-
Locust Software sells computer training packages to its business customers at a price of $91. The cost of production (in present value terms) is $87. Locust sells its packages on terms of net 30 and...
-
Gold Mining, Inc. is using the profitability index (PI) when evaluating projects. Gold Mining's cost of capital is 6.12 percent. What is the PI of a project if the initial costs are $1,439,872 and...
-
"If a machine with a cost of $50,000, a useful life of 5 years, and an expected production of 100,000 units, produces 20,000 units in a year, what would be the depreciation expense for that year...
-
How are the unit and lesson plan documents similar and different in their elements, terms of scope, structure, and overall purpose?
-
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...
-
Over what ranges of taxable income in 2017 will the total income tax liability for two persons with equal incomes who file as single individuals equal their income tax liability if they file jointly...
-
If a taxpayer has $40,000 of employee salary in 2017, how much will be withheld for the Social Security and Medicare taxes?
-
Sally and Jim are married and have taxable income in 2017 of $160,000. If they could file their income tax as single individuals, each of them would have taxable income of $80,000. Do they have a...
Study smarter with the SolutionInn App