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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:17:54+00:00 2026-06-12T17:17:54+00:00

I got the program running guys thanks alot i just deleted everything and started

  • 0

I got the program running guys thanks alot i just deleted everything and started again from scratch! Now I am having problems with :

// The constructor

public Grade ( string cname , int Studentident , int [] homework , int [] classwork ,      int [] midexam , int [] finalexam)
{
    coursename = cname ;
    Studentid = Studentident ;  
    hwgrade = homework ;
    cwgrade = classwork ;
    midegrade = midexam ;
    finalegrade = finalexam ;
} 

// trying to set the values

Grade grade = new Grade('m',1,1,1,1,1);

it is giving me an error cannot convert from int to int[]

  • 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-12T17:17:55+00:00Added an answer on June 12, 2026 at 5:17 pm

    You must pass in arrays, not single values:

    Grade grade = new Grade('m',
                            new int[] {1}, 
                            new int[] {1}, 
                            new int[] {1}, 
                            new int[] {1}, 
                            new int[] {1});
    

    int is not the same as int[], after all.

    The above assumes that your fields (such as hwgrade) are declared as int[] and not int.

    If this is not the case, and the fields are actually integers and not integer arrays, you need to change the method signature to take integers instead of arrays:

    public Grade(string cname, 
                 int Studentident, 
                 int homework, 
                 int classwork,
                 int midexam,
                 int finalexam)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a program that outputs to a file. I'm running it from an
I just got a semi function head program running and I need help making
I've got a program which takes Youtube URLs from a database, and I'm having
I've got my main form Form1 running the main bulk of my program. I
I've got a program made basically from a ListCtrl and has an add button,
I've got a program running in a GNOME Terminal, but the screensaver is acting
I am learning Java from scratch. I installed the JDK, and I got the
I've got a server program running on Ubuntu and it hangs after a few
So I got my prism/mvvm/mef program running nicely along, the user is entering data
I got a long running program that I don't want to kill, but 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.