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...
-
Describe three ways in which PS can be used to protect against DDos attacks.
-
LSG Company is a calendar year, cash basis taxpayer. On November 1, 2018, LSG paid $9,450 cash to the janitorial service firm that cleans LSG's administrative offices and retail stores. How much of...
-
The IT manager of Aztec Realty, Inc., prepared the balance sheet of the company while the accountant was ill. The balance sheet contains numerous errors. In par ticular, the IT manager knew that the...
-
Meranda Corporation is authorized to issue both preferred and common stock. The par value of the preferred is $50. During the first year of operations, the company had the following events and...
-
Sheffield Company is preparing its master budget for 2025. Relevant data pertaining to its sales, production, and direct materials budgets are as follows. Sales. Sales for the year are expected to...
-
The equilibrium adsorption of methane on a given activated carbon was studied by Grant et al. (1962). They proposed a Langmuir-type adsorption isotherm with parameters \(q_{m}=48 \mathrm{~g}...
-
Solve the equation Ax = b by using the LU factorization given for A. Also solve Ax = b by ordinary row reduction. 4-7-4 1 0 0 4-7 - 4 -3 A = - 4 3 3 = -1 1 0 0-4-1 b= -11 8-2-6 2-3 1 0 0 - 1 42 Let...
-
How are the monadic, the dyadic (relational) and the systemic (network) perspectives on exchanges interconnected? Use Social Exchange Theory to support your arguments.
-
Maria believes the costs of her marriage exceed her rewards. According to exchange theory, Maria is likely to stay married as long as her husband's costs are greater than his rewards, too. stay...
-
How do you determine an employee's emotional stability to things like stress in the workplace? Is this ability learned by you do you think it is something you were born with?
-
An option contract is an agreement whereby the offeree gives the offeror a piece of consideration in exchange for the offeror s agreement to hold the offer open for the specified period of time. T / F
-
how would you make a convincing case that open trade in goods and services as well as free flow of foreign direct investment will enhance the well being of specific example? consumer producers the...
-
Do you know the difference between people who are fit and people who are out of shape? In this world theirs's a lot of different types of people but we are only going to focus on two types of people;...
-
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...
-
Consider the following scenarios: To assist the sale of your products in a particular foreign market, it is suggested that you pay a 10 percent commission to a go-between who has access to high...
-
Are the ethics of gift-giving different between high context and low-context cultures?
-
Two consortia of leading North American and European apparel retailers, the Alliance for Bangladesh Worker Safety and the Accord on Fire and Building Safety in Bangladesh, have pledged to provide...
Study smarter with the SolutionInn App