Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7823611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:18:34+00:00 2026-06-02T08:18:34+00:00

k I am being asked to Write a function sumArrayAscii that accepts an array

  • 0

k I am being asked to Write a function sumArrayAscii that accepts an array of strings and returns the sum of all the ascii values of all the characters in all the strings in that array. Note that this function should use sumAscii from problem. this is what I have but I cannot get it ti work

#include <iostream>
using std::cout; 
using std::endl; 

int main() 
{ 
int myArrayNumberOfElements(5); 
double myArray[myArrayNumberOfElements] = {1.1, 4.5, 5.7, 7.9, 10}; 
double sum(0); 
for (int i(0); i < myArrayNumberOfElements; i++) 
{ 
sum +=myArray[i]; 
} 

cout << endl << "Sum of all elements: " << sum << endl; 

system("PAUSE"); 
return 0; 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T08:18:37+00:00Added an answer on June 2, 2026 at 8:18 am

    The code that you posted calculates the sum of a double array. I see no work with strings or ASCII code for that matter.

    These two function worked for me. First function returns the ASCII sum of all characters in a single string. The second one uses the first function in calculating the ASCII sum for a list of strings.

    int ASCIIsumOfString(string s){
    int sum = 0;
    for(int i=0; i<s.length(); i++){
        sum += s[i];
    }
    return sum;}
    
    
    int ASCIIsumOfStringArray(string *s, int numberOfStrings){
        int sum = 0;
        for(int i=0; i<numberOfStrings; i++){
            sum += ASCIIsumOfString(s[i]);
        }
        return sum;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am being asked to write a desktop application in .net and MSSQL for
I could see that this question was being asked a lot of times and
I have been asked to write a GUI that will allow objects to be
Im having trouble understanding class relationships after being asked to research it further, would
Discussing with people, asking in interviews, or being asked in interviews, I do not
I'm writting an small game in iPhone, and I'm being asked to add in-game
Being a Java developer in an agile development cycle, I have learnt that it
I was asked by a local school to write a database export utility to
I have been trying to write some code that asks the user for several
Here is the reason why this question was being asked: www.devplusplus.com/Tests/CSharp/Hello_World . While similar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.