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 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

Requirements: function arguments: - $day, $month function should return the year. Is this possible
Some of the requirements (restrictions) for such a ui framework/toolkit are: No single vendor
I wrote a R function to return rows satisfying specific requirements, but I got
According to 5.2.4.1 Requirements the Expected Result for Pressing the Back button must return
What I have? I have below requirements: Search the database and return TreeNode objects
Consider the following code: // this method should add numbers, the requirements are: //
The requirements of this are somewhat restrictive because of the machinery this will eventually
[question update according to updated requirements] I've implemented following function which should return either
The requirements I'm up against About 12 people are using this application, but we
I have a requirement to return xml as follow <row id=1> <cell>1</cell> <cell>setup/pagemst</cell> <cell>Page

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.