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

The Archive Base Latest Questions

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

I have an assignment to be done in college, a piece asks for the

  • 0

I have an assignment to be done in college, a piece asks for the instructions below to be done. Please don’t give away the answer, simply leading me in the right direction would be awesome.

All the data is transmitted as four-digit integers. You program should read a four-digit integer entered by the user and encrypt it as follows:
– Replace each digit with the result of adding 7 to the digit and getting the remainder after dividing the new value by 10. Then,
– Swap the first digit with the third, and the second with the fourth.

i can do everything but swapping the digits at the end of the instructions.

All help greatly appreciated,
thanks guys!

  • 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-26T14:03:20+00:00Added an answer on May 26, 2026 at 2:03 pm

    First of all, you need to get every digit in the number and store in separate variables (in an array or a list).

    Let’s say

    number = 1763
    

    Your array would look like this:

    list[0] = 3
    list[1] = 6
    list[2] = 7
    list[3] = 1
    

    Then for each member of the list, do this:
    list[i] = (list[i] + 7) % 10;
    Then swap the elements in the list as directed. Write a swap function so that you can reuse it.

    swap(int[] array, int i, int j) { 
    // Check for array boundary violation
    // Swap the elements of the array identified by indexes i and j
    int tmp = array[i]; array[i] = array[j]; array[j] = tmp;
    }
    

    Then construct your number out of the array. Note that array indexes will be the power of 10 when summing up the figures.

    This solution will easily scale to n-digit integers.

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

Sidebar

Related Questions

This is uni assignment and I have already done some stuff. Please go to
I have done a homework assignment, here is the problem statement: Your program should
I have an assignment for a class that is to be done in C#.
Im almost done with a homework assignment that multiplies polynomials and has to have
I have a homework assignment and I've done the bare minimum of the assignment,
I am working on a homework assignment, and I have almost everything done except
I have to make a simple animation for an assignment and don't have access
I have assignment to work on producer and consumer problem by use thread and
Is it possible to have assignment in a condition? For ex. if (a=some_func()): #
I have an assignment on RSA implementation. Just now started working on it. I

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.