Find The Sum of Common Alphabets - Lower Given two char arrays input1[] and input2[] containing...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Find The Sum of Common Alphabets - Lower Given two char arrays input1[] and input2[] containing only lower case alphabets, extract the alphabets which are present in both arrays (common alphabets). Get the ascii values of all the extracted alphabets. Calculate sum of those ascii values. Lets call it sum1 and calculate single digit sum of sum1, i.e keep adding the digits of sum1 until you arrive at a single digit. Return that single digit as output. Note: 1.Array size ranges from 1 to 10. 2.All the array elements are lower case alphabets. 3. Atleast one common alphabet will be found in the arrays. Example-1 input1: {'a', 'b', 'c'} input2: {'b', 'c'} output: 98 +99 = 197 1+9+ 7 = 17 1+7=8 Explanation: 'b' and 'c' are present in both the arrays. Ascii value of 'b' is 98 and 'c' is 99. Example-2 input1: {'g', 'q', 'r' } input2: {'r', 't', 'u'} output: 114 1+1+4= 6 Explanation: 'r' is present in both the arrays. Ascii value of 'r' is 114. Find The Sum of Common Alphabets - Lower Given two char arrays input1[] and input2[] containing only lower case alphabets, extract the alphabets which are present in both arrays (common alphabets). Get the ascii values of all the extracted alphabets. Calculate sum of those ascii values. Lets call it sum1 and calculate single digit sum of sum1, i.e keep adding the digits of sum1 until you arrive at a single digit. Return that single digit as output. Note: 1.Array size ranges from 1 to 10. 2.All the array elements are lower case alphabets. 3. Atleast one common alphabet will be found in the arrays. Example-1 input1: {'a', 'b', 'c'} input2: {'b', 'c'} output: 98 +99 = 197 1+9+ 7 = 17 1+7=8 Explanation: 'b' and 'c' are present in both the arrays. Ascii value of 'b' is 98 and 'c' is 99. Example-2 input1: {'g', 'q', 'r' } input2: {'r', 't', 'u'} output: 114 1+1+4= 6 Explanation: 'r' is present in both the arrays. Ascii value of 'r' is 114.
Expert Answer:
Answer rating: 100% (QA)
using System class Intersection public static void sumchar input1 char input2 int n input1Lengt... View the full answer
Related Book For
Data Analysis and Decision Making
ISBN: 978-0538476126
4th edition
Authors: Christian Albright, Wayne Winston, Christopher Zappe
Posted Date:
Students also viewed these programming questions
-
Please solve this problem using C language Hacker Industries has a number of employees. The company assigns each employee a numeric evaluation score and stores these scores in a list. A manager is...
-
please try to solve this question using Matlab and also explain it
-
Solve the following macroeconomic model wherein; Y = C + I + G + NX is the equilibrium condition in macroeconomic model C = 1500 + 0.75Y consumption function ( C = C0+cYd), where c is MPC I = 1250...
-
Three friends are choosing a restaurant for dinner. Here are their preferences: a. If the three friends use a Borda count to make their decision, where do they go to eat? b. On their way to their...
-
Identify the items from the following list that are likely to serve as source documents. a. Trial balance b. Telephone bill c. Sales ticket d. Income statement e. Company revenue account f. Invoice...
-
Hardy Gumshoe, warden of Notomorrow State Penitentiary asked his staff analyst to look into the relationship between the number of prisoners (X) and the number of disturbances made by them (Y). The...
-
Utta Inc. allows each employee to earn 15 paid vacation days each year with full pay. Unused vacation time can be carried over to the next year. If not taken during the next year, unused vacation...
-
Haley Romeros had just been appointed vice president of the Rocky Mountain Region of the Bank Services Corporation (BSC). The company provides check processing services for small banks. The banks...
-
ACCT3103 1I2021 Final Assessment PART A Other information Companies in the group use the perpetual inventory system. Total intra-group sales revenue during the year were $120,000. Inventory was sold...
-
Mr. M has been employed as an engineer by A Ltd., a company incorporated in Hong Kong. During the year ended 31 March 2019, Mr. M had the following income and expenditure. A monthly salary of...
-
Question 1 Harris Pilton had 5,000,000 common shares in issue on January 1, 2018. On March 1, the company issued 100,000 new shares. On May 1 the company made a 3 for 2 bonus issue. On July 1, the...
-
What is the firm's cost of debt? What is the cost of preferred stock for Natural Wonder Corp.? Cost of common equity (1) What is the estimated cost of common equity using the CAPM approach? (2) What...
-
I want three components for this exercise 1) a pre-negotiation plan 2) the contract negotiation 3) a post- negotiation assessment - 1. What were the terms of your final settlement ? 2. Were your...
-
Find the x-intercepts of the graph of the equation x + 4x + y+ 7y = 5
-
Sheridan Construction Company has entered into a contract beginning January 1, 2020, to build a parking complex. It has been estimated that the complex will cost $603,000 and will take 3 years to...
-
Using the expenditures method, label each of the following as a source (S), application (A) 1)A suspect sold stock with a basis of $5,000. 2)A suspect paid Federal income taxes of $2,400. 3)A suspect...
-
What drives the demand for steel? Why is the steel industry regarded as a cyclical industry
-
In Problem 8.43, determine the smallest value of for which the rod will not fall out of the pipe. IA -3 in.-
-
The file P09_57.xlsx contains the number of days 44 mothers spent in the hospital after giving birth (in the year 2005). Before health insurance rules were changed (the change was effective January...
-
Continuing the previous problem, develop a sample model with your own choices of N, M, and L that barely stay within Solvers limit. You can make up any input data. The important point here is the...
-
The current solution to Sure Steps no-backlogging aggregate planning model does quite a lot of firing. Run a one-way SolverTable with the firing cost as the input variable and the numbers fired as...
-
RJR Nabisco also had $10 billion in bonds outstanding at the time of the dividend increase in Problem 10. How would you expect the bonds to react to the announcement? Why? Reference from in problem...
-
To examine how much cash your firm has returned to its stockholders and in what form (dividends or stock buybacks) and to evaluate whether the trade-off favors returning more or less. Key Questions ...
-
To estimate earnings and cash flows on a typical project for the firm. Key Questions: 1. Does your firm have a typical investment? 2. If so, can you estimate the earnings and cash flows on a typical...
Study smarter with the SolutionInn App