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

  • SEARCH
  • Home
  • 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 5839753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:37:55+00:00 2026-05-22T11:37:55+00:00

I am trying to write a function that decryptes an encrypted message that has

  • 0

I am trying to write a function that decryptes an encrypted message that has uppercase letters (showing its a new word) and lower case characters (which is the word itself). The function needs to search through the encrypted message for all the uppercase letters and then returns the uppercase character along with lower case that follows it. I have been given a function to call on within the decrypt function:

function isUpperCase(aCharacter)    
{    
    return (aCharacter >= 'A') && (aCharacter <= 'Z');
}

I was thinking that I would search through the word for all the uppercase characters first and assign that as a new string. I could then do while loop that will pick up each of the letters in the new string and then search for the lower case characters that are next to it in the old string.

However, I am completely stuck at the first part – I cant even work out the structured English.

The code is:

  • encryptMessage is a string containing uppercase and lowercase characters
  • indexCharacter is used at a later date for another function
  • upperAlphabet – alphabet of uppercase characters – used later
  • lowerAlphabet – alphabet lowercase characters – used later

The function:

function decryptMessage(encryptMessage, indexCharacter, upperAlphabet, lowerAlphabet)
{
    var letter
    var word = "";

    for (var count = 0; count < encryptMessage.length; count = count +1);
    {
        letter = encryptMessage.charAt(count) 
        if (isUpperCase(letter));
        { 
            word = word + letter;       
        }
        document.write(word); //this is just to test to see if it returns the uppercase - I would use the return word
    }

The above just doesnt seem to work, so I cant even continue with the rest of the code. Can anyone help me identify where i have gone wrong – have I completely gone the wrong direction with this anyway, reading it back I dont think it really makes much sense ?? Its a very basic code, I have only learnt, for, while loops – if and else functions really, i am just soooooo stuck.

thanks in advance for your advice 🙂

Issy

  • 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-05-22T11:37:55+00:00Added an answer on May 22, 2026 at 11:37 am

    EDIT

    String input = "ThisIsASecretText";    
    
    for(int i = 0; i < input.Length; i++)
    {
      if(isUpperCase(input.charAt(i))
      {
         String nextWord = String.Empty;
    
         for(int j = i; j < input.Length && !isUpperCase(input.charAt(j)); j++)
         {
           nextWord += input.charAt(j);
           i++;
         }
    
         CallSomeFunctionWithTheNextWord(nextWord);
      }
    }
    

    The following calls would be made:

    • CallSomeFunctionWithTheNextWord(“This”);
    • CallSomeFunctionWithTheNextWord(“Is”);
    • CallSomeFunctionWithTheNextWord(“A”);
    • CallSomeFunctionWithTheNextWord(“Secret”);
    • CallSomeFunctionWithTheNextWord(“Text”);

    You can do the same thing with much less code using regular expressions, but since you said that you are taking a very basic course on programming, this solution might be more appropriate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a JavaScript function that will return its first argument(function)
I'm trying to write a function that has a concept of a serial number.
I'm trying to write a function that formats every (string) member/variable in an object,
I am trying to write a function that will pull the name of a
I'm trying to write a function that is able to determine whether a string
I'm trying to write a regex function that will identify and replace a single
I'm trying to write a custom function that will let me retrieve a cell
I am trying to write my first real python function that does something real.
I'm trying to write a function that shifts all the elements in an array
I am trying to write a function that will take an xml object, an

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.