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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:45:58+00:00 2026-05-26T00:45:58+00:00

I have to write two files for an assignment, a client file that will

  • 0

I have to write two files for an assignment, a client file that will receive two sets of data from the user. The first set is a list of applicant ID’s (int) and the second set is either y or n (char). The sets of data need to be entered into two arrays.
I then have to create a class file that will receive these two arrays into a constructor which will then run through some specific methods to validate if the answers are correct, how many answered correctly and finally which candidates received the most correct answers.

I just have two questions:

1st – the first line of data that will be entered into the second array will be the answer key. Is it possible to add a 0 to the beginning of the applicant ID’s array so that the two arrays will match (ID#{1} to answer{1}, etc)?

2nd – with the calling of my class file from my client file do I declare the array’s in both?
i.e.:

client file:

int[] id = new int[];
char[] answer = new char[];
ValidateMark importClerk = new ValidateMark(id, answer);

class constructor:

public ValidateMark(int number[], char marks[])

Thanks in advance

  • 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-26T00:45:58+00:00Added an answer on May 26, 2026 at 12:45 am

    I am going to assume the data structures are required and specified as part of the assignment and not give any input on alternate ones to use unless asked otherwise.

    First Question:

    Yes you can, but not in the manner you are thinking. Arrays, once declared, occupy a static amount of memory with a static number of elements. Therefore, you can’t “insert” a item to the beginning of a array that has already been declared and allocated. That is a dynamic collection type of behavior such as a List.

    If you don’t have control over the declaration/allocation of the array then the only choice you have is to copy the contents of the array to a new one that includes the empty 0 index.

    int[] array = { 0, 1, 2, 3 };
    int newArray = new int[array.length + 1];
    
    newArray[0] = 0;
    for(int i = 1; i < newArray.length; i++)
    {
       newArray[i] = array[i - 1];
    }
    

    On the other hand, if you are the one making this initial array then just simply make the size +1 bigger and add a zero at the beginning, problem solved.

    Second Question:

    Whether or not the arrays should declared in the “Client file” (whatever that is), is really up to you.

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

Sidebar

Related Questions

I wanted to write a program that test if two files are duplicates (have
I have two (UNIX) programs A and B that read and write from stdin/stdout.
I have these two file in my project that I am migrating from php.
I need to write data into drive. I have two options: write raw sectors.(_write(handle,
Is there a better to write the following? I have two services that I
I have two data files in tab separated CSV format. The files are in
I'm looking for a diff/compare tool that shows differing lines from two text files,
I have two properties files that contain information. I would like to diff them
I have to write an application, which will compare the modification date of two
I'm trying to write a script that takes two files and a number as

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.