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...
-
What are loss contingencies? How are such items presented in the financial statements? Explain.
-
Figure shows a hollow cylindrical tube of mass M, length L, and moment of inertia ML2/10. Inside the cylinder are two masses m, separated a distance ? and tied to a central post by a thin string. The...
-
Identify and describe the key attributes that might mitigate a red flag, suggesting that no bad act or compliance issues exist.
-
Refer to the Hungry Dawg Restaurant example presented in this chapter. Health claim costs actually tend to be seasonal, with higher levels of claims occurring during the summer months (when kids are...
-
Direct labor-hours Machine-hours Total fixed manufacturing overhead cost Variable manufacturing overhead per machine-hour Variable manufacturing overhead per direct labor-hour Required: 1. Compute...
-
The proposed rates were not in the range the CEO expected given the pricing analysis. The CEO has asked the pricing actuary to verify the total projected loss cost excluding potential large storm...
-
A formal email to your employer to complain about the problem within (growing isolation in the modern workplace). Suggests that you are working on your proposal and will submit more details within in...
-
A piece of land owned by Mr. Lobo located on Jaipur - Delhi Highway was acquired by NHAI in the F.Y. 2008-09, but the award ordered in F.Y. 2009-10 was paid in the F.Y. 2023-24. This land was...
-
A wasp accumulates 1.0x10-12 C of charge while flying perpendicular to the earth's magnetic field of 5.0x10-5 T. How fast is the wasp flying if the magnetic force acting on it is 6.0x10-16 N. A long...
-
Ecker Inc. applies overhead based on machine hours. During the year the company estimated that they would have total estimated overhead costs of $400,000 and total estimated machine hours of...
-
If your average check is $35.00 and the general manager expects to see a labor cost percentage of 40% and a profit of 12%, what is the average amount (ideal expense) that can be spent on labor per...
-
Consider a gene with three alleles. On the graph below, there are two lines indicating the frequency of two of the three alleles over time. Fill in the graph with the line that shows the frequency of...
-
Alice Milne grants Christopher Carroll a franchise to sell homemade honeys. Christopherpays Alice 20% of all revenue. Sales for 2021 were $740,000. a. How will Alice treat the payment on her 2021...
-
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...
-
Define terrorism.
-
Congress has prohibited the provision of material support or resources to certain foreign organizations that engage in terrorist activity. 18 U.S.C. 2339B(a)(1) . . . The plaintiffs in this...
-
Following a six-day trial in March 2008, a jury convicted Defendant Hassan Abu-Jihaad on two charges: (1) disclosing national defense information to those not entitled to receive it in violation of...
Study smarter with the SolutionInn App