Fill in the Blanks and Win a Prize!

Well maybe no prize but I would be grateful. Our class was assigned 2 array example programs with key bits of code missing. Iv'e understood everything pretty well up till this point, but arrays have me confused. I've spent hours on these things but always wind up with a compiling error of some sort. The instuctions and intended output are commented on the top, any help would be greatly appeciated.
Here is program 1.....
Sample Output:
*** start program ***
Average Integer Score: 18
Count of Integers Less Than Average: 3
*** end program ***
Input:
An integer array of ten numbers: 20,17,9,29,19,9,19,20,20,19
Compile-time array with initialization list of numbers.
NOTE: In main() function
Processing:
Function: computeAverage(final int[], final int):int
countLessThan(final int[], final int, final int):int
Output:
Function: display(final int, final int):void
Display as shown in sample output.
public class Arrays1D_Ex02
public static void main(String [] args)
// finalants
final int SIZE = _____;
// local data
int intAverage = 0;
int count = 0;
// data declaration(s) & initialization(s)
// array data: use data from sample output above
// TODO: declare & initialize array of ten integers
int numbers[]={___________________________________};
// start the program
System.out.println( "*** start of Arrays1D_Ex02.java program ***");
System.out.println();
// Compute & return integer average of the array
// TODO: call computeAverage()function,
// which returns average of numbers
intAverage = computeAverage(numbers);
// Compute & return count of array values less than integer average
// TODO: call countLessThan() function,
// which returns count of numbers less than the average
count = countLessThan(numbers, intAverage);
// display the required output
// TODO: call display function,
// passing integer average & count of numbers less than average
display(intAverage, count);
// terminate the program
System.out.println();
System.out.println();
System.out.println( "*** end of Arrays1D_Ex02.java program ***");
return;
} // end main()
// Function Name: display(final int, final int):void
// Purpose: to display integer average & count less than average
// Values received: integer average, count
// Values returned: <none>
// Notes:
// display label "Average Integer Score: "
// display integer average
// display label "Count of Integers Less Than Average: "
// display count
// TODO: code the display function
private static void display(final int average, final int count)
// display labels and data
System.out.print(_________________________);
System.out.println(_____________);
System.out.print(_________________________________);
System.out.println(___________);
// TODO: code the computeAverage function
private static int computeAverage(final int[] numbers)
// local variables (if needed)
int sum = 0;
int intAverage = 0;
// compute sum
for(int i = 0; i < numbers.length; i++)
sum ___ numbers;
// compute integer average
intAverage = sum / numbers.length;
// return integer average
return __________;
// TODO: code the countLessThan function
private static int countLessThan(_________________,
// local variables (if needed)
int count = 0;
// count number of values less than average
for(int i = 0; i < numbers.length; i++)
if(numbers[i] ___ average)
count++;
// return count
return count;
} // end class
-------------------Here is program 2------------------------------------------------------------------------------------------------
Sample Output:
*** start program ***
Number Count
1 1
2 2
3 5
4 2
5 3
*** end program ***
Input:
An integer array of 13 numbers: 3, 4, 5, 3, 2, 1, 3, 4, 5, 3, 2, 3, 5
An integer array of 5 counts intialized to all 0.
Compile-time arrays with initialization list of numbers.
NOTE: In main() function
Processing:
Function: countValues(final int[], final int, int[]):void
The values in the numbers array are counted and the correct cells of the count array are increment.
Output:
Function: display(final int[], final int):void
Display as shown in sample output.
public class Arrays1D_Ex03KEY
public static void main(String [] args)
// finals
final int VALUES_SIZE = 13;
final int COUNT_SIZE = 5;
// local data
// data declaration(s) & initialization(s)
// array data: use data from sample output above
// TODO: declare & initialize array of ten integers
int [] numbers = ________________________________;
int [] counts = new _____________________________;
// start the program
System.out.println("*** start of Arrays1D_Ex03.java program ***");
System.out.println();
// Compute count of values
// TODO: call countValues() function
// passing numbers array, array size, count array
countValues(_____, VALUES_SIZE, _____);
// display the required output
// TODO: call display function,
// passing count array & size
display(_____, COUNT_SIZE);
// terminate the program
System.out.println();
System.out.println();
System.out.println( "*** end of Arrays1D_Ex03.java program ***");
return;
} // end main()
// Function Name: display(final int[], final int):void
// Purpose: to display count of values
// Values received: array of counts, array size
// Values returned: <none>
// Notes:
// display column headings using manipulators
// in a 'for' loop, print the number and count
// TODO: code the display function
private static void display(______________, __________________)
// print column headings
System.out.print("Number");
System.out.println("\tCount");
// print detail lines (format on one line, display on next)
// use a 'for' loop
for(int i = 0; i < size; i++)
// TODO: print out the number
System.out.print(___________);
// TODO: print out the count
System.out.println( "\t" + _____________);
// TODO: code the countValues function
private static void countValues(________________,
final int size,
// TODO: determine value and increment count
// use a 'for' loop
// HINT: use nested arrays & their indexes

You will (usually) get better help with homework if you make some effort to complete it, then post your problems. Just posting homework often causes people to reply with flames. Also, when posting code use the code and /code tags as explained in the Formatting Help link (right above the text box when you compose a post).
So try filling in your blanks and comment the lines where you have done so. Then post the smallest amount of code that should compile, but does not, and be sure to post the full exact error messages.
Another tip, compile code in small steps - write some then compile it. You will have to write enough code to include dependent variables and methods but it is much easier to solve 3 compiler errors than 30.

Similar Messages

  • Fill in the blank and advanced actions

    Hi everyone,
    I'm wondering whether this can be accomplished with fill in the blanks standard quiz question or whether I need use Advanced Actions.
    I have a graphic of a form that needs to be correctly filled out with specific values. There are multiple fields on each graphic/slide. I want all fields to be filled in correctly to get the question (slide) correct. I also want to be able to adjust to fields to have an invisible border and no inset so they are invisible on top of the the graphic.
    Is this possible using a standard fill in the blank question slide (I couldn't really figure it out) or is this something that I should be looking at Advanced Actions to accomplish? If Advanced Actions will be required, does anyone have an example?
    I appreciate the assistance!

    Hello,
    With the default FIB you are a bit limited especially concerning the field to be filled in. Advanced actions will give you more control. Would need some more details, but I did blog about constructing all kinds of questions. Here is one link to a post that has a FIB question:
    Extended TextArea widget for custom questions
    This will not be exactly what you are looking for, but perhaps give you some idea about what is possible. Are you familiar with advanced actions?
    Lilybiri

  • How do I download a pdf, fill in the blanks and then email

    How do I download a pdf file, change it so I can fill in the blanks, then email?

    If the form doesn't have any fillable form fields, then you could use the text tool under "fill and sign" in Adobe Reader XI.
    If you have an older version, you cannot do this.

  • How can I fill in the blanks on a lease?

    I found the file, now I'm trying to use the "Tool" to fill in the blanks, and it won't allow me to.

    Hi Atiimkwabena,
    I suppose you are trying to fill the PDF form using Adobe Reader. (Correct me if I'm wrong)
    If yes, then that form might not be reader rights enabled. Adobe Reader being a read only software for PDF is only meant for reading and saving the blank copy of PDF. If you want to edit something in the PDF then the creator has to enable user rights(commonly called as Reader Extend rights) so that you can save the filled PDF. That can be done by Adobe Acrobat.
    I would request you to kindly contact the author of the PDF to enable the user rights and send it again.
    Hope this helps.
    Regards,
    ~Pranav

  • Hello i just got a suspect sms telling me that a have won a prize from apple and have to go to hhp://apple.ni.rc9.cc/?p=01131641739832 and fill in a code to win a prize is this a scam? Or does anyone know about this?

    Hello i just got a suspect sms telling me that a have won a prize from apple and have to go to hhp://apple.ni.rc9.cc/?p=01131641739832 and fill in a code to win a prize is this a scam? Or does anyone know about this?

    How to delete text messages from the iPhone | How To - CNET

  • Issue with fill in the blank field and back button.

    I am working in CP4 AS2.  I have create a page of fill in the blank fields to simulate filling in a form.  On the next slide, I show the answers by extracting the variables into text boxes.  I have a back and a next button and instruct the user to review their answers and if incorrect, to select the back button in order to reenter the data.  I have the back button set to jump to the previous slide by number (i've tried previous, last slide, etc...)
    The flash movie freezes when I select the back button.  I think flash is having trouble going back to the fill in the blank fields from the displayed variables.  Any ideas? or work arounds for this.  The idea solution would take them back to the page with the data already in the fields so they could correct the errors only and then return to the review page.
    Thanks
    Scott

    Hi there
    Is scoring enabled on these? If so, perhaps your quiz settings are preventing backward movement.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • I can't draw straight lines for fill-in-the-blank on my tests and worksheets. The "draw it yourself choice makes big fat lines and takes a lot of manipulation. Do I have to draw them myself with a pen and a ruler?

    I can't draw straight lines for fill-in-the-blank on tests and worksheets. The draw-it-yourself ooption gives me thick lines and is time-consuming. So, after all these years, do I have to go back to using a ruler and a pen?

    In Pages v5.0.1, the straight lines are already drawn for you in the Shape Tool. Before we go there, select Menu > View > Show Ruler.
    When you click on Shape in the Pages toolbar, the top left line is straight. Click it. It will drop into your document in a 45 degree angle. Grab the lower left selection grip and drag it up and to the right to position the horizontal line in the length of your choice. Use the Format: Style tab to manage the stroke weight. You can also choose Menu > Edit > Duplicate Selection (command+D) as a productivity tool.
    If you move from the Format: Style tab to the Arrange tab, you can compare the start and end points with where you want the line positioned on the ruler. Once you have it positioned, notice the Lock button, also on the Format: Arrange tab.

  • Fill-In-The-Blank drop-down list in HTML5 output

    I'm working in Captivate 7 (WIN) and developing for both SWF and HTML5 output, viewing courses in IE9 for Windows and Safari on iPad.
    I have a quiz containing a fill-in-the-blank question, using a drop-down list to select the correct answer, however it does not display the drop-down button or function correctly in HTML5 output (see screenshot).
    The issue began after updating to Captivate 7 version 7.0.1.237. The drop-down list worked prior to the update I installed recently. I'm viewing the published course locally and in the LMS, and it does not work in either.
    I've not read in the help documents that drop-down list questions are an unsupported question type in HTML5, and so I'm wondering if this is a bug that needs to be reported. Has anyone encountered this issue?

    Do you need scoring? There is a Scrolling Text interaction (more control, you can empty the variable and it will be displayed empty) but it is a non-interactive one, no score possible except by adding other interactive objects.
    Custom Short Answer Question - Captivate blog

  • Fill in the Blank Problem

    Alright, I'm new to captivate and all that, but I have a slight problem with fill in the blank quizes that I can't seem to figure out. What I want to do is create fill in the blank quiz questions that already have an incorrect answer in the blank that, after a user attempts to answer the question, returns to the original incorrect answer. So, for instance, if I had a fill in the blank that read "(Cats) go woof woof" where the parentheses represent the blank, I would want 'Cats' to reappear after a user incorrectly filled in that blank. As it is, it seems to keep the user text. I've tried checking and unchecking the retain text button in options, but that doesn't seem to do it. Any help would be much appreciated.

    Re-reading the question, I realize I may not being clear? I want the example text in a text entry box to re-appear after a user types in an answer and is given the failure or success message. Not possible? Thanks in advance.

  • How can I make a fill-in-the-blank question with partial score?

    I need to make an evaluation test with some questions. Some of them is a fill-in-the-blank question and it has to have partial score.
    I have:
    4 fields (text entry boxes) with: retain text, validate user input;
    also checked include in quiz, with points, add to total and report answers;
    an action that disables the 4 fields when the student is on review mode (otherwise it would be possible to change the answer after submitting the answers);
    Problems:
    I can't give feddback to the student: if i turn on success/failure captions the student will see them while answering, if i turn them off he wont know what's the right answer. I tried to use a shape to hide captions but the captions are always in front of the shape;
    When reviewing the test something happens and the second time we see the results slide it assumes that the fields in the FIB question are empty;
    Notes: it will be used in Moodle, as a scorm package
    What can I do?

    I have a test with some questions (multiple choice, FIB, matching, etc). I have just one button to submit all the answers, and after submiting the student can see his score and review the test to know where he failed. He can't answer again. However, he can change the answer multiple times before submiting.
    "if i turn on success/failure captions the student will see them while answering" - before submitting
    "if i turn them off he wont know what's the right answer" - after submitting
    My results page is the default. I didn't use any variable. When i go to the results page after reviewing the test all the entry boxes are "wrong".

  • How do I create a "fill-in-the-blanks" worksheet?

    I am a teacher that works with students who have various needs - some of them have a difficult time writing with a pencil. There are tons of great teacher resources out there that I can print and use for students to write on. However online worksheets are another story. I came across the idea of using AdobeForms as an adaptation to writing.
    For example...
    Yesterday was _____________________. Tomorrow will be _________________.
    Or even:
    My n__me is _____________.
    Can anyone help me? Right now the only way I can do a fill in the blank is to have a field below a blurb of text, but I don't know how to do a field in between text.
    Help!

    If I were doing this I wouldn't use FormsCentral. I would create the layout in InDesign or a word processor and convert to PDF using Acrobat. I'd then add the form fields in Acrobat where the blank spaces are. You can limit the number of characters in a field and a lot more. Do you have Acrobat available to you? If not another option is to use the free OpenOffice /NeoOffice and create your layout and form fields and then export to PDF.

  • Fill-In-The-Blank drop down space issue

    Hi,
    I have Captivate 7 and am putting in a number of Fill-In-The-Blank quiz questions and using the drop down but when the user makes the selection, not all the words are shown, it cuts off the last few letters and in some cases where I have a one character you can't see any of the answer.
    Any ways around this? (Other than not using one character)

    Do you need scoring? There is a Scrolling Text interaction (more control, you can empty the variable and it will be displayed empty) but it is a non-interactive one, no score possible except by adding other interactive objects.
    Custom Short Answer Question - Captivate blog

  • Using wild card with Captivate 5 ( fill in the blank)

    I am training software package that requires many fill in the blanks besides the login screeen.  If I were to recording the actions using Captivate 5 record, I think,  I can only use a demonstration recording as oppsed to having my students interact with the product by filling in the blank. For example, my product asks for a login. When I login to demonstrate how it should be done, the product reponds correctly.  By my student is limited to watching as opposed to interacting.  While login is not such a big deal, there are several other areas where the same concept applies.  Ideally, I wish to use wild cards in fill in the blank so that any name or information can be used to interact with Captivate and move the slide along.    Is this possible, and if so, how?

    I think Lilybiri may be misinterpreting your use of the term "wildcards" to mean using them in the programming sense.
    Perhaps you are referring to the characters that appear in a typical Password field to hide what the user is actually typing?
    If so, the text field object in Captivate has an option to use these password characters so that the user's typing characters are hidden.  The characters used are asterisks, which are what some people refer to as wildcard characters.

  • Please help me fill in the blank

    Our own �innovative� Chunk Sort algorithm is designed for sorting arrays that consist of a few presorted chunks. The idea is to find the next chunk and merge it with the already sorted beginning segment of the array. We will implement this algorithm iteratively, without recursion.
         Fill in the blanks in the following merge method:
    * Precondition: 0 <= m <= n
    * m == 0 or a[0] <= ... <= a[m-1]
    * n == m or a[m] <= ... <= a[n-1]
    * Postcondition: the values a[0] .. a[n-1] are arranged
    * in the ascending order
    private static void merge(int a[], int m, int n)
    // If any of the two segments is empty, do nothing:
    int i = 0, j = m; // starting indices into the two segments
    // Allocate a temporary array temp to hold n elements
    int k = 0; // starting index into the temporary array
    while (i < m && j < n)
    if ( ______________________ )
    else
    k++;
    // Copy remaining elements:
    while (i < m)
    k++;
    while (j < n)
    k++;
    // Copy temp back to a:
    for ( _____________________________________ )

    Your teacher needs to teach you to Teach
    Yourself[b]. People can't always tell you the answer
    to everything. There comes a time in life when you
    just have to break down and fire up that brain cell.
    Not quite, you need at least two neurones to make a synapse. Unless, we talking about extrapyramidal pathways. Then termination on peripheral skeletal muscle is what is going on. Certainly, that is required in this case as the OP doesn't appear motivated enough to pick up a book.

  • Cannot 'Unmark Blank' for FIB Questions after Upgrade from CP4 to CP5 (Fill in the Blank)

    Hi Everyone!
    I'm having trouble editing a fill in the blank question that was upgraded from CP4 to CP5.
    The problems is I cannot see where the blank is.  Not the blank in my sentence, I have that, but the entry box. When running the course the blanks are at the TOP LEFT corner fo the slide.
    but when creating the course I can't see where the blanks are, to move them.....
    So to Troubleshoot, I thought I'd re-construct the answers, I clicked the sentence, and clicked unmark ... but it does not unmark....
    <EDIT> Okay I got it to unmark, sorta, but not really. Now I have three answer boxes on the test in run mode, but cant see ANY in CP5 when building it. </EDIT>
    Hmmmmm
    Anyone got ideas?
    (re-constructing the question on a new slide is not desired, I have hundres of questions, considering my 30 courses.
    Thank you!
    Greg

    Hello,
    Sorry, but I do not understand your question quite well, it is an editing issue when upgrading. Perhaps it would help if you posted some screenshots?
    And to be sure: did you install the patch for CP5 released in December?
    Lilybiri

Maybe you are looking for

  • Rebuilding indexes after importing...

    My coworker and I are discussing whether it is necessary, or advised, to rebuild indexes after an import of the schema. My thinking is that the index data is put into fresh blocks thereby creating a very flat index tree without any fragmentation. But

  • Acrobat Pro 10.1.1 MsAccess 2010 64 bit

    I'm positive I trialed Acrobat Pro X and it worked in microsoft access 2010 64bit. I have since purchased APX only to discover there is no acrobat tab in msaccess.  I've tried repatching APX and re-installing.  I can only find documentation indicatin

  • Low resolution of video call. lack of focus on rea...

    I've got HTC One m7 which has both cameras capable of at least 720p yet maximum resolution I got using front facing camera was 7**x4** so less than 720p. another Problem I noticed was lack of focus using rear camera, at all distances the picture was

  • Final cut to motion

    am trying to "send to motion" a sequence (actually just audio) from fcp to motion and keep getting a "general error" message and motion wont launch. help please....

  • EDI Output Type error

    Hi, I have an output type ZSVC for sales contracts of a type. When I try to assign the output type ZSVC before saving the sales contract, I get the following error, Maintain outgoing EDI-connection data for partner Any idea what it could be. I have m