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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:57:36+00:00 2026-06-13T00:57:36+00:00

I am having trouble with getting this to work I need pointed in the

  • 0

I am having trouble with getting this to work I need pointed in the right direction. The user will input a command line integer to determine how many places the characters will be rotated. My problem is that I want all lower case and upper case to stay the same case along with keeping spaces and special characters untouched, only rotating the letters by the specified integer. I need to make sure that for example: the integer set is 1 and the character “Z” is entered in the string to be encrypted it needs to wrap back around to “A” instead of going to the next ASCII character “[” I have been trying to use the “%” operator but I might be using it wrong. I am not looking for someone to write the entire code for me and I know I could find my answer by looking at the source code of a working program but I am trying to figure as much of this out by myself but right now I am stumped and need a small bit of help. Thanks!

I finally got it to work I had the entire operation wrong this is what worked for me.

char encrypt = ('A' + ( ( (input[i] - 'A') + key ) % 26));

Before I was trying

char encrypt (input[i] + key) % 26;

Thanks for the fast answers!

  • 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-13T00:57:37+00:00Added an answer on June 13, 2026 at 12:57 am

    While there are many ways to accomplish what you want, I suggest that you look into java.util.Map. Decide if this is an encryption Map or a decryption Map and “put” the input character as the key, and the output character as the value. Then when you need to translate, you simply walk through each to-be-translated character and assemble the output value. Pay attention to unmapped values (as they will return null upon lookup).

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

Sidebar

Related Questions

I've done this before, but I'm having trouble getting this to work... I need
I'm having trouble getting this regex to work. I need a pattern that matches
Ok this seems so silly but I'm having some trouble getting this to work.
I am having trouble getting this invisibilityOfElementLocated() method to work. Here is the code
I'm having trouble getting the CanExecute method of my command to work property. I've
I am having some trouble getting this simple code to work: #pragma once #include
I'm having trouble getting django-admin.py to work... it's in this first location: /Users/mycomp/bin/ but
I'm having some trouble getting this to work, and I'm pretty close to concluding
I'm having trouble getting this Javascript Regular Expression to work. What i want is
I am having trouble getting this to work correctly (obviously) - I am ALMOST

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.