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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:54:15+00:00 2026-05-12T05:54:15+00:00

Requirements: Return total count of files (records) for date. Assign a modifier (single character

  • 0

Requirements:

Return total count of files (records) for date.
Assign a modifier (single character A-Z 0-9) to represent the count.

Info:
This modifier along with the date / time will be used to trace the file through out the system.

Current Solution:

[Test]
    public void FileIDModifierShouldReturn9()
    {
        var filecountfordate = 35;
        var chararray = new[]{
                               'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R'
                               , 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8',
                               '9'
                           };

        var expected = "9";
        var actual = chararray[filecountfordate].ToString();

        Assert.AreEqual(expected, actual);
    }

Problem:
When the file count is greater than the index of the array an exception is thrown obviously.

2nd Test:

[Test]
    public void WhenFileIDModifierIsBiggerThanArrayArrayShouldStartOverAndReturnValue()
    {
        var filecountfordate = 71;
        var chararray = new[]{
                               'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R'
                               , 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8',
                               '9'
                           };
        if (filecountfordate > 35)
        {
            filecountfordate = filecountfordate%36;
        }

        var expected = "9";
        var actual = chararray[filecountfordate].ToString();

        Assert.AreEqual(expected, actual);
    }

My problem is I need to be able to restart at the beginning of the array pragmatically, with out having endless “if” statements. Its late and my brain is dead and therefore just can’t come up with a reasonable solution.

Any help is appreciated.

  • 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-12T05:54:16+00:00Added an answer on May 12, 2026 at 5:54 am

    without any loss you can always use modulo of file count over 36

    [Test]
    public void WhenFileIDModifierIsBiggerThanArrayArrayShouldStartOverAndReturnVal()
    {
        var filecountfordate = 71;
        var chararray = new[]{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 
          'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 
          'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8',
                               '9'
                           };
    
        filecountfordate = filecountfordate % chararray.Length;
    
    
        var expected = "9";
        var actual = chararray[filecountfordate].ToString();
    
        Assert.AreEqual(expected, actual);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Some of the requirements (restrictions) for such a ui framework/toolkit are: No single vendor
Requirements: Must be able to use C strings as well as C++ strings Fast
My requirements: Support .NET Compact Framework 2.0 and Windows Mobile 6.0 devices. Only need
Here are the requirements: Must be alphanumeric, 8-10 characters so that it is user
Premise : The requirements for an upcoming project include the fact that no one
Seems that requirements on safety do not seem to like systems that use AI
Given the extremely high requirements for unpredictability to prevent casinos from going bankrupt, what
If the requirements are changing frequently and you want to deliver your code in
How do you go about the requirements gathering phase? Does anyone have a good
What all would be the requirements for the following scenario: A GSM modem connected

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.