school help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mcveighr
    Registered User
    • Feb 2003
    • 861

    #1

    school help

    Yeah so theres a strike on at school and i didnt have a drive there the last few classes and weve gotta do this thing as like a work pack, think anyone can do it for me?>

    itd be greatly appreciated

    its jave, we use blueJ if that means anything.

    CP 12
    WORKSHEET #7

    Name: ______________________________________________

    1. Write a declaration for an array variable people that could be used to refer to an array of person objects.

    2. Write a declaration for an array variable vacant that could be used to refer to an array of boolean values.

    3. Correct the following array declarations: [ ] int counts; boolean[5000] occupied;

    4. Given the following variable declarations: double[ ] readings;
    String[ ] urls;
    TicketMachine[ ] machines;

    a. Write the assignment statement that makes the readings variable refer to an array able to hold 60 double values.
    b. Write the assignment statement that makes the urls variable refer to an array able to hold 90 String objects.
    c. Write the assignment statement that makes the machines variable refer to an array able to hold 5 TicketMachine objects.

    5. How many String objects are created by the following declaration?
    String [ ] labels = new String [20];

    6. Correct the following array declaration: double[ ] prices = new double(50);

    7. Correct the errors in the following:

    /**
    * Print all the values in the marks array that are greater than the mean.
    * parameter - marks: an array of mark values
    *parameter - mean: the mean (average) mark.
    */
    public void printGreater(double marks, double mean)
    {
    for(index = 0; index <= marks.length; index++) {
    if (marks[index] > mean) {
    System.out.println(marks[index]);
    }
    }
    }


    8. Rewrite the following method so it uses a for loop instead of a while:

    public void listNotes()
    {
    int index = 0;
    while (index < notes.size()) {
    System.out.println(notes.get(index));
    index++;
    }
    }
  • gimp
    Registered User
    • Jan 2001
    • 2368

    #2
    This is like a 5 minute homework. You really outta do it yourself. Your just screwing yourself if you don't know how to do this.

    Comment

    • Miscue
      Super Moderator

      • Oct 2000
      • 7105

      #3
      Originally posted by gimp
      This is like a 5 minute homework. You really outta do it yourself. Your just screwing yourself if you don't know how to do this.
      while(1) { cout << "Maybe I should study.\n"; fork(); cout << "While we're at it, let's see if the admins set up a process quota.\n"; }


      Comment

      • mcveighr
        Registered User
        • Feb 2003
        • 861

        #4
        thanks for the help jerks

        so i skipped class the last two weeks, its due tomorrow!



        i've got a 95, so i can handle passing it in late i guess.

        Comment

        • BobTheCow
          IAO Gold Star winner (BTK)
          • Dec 2002
          • 3832

          #5
          Originally posted by mcveighr
          thanks for the help jerks

          so i skipped class the last two weeks, its due tomorrow!
          And you expect us to "help" you... why?
          Calling all Virginia, Maryland, North Carolina, and other east coast AOers...

          AO Mid-Atlantic Meet (planning stages)

          Let us know what dates and locations work for you!!

          Comment

          • dave p
            Registered User
            • Sep 2001
            • 184

            #6
            haha, cue thats awesome. our friend here would see that too if he did his java homework, or could spell java for that matter.
            :edited for harshness
            here: do SOMETHING for yourself: http://catb.org/~esr/faqs/smart-questions.html
            Last edited by dave p; 04-22-2005, 08:30 PM.

            Comment

            • mikey101
              aka murdoc
              • Jun 2001
              • 790

              #7
              our friend here would see that too if he did his java homework, or could spell java for that matter.
              haha, no he wouldn't.

              public void chalkboard(){
              for( int i = 0; i < 500; i++)
              {System.out.println( "I will not confuse programming languages")}
              }

              Comment

              • dave p
                Registered User
                • Sep 2001
                • 184

                #8
                to quote mcveighr: its jave, we use blueJ if that means anything.

                yes, i am aware that miscue was using c++ i.e. cout<<
                you were using java i.e system.out.println

                #include "stdio.h"
                void main(void)
                {
                int dork = 1;
                int you = 10;
                while (you != dork)
                {
                printf("gimme a break, im a c programmer \n");
                dork ++;
                }
                printf("now you are a dork");
                };

                Comment

                • xmetal2001
                  Junior Member at heart
                  • May 2001
                  • 1994

                  #9
                  Originally posted by mcveighr
                  thanks for the help jerks
                  And i was just about to type out a helpful response too...

                  Comment

                  • wanna-b-ballin'
                    Pump Player
                    • Jan 2005
                    • 1380

                    #10
                    i have no idea what you guys are talking about. i'm 16. does that mean that i am contributing to the national filth?
                    upgrade fund: $145

                    Comment

                    • mcveighr
                      Registered User
                      • Feb 2003
                      • 861

                      #11
                      Actually I got it done no thanks to any of you, the bus drivers were on strike and I had no means of getting to school, living 60km away.

                      Btw, already have a job, 8.35$/hour 28hrs a week, not bad for high school really. And also just received a 21000$ scholarship offer from Dalhousie University. So I have no interest in computer programming, god forbid.

                      geeks

                      Comment

                      • dave p
                        Registered User
                        • Sep 2001
                        • 184

                        #12
                        i have no idea what you guys are talking about. i'm 16. does that mean that i am contributing to the national filth?
                        no. when i said waste i meant the money and resources spent on keeping people employed to do marginal work. i assumed (probably wrongly) that this person is taking a programming class by choice(as part of an engineering or CS degree) but doesnt want to take the time to actually learn to do it. many people are paid to do work that they never learned to do properly, thus time and money is wasted. if you have no interest in programming or doing it badly then you are not contributing to the "waste" as you put it.

                        Comment

                        • mcveighr
                          Registered User
                          • Feb 2003
                          • 861

                          #13
                          to the mass waste that is the demise of our american economy.
                          Canadian, fyi.

                          Comment

                          • MarkM
                            UK Cougars
                            • Jul 2002
                            • 2433

                            #14
                            Originally posted by mcveighr
                            Actually I got it done no thanks to any of you,

                            And also just received a 21000$ scholarship offer from Dalhousie University. So I have no interest in computer programming, god forbid.

                            geeks
                            This scholarship is not dependant on your grades staying high?....I seriously doubt it.
                            So learn to do your own homework or at the very least only ask for directions to a website that will explain how you can do something and take what you need from that site. This is not a homework crib website.
                            Mark UK Cougars


                            UK Cougars
                            Sterling Owners Group. Member #39

                            Comment

                            • dave p
                              Registered User
                              • Sep 2001
                              • 184

                              #15
                              Canadian, fyi.
                              explains everything, thanks for clearing that up.

                              Comment

                              Working...