Quick Array Question..... Please HelP!

Objectives: int mark [] = new int [8]; mark.length;
Write a program that asks the user to enter in 8 student marks between 0 and 100 into an integer array called mark. Stop your entry loop with a sentinel value of -1. Your program will find the average of the marks and also the deviation from the average. Test your program with the following marks: 20, 30, 40, 50, 60, 70, 80, 90, -1. Your output will be:
The average of the marks is 55
Mark Deviation From average
20 -35
30 -25
40 -15
50 -5
60 5
etc etc
The above is the objective and the program I am suppose to write. I am new to arrays and this is a new chapter for me, so I am not really familiar with what I am supposed to do; that is why I am here.
Below is the code that I have written so far; I know it is wrong because it is missing concepts. First problem I have is, i cannot print out all the 8 user inputs under the heading "Mark". The code in the bottom is messed up :(. Secondly, I do not know what syntax I am suppose to type to find the deviation of the input from the average. I know it is supposed to be input - average = deviation, but where and what do i type?!? If anyone can help me, that would be appreciated. Thanks!!!
// The "Chap4Program3" class.
import java.awt.*;
import hsa.Console;
public class Chap4Program3
    static Console c;           // The output console
    public static void main (String [] args)
        c = new Console ();
        int average, sum = 0;
        int mark [] = new int [8];
        c.println ("Please enter in 8 marks between 0 and 100");
        c.println ();
        for (int i = 0 ; i < 8 ; i++)
            mark = c.readInt ();
for (int a = 0 ; a < mark.length ; a++)
sum = sum + mark [a];
c.println ();
average = sum / mark.length;
c.println ("The average of the marks = " + average);
c.print("Mark Deviation from the average");
c.print(mark[]);
} // main method
} // Chap4Program3 class

// The "Chap4Program3" class.
import java.awt.*;
import hsa.Console;
public class Chap4Program3
    static Console c;           // The output console
    public static void main (String [] args)
        c = new Console ();
        int average, deviation, sum = 0;
        int mark [] = new int [8];
        c.println ("Please enter in 8 marks between 0 and 100 or -1 to stop");
        c.println ();
        do
            for (int i = 0 ; i < 8 ; i++)
                mark = c.readInt ();
for (int a = 0 ; a < mark.length ; a++)
sum = sum + mark [a];
c.println ();
while (mark [i] != -1);
average = sum / mark.length;
c.println ("The average of the marks = " + average);
c.println ("Mark Deviation from the average");
for (int i = 0 ; i < 8 ; i++)
c.print (mark [i]);
deviation = (mark [i] - average);
c.println (deviation, 22);
} // main method
} // Chap4Program3 class
Im suppose to stop the ENTRY LOOP with a sentinel value of -1... Im not sure if this is right, but there is one problem for sure.. I get an error when im running the program, it says that while (mark != -1); is wrong, but I do not know why.. It says that [i] is wrong, but that is what the user inputs, and im checking to see if the user inputs -1.. Arghh im so confused!!!!!!!!

Similar Messages

  • HT2968 I can not update several of my apps that i have purchased a while back in my Apps Store on my MacPro. Because it keeps using my old @me account for iTunes and i don't remember the password or security question, Please help?

    I can not update several of my apps that i have purchased a while back in my Apps Store on my MacPro. Because it keeps using my old @me account for iTunes and i don't remember the password or security question, Please help?

    Hi AlphaCentori,
    If you are having issues accessing the Apple ID that was used to originally purchase those apps, you may find the following article helpful:
    Apple Support: Rescue email address and how to reset Apple ID security questions
    http://support.apple.com/kb/ht5312
    Regards,
    - Brenden

  • I want to change my apple id password but I forgot the security questions please help me some using my icloud I'd

    I want to change my apple id password but I forgot the security questions please help me some using my icloud I'd and if confirmation is must so please phone number is mine please send a code please help me my apple

    Welcome to the Apple community.
    If you are unable to remember your password, security questions, don’t have access to your rescue address or are unable to reset your password for whatever reason, your only option is to contact AppleCare, upon speaking to an operator you should explain that your problem is related to your Apple ID, this way you will not be charged for assistance, even if you don’t have an AppleCare plan.
    The operator will take you through some steps you may have already tried, however they need to be sure they have exhausted all usual approaches before trying to reset your account, so you should try to be helpful and show patience with the procedure.
    The operator will need to verify they are speaking to the account holder and may ask you some questions that only the account holder could know, and you will need to answer them if the process is to proceed.
    Once the operator has verified your identity they will send a message through to your device which contains an alpha numeric code, which you will need to read back to them.
    Once this has been completed they will send an email to your iCloud email address after a period of 24 hours, so you should check that mail is enabled in your devices iCloud settings.
    Upon receipt of the email, use the reset link provided to reset your password, after which you should be able to make the adjustments to iCloud that you wish to do.

  • My apple id have been blocked an i do not remember the identity or security question please help what can i do?

    my apple id have been blocked an i do not remember the identity or security question please help what can i do?

    If your account is disabled you might be able to re-enable it via this page : http://appleid.apple.com, then 'reset your password'
    You might then need to log out of your account on your iPhone and iPad by tapping on your id in Settings > iTunes & App Storeand then log back in so as to 'refresh' the account on it.
    For your security questions, if you have a rescue email address (which is not the same thing as an alternate email address) on your account then the steps half-way down this page will give you a reset link on your account : http://support.apple.com/kb/HT5312
    If you don't have a rescue email address then you will need to contact Support in your country to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699 (you can also try this link if you can't get your account enabled via the above)
    When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down the HT5312 link above to add a rescue email address for potential future use

  • Hi, I have traveled the country and have forgotten my security questions please help me thank you

    Hi, I have traveled the country and have forgotten my security questions please help me thank you

    Call Apple to help reset your Security Question.
    http://support.apple.com/kb/HT5699

  • HT201303 I forgotten my answer of security questions, please help me. Thank you !

    I forgotten my answer of security questions, please help me. Thank you !

    You need to ask Apple to reset your security questions; as described in this article, it can be done in Vietnam by phoning 1-201-0288 and then 800-708-5413.
    (107433)

  • HT201363 Hello, I have my pass word, I have my Apple ID, but itunes think I am buying a song for the first time and is asking me 2 security questions, please help, what should i do?

    I cannot remember the answeres to my security questions, please help.

    You need to ask Apple to reset your security questions; this can be done by phoning AppleCare and asking for the Account Security team, or clicking here and picking a method, or if your country isn't listed in either article, filling out and submitting this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (105959)

  • I want to change my security question in my apple accnt. but the problem is, there is no Link shown that i could reset or change my security questions. please help!!

    i want to change my security question in my apple account. but the problem is, there is no Link shown that i could reset or change my security questions. please help!!

    You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (117399)

  • I was hacked i kept getting emails that some purshcaes were being made when no one was downloading them and i guess they hacked my apple iD because they changed the security question and now i cant change anything without the security question please help

    I was hacked i kept getting emails that some purshcaes were being made when no one was downloading them and i guess they hacked my apple iD because they changed the security question and now i cant change anything without the security question please help i want to reset the security question but i cant.

    You should contact Apple by phone as soon as possible. You'll need to change your Apple ID and all passwords.
    See Contact Apple at the bottom right of this page.
    Hope this helps.

  • HT5312 i forgot my secret question, please help me this problem. Thanks

    I forgot my secret question, please help me this problem. Thanks

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact
    And/or see the  More Like This  section on the right.

  • Hi I live in Iran and I forgot the answer to the security question please help me thanks

    Hi I live in Iran and I forgot the answer to the security question please help me thanks

    How to reset your Apple ID security questions.
    Go to appleid.apple.com, click on the blue button that says 'Manage Your Apple ID'.
    Log in with your Apple ID and password. (If you have forgotten your Apple ID password, go to iforgot.apple.com first to reset your password with a password recovery email)
    Go to the Password & Security section on the left side, and click on the link underneath the security questions that says 'Forgot your answers? Send reset security info email to [email]'.
    This will generate an automated e-mail that will allow you to reset your security questions.
    If that doesn't work, or  there is no rescue email link available, then click on 'Temporary Support PIN' that is in the bottom left side, and generate a 4-digit PIN for the Apple Account Security Advisor you will be contacting later.
    Next, go to https://getsupport.apple.com
    (If you see a message that says 'There are no products registered to this Apple ID, simply click on 'See all products and services')
    Choose 'More Products & Services', then 'Apple ID'.
    A new page will open.
    Choose 'Other Apple ID Topics', then 'Forgotten Apple ID Security Questions'.
    Click the blue 'Continue' button.
    Select the contact option that suits your needs best.

  • I do forgot my Apple ID security question, please help me how to rescue email address or how to reset Apple ID security questions?

    I do forgot my Apple ID security question, please help me how to rescue email address or how to reset Apple ID security questions?

    From another post:
    On your browser, whether Safari, Google Chrome or otherwise, navigate tohttps://appleid.apple.com.
    Once here click Manage your Apple ID button and sign into your iCloud account. Here, on the left side select Password and Security and this will list options on the right side. You should be able to see an option to reset your security questions.
    Note other links in realtion to rescue email address:http://support.apple.com/kb/HT5312
    If you cannot see or reset your security question, or even obtaining an error, then you would have to contact Apple directly: http://support.apple.com/kb/HE57. Here you would explain the issue, transfer you to an Account Security Agent who will be able to veritfy your identity and assist you in the resetting of you security questions.

  • I logged 3 times wrong security question. please help me

    I logged 3 times wrong security question. please help me

    Hey annamyle91,
    Thanks for the question. If you are having issues with the security questions associated with your Apple ID, follow these steps:
    If you forgot the answers to your Apple ID security questions
    http://support.apple.com/kb/HT6170
    Reset your security questions
    1. Go to My Apple ID (appleid.apple.com).
    2. Select “Manage your Apple ID” and sign in.
    3. Select “Password and Security” on the left side of the page.
    4. If you have only one security question, you can change the question and answer now.
    5. If you have more than one security question:
              - Select “Send reset security info email to [your rescue email address].” If you don't see this link or don't have access to your rescue address, contact Apple Support as described in the next section.
              - Your rescue address will receive a reset email from Apple. Follow its instructions to reset your security questions and set up new questions and answers.Didn't receive the email?
    After resetting your security questions, consider turning on two-step verification. With two-step verification, you don't need security questions to secure your account or verify your identity.
    If you can't reset your security questions
    Contact Apple Support in either of these circumstances:
              - You don't see the link to send a reset email, which means you don't have arescue address.
              - You see the link to send a reset email, but you don't have access to email at the rescue address.
    A temporary support PIN isn't usually required, but Apple may ask you to generate a PIN if your identity needs to be verified.
    Thanks,
    Matt M.

  • Apple ID I forgot my security question please help me

    Apple ID I forgot my security question please help me

    You might try to see if you can change your security questions. Start here, change your country if necessary and go tomanage your account > Password and Security.
    I'm able to do this, others say they need to input answers to their current security questions in order to make changes, I'm inclined to think its worth a try, you don't have anything to lose.
    If that doesn't help you might try contacting Apple through Express Lane (select your country, navigate to iCloud help and enter the serial number of one of your devices)

  • HT6170 hi,i forget secirity question please help me : ********

    hi,i forget secirity question please help me : *******
    <Edited by Host>

    Hi habibaljalil,
    Welcome to Apple Support Communities.
    The article linked below provides the available options for resetting your security questions.
    If you forgot the answers to your Apple ID security questions
    If you can't reset your security questions
    Contact Apple Support in either of these circumstances:
    You don't see the link to send a reset email, which means you don't have a rescue address.
    You see the link to send a reset email, but you don't have access to email at the rescue address.
    A temporary support PIN isn't usually required, but Apple may ask you to generate a PIN if your identity needs to be verified.
    I hope this helps.
    -Jason

  • HT201363 I've forgotten my security questions, please help me

    I've forgotten my security questions, please help me >> [email protected]

    You need to ask Apple to reset your security questions; ways of contacting them include phoning AppleCare and asking for the Account Security team, clicking here and picking a method for your country, and filling out and submitting this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (104051)

Maybe you are looking for

  • How can I remove video from itunes?

    Hi. I have a problem. I converted a file to watch on ATV. Then I put into iTunes and successfully watched it. Then deleted that file, but when I wanted to remove from iTunes i couldn't find it... Therefore it show up on ATV as a Home Video. How can I

  • To change assignment field (ZUONR) in accounting document when doing PGI

    Hi Gurus, I have one requirement. I will create one sales order with the reference of contract and then i will do the delivery and I will do PostGoodsIssue(PGI).In standard at that time it creates an accounting document in background.At that time I n

  • How i provide document to fm which i upload through fileupload ui

    Hi, Here in my application i need to store document in backend dms(Document Mangment System) server. I am using fileupload ui for downloading file but i have one problem in that. High i provide document to backend fm ,So further process can possible

  • Please help!! How to Make your website compatible with All Browsers

    i am having a problem viewing my website in google chrome on PC, but on google chrome on mac is fine. is there any way of sorting this out? please help steph xxxxx

  • Right click doesn't work in Address Book

    Not sure what's caused it, but I noticed recently that right-clicking from the trackpad on my MacBook Pro in Address Book doesn't.  If I do want to see right-click options, I have to hold down the control key.  The trackpad right-click works fine in