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 6951835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:16:19+00:00 2026-05-27T14:16:19+00:00

I have been stumped on this for a long time and I was wondering

  • 0

I have been stumped on this for a long time and I was wondering if anyone can help me out. How could I write a program that would calculate the shift value of an encrypted Caesar’s Cypher file in C++? My assignment is to take each lower case letter and calculate how many times each is used, then find the most frequent character. I know I can do that with a map of char and int. But then I would have to go back to that letter to change it to the letter ‘e’. With maps there’s no way to search back through values. I think the only way is a vector of vectors but I wouldn’t know how to find the letter again with those either. Does anyone know a better way or how could I use vectors to accomplish this?

  • 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-27T14:16:19+00:00Added an answer on May 27, 2026 at 2:16 pm

    You can go like this.

    1. First read whole file in a buffer.
    2. Create map with char key and int value. with all alphabets and values 0
    3. Loop over whole buffer till end incrementing value in map by 1 for each character. Also maintain max variable storing key ha of character having maximum value.

    4. At end of loop max variable will point to e.

    5. Subtracting 4 from max will give you shift value for this cipher. If it comes negative then you can add 26. (As this calculation in in mod 26)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been stumped for bit on this one - I have a string that
I am developing a C program and have been stumped by this warning. I
I am kind of stumped here and have been trying to figure this out
I have been very stumped by this one. I have a fairly large (~1500
I have been stumped all day on this problem. Basically I want to check
I have been stumped for 3 hours now on this problem, I need to
Hey this might be a simple question, but i have been stumped on it
i have been stumped on this for quite a while now. I am trying
I have been stumped by this problem. I need to create a pattern such
I have been stumped on this one for a while. I want to take

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.