Ex-9) Devise a flowchart to receive a positive number and output each digit separately. For instance, if
Fantastic news! We've Found the answer you've been seeking!
Question:
Ex-9) Devise a flowchart to receive a positive number and output each digit separately. For instance, if the input is 692, the program should output 2,9, 6. Another example, if the number is 135429 the program should out put 9, 2, 4, 5, 3, and 1.
Transcribed Image Text:
IMPORTANT: In Ex 9 to 12, you are not allowed to use strings. Instead, you should work with numbers and math operators, such as division, modulus, etc. Ex 9) Devise a flowchart to receive a positive number and output each digit separately. For instance, if the input is 692, the program should output 2, 9, 6. Another example, if the number is 135429 the program should out put 9, 2, 4, 5, 3, and 1. Ex 10) Devise a flowchart to receive a positive number and output how many of its digits are equal to 7. For instance, if the input is 772, the program should output 2, because there are two sevens there. Another example, if the input is 14368, the program should output 0. Ex 11) Devise a flowchart to receive a positive number and output sum of its digits. For instance, if the input is 63932, the program should output 23, because 6+3+9+3+2 is 23. Another example, if the input is 23 the program should output 5. Ex 12) Devise a flowchart to receive a positive number and output "yes" if it's equal to its reverse; otherwise, output "no". For instance, if the input is 63936, the program should output "yes", because if you read the digits from left to right or from right to left, it's the same number. But, if the input is 632, the program should output "no" because 632 is not the same as 236. Ex 13) Devise an algorithm to receive a positive number, as n, and output n! (n Factorial). 2 Ex 14) Devise an algorithm to input an integer greater than 1, as n, and output the first n values of the Fibonacci sequence. In Fibonacci sequence, the first two values are 0 and 1 and other values are sum of the two values preceding it. For instance, if the input is 4, the program should print 0, 1, 1, 2,. As another example, if the input is 9, the program should output 0, 1, 1, 2, 3, 5, 8, 13, 21, By the way, after you are done with Ex 14, learn more about applications of Fibonacci number in real life here: http://www.ijesi.org/papers/Vol(619/Version-3/80609030714.pdf. There might be a question on this in the pre-lab mini quiz. Ex 15) Devise an algorithm to input a positive integer, n,- and by using XX characters-output the figure below that has n rows and each row k has k pairs of XX. For instance, if input is 5, the figure on the left (and if the input is 12, the figure on the right) should be generated by the program. number: 5 XX XX XX XXXX XX number: 12 XX XX XX xx xx xx XXXXXXXX xxxxxxxxxx xxxxxxxxxxx XX XXXX XX xx xx xx xx xx xxx XXXXXXXXXX XXXX XX XX xx xx xx xx xx xx xx Show all your flowcharts to your TA before going to Part 2. The TAs may ask any teammate some questions about the flowcharts, they may also ask you to modify your flowcharts slightly. area start a, b, c a+b+c 2 -sqrt(s(s-a)(s-b)(s-c)) end "area: ", area pre: a, b, c ER post: area has to be outputted IMPORTANT: In Ex 9 to 12, you are not allowed to use strings. Instead, you should work with numbers and math operators, such as division, modulus, etc. Ex 9) Devise a flowchart to receive a positive number and output each digit separately. For instance, if the input is 692, the program should output 2, 9, 6. Another example, if the number is 135429 the program should out put 9, 2, 4, 5, 3, and 1. Ex 10) Devise a flowchart to receive a positive number and output how many of its digits are equal to 7. For instance, if the input is 772, the program should output 2, because there are two sevens there. Another example, if the input is 14368, the program should output 0. Ex 11) Devise a flowchart to receive a positive number and output sum of its digits. For instance, if the input is 63932, the program should output 23, because 6+3+9+3+2 is 23. Another example, if the input is 23 the program should output 5. Ex 12) Devise a flowchart to receive a positive number and output "yes" if it's equal to its reverse; otherwise, output "no". For instance, if the input is 63936, the program should output "yes", because if you read the digits from left to right or from right to left, it's the same number. But, if the input is 632, the program should output "no" because 632 is not the same as 236. Ex 13) Devise an algorithm to receive a positive number, as n, and output n! (n Factorial). 2 Ex 14) Devise an algorithm to input an integer greater than 1, as n, and output the first n values of the Fibonacci sequence. In Fibonacci sequence, the first two values are 0 and 1 and other values are sum of the two values preceding it. For instance, if the input is 4, the program should print 0, 1, 1, 2,. As another example, if the input is 9, the program should output 0, 1, 1, 2, 3, 5, 8, 13, 21, By the way, after you are done with Ex 14, learn more about applications of Fibonacci number in real life here: http://www.ijesi.org/papers/Vol(619/Version-3/80609030714.pdf. There might be a question on this in the pre-lab mini quiz. Ex 15) Devise an algorithm to input a positive integer, n,- and by using XX characters-output the figure below that has n rows and each row k has k pairs of XX. For instance, if input is 5, the figure on the left (and if the input is 12, the figure on the right) should be generated by the program. number: 5 XX XX XX XXXX XX number: 12 XX XX XX xx xx xx XXXXXXXX xxxxxxxxxx xxxxxxxxxxx XX XXXX XX xx xx xx xx xx xxx XXXXXXXXXX XXXX XX XX xx xx xx xx xx xx xx Show all your flowcharts to your TA before going to Part 2. The TAs may ask any teammate some questions about the flowcharts, they may also ask you to modify your flowcharts slightly. area start a, b, c a+b+c 2 -sqrt(s(s-a)(s-b)(s-c)) end "area: ", area pre: a, b, c ER post: area has to be outputted
Expert Answer:
Answer rating: 100% (QA)
Problem Solved and Files related uploaded at this link httpsg... View the full answer
Related Book For
Retail Management A Strategic Approach
ISBN: 978-0132720823
12th edition
Authors: Barry R. Berman, Joel R. Evans
Posted Date:
Students also viewed these algorithms questions
-
Prepare the following for April: 1. Revenues budget 2. Production budget in units 3. Direct material usage budget and direct material purchases budget 4. Direct manufacturing labor cost budget 5....
-
Find Vo(t),t>0 in the network in fig if the input is represented by the waveform shown in fig.
-
Select any Company and get a copy of its annual report. Just write an outline of the company's annual report. The outline must contain the following: 1. Introduction 2. Background 3. Liquidity Ratios...
-
Hombran Doughnuts has current assets of $270 million; property, plant, and equipment of $400 million; and other assets totaling $160 million. Current liabilities are $160 million and long-term...
-
a. Depreciation on the company's equipment for 2013 is computed to be $18,000. b. The Prepaid Insurance account had a $6,000 debit balance at December 31, 2013, before adjusting for the costs of any...
-
Farnsworth Drycleaners has capacity to clean up to 7,500 garments per month. Requirements 1. Complete the following schedule for the three volumes shown. 2. Why does the average cost per garment...
-
The Korvette concept was started and run by one person and his group of friends. How could its failure have been avoided? Was the problem one of strategy (overexpansion), or was it organizational?...
-
Pro Tire manufactures tires for all- terrain vehicles. Pro Tire uses job costing and has a perpetual inventory system. On November 22, Pro Tire received an order for 190 TX tires from ATV Corporation...
-
Bryson College is a highly politicized organization (Table 3.7). What changes in the organization of the college would be necessary for Bryson to become a professionalized organization? A...
-
Vosges Haut-Chocolat is a chocolate brand seeking to make consumption of their chocolate a luxury experience which has grown along with the market for high-end chocolate. The video discusses how...
-
Suppose that banks are less able to raise funds and so lend less. Consequently, because people and households are less able to borrow, they spend less at any given price level than they would...
-
The definition of a liability forms an important element of the International Accounting Standards Board's Framework for the Preparation and Presentation of Financial Statements which, in turn, forms...
-
What is the formula to calculate the current ratio? What does the current ratio measure? What is the formula to calculate the debt ratio? What does the debt ratio measure? When would you use each of...
-
Based on the COVID-19 event in Zambia, what issues were recorded within the country's main supply chain management? By identifying trends through examining the principles and standards, diversity,...
-
What public interest groups, aging services, or professional organizations have the most influence on political decisions related to long-term care? Why? What was the significance of the passage of...
-
On June 14, 2019, Montgomery Oil & Chemicals sold 185,000 gallons of oil and other lubricants to Qumicos Industriales Co. at a price of $1.90 per gallon. On August 23, 2019, 65,000 gallons were...
-
North Division has the following information: Sales $1190000 Variable expenses 649000 Fixed expenses 620000 If this division is eliminated, the fixed expenses can be allocated to the company's other...
-
Is the modified 5-question approach to ethical decision making superior to the modified moral standards or modified Past in approach?
-
Evaluate the applicability of this research findings to a membership club such as BJ's.
-
Marsha Hill is the store manager at a camera shop. She has saved $100,000 and wants to open her own store. Devise an overall strategy for Marsha, including each of the controllable factors listed in...
-
Distinguish among the following auditors. Under what circumstances would each be preferred? a. Outside auditor b. Company audit specialist c. Company department manager
-
Cumulative Normal distribution \(\Phi_{(\mu, \sigma)}\) and probability (a) \(X \sim \phi_{(0,1)}\); what is \(P(X \leq 1.43)\) ? (b) \(X \sim \phi_{(0,1)}\); what is \(P(X>1.43)\) ? (c) \(X \sim...
-
Inverse cumulative Normal distribution \(z\) (a) Find \(z_{0.05}\). (b) Find \(z_{0.95}\). (c) Let \(X \sim \phi_{(2,1)}\). Find \(a\) such that \(P(X \leq a)=0.05\). (d) Let \(X \sim \phi_{(2,1)}\)....
-
The Normal approximation (a) A discrete stochastic variable \(X\) has expected value \(\mu_{X}=3\) and \(\sigma_{X}=1.2\). Use the Normal approximation to find \(P(X \leq 4)\). (b) A continuous...
Study smarter with the SolutionInn App