11/14/2022 0 Comments Jgrasp updateThe terms outer loop and inner loop mean you have nestedĪfter all breeding cycles have been played, you will need an if statement to compare the Mosquito 1 score to the Mosquito or the other exceeds 3 milligrams of food. Within each cycle, you will have an inner loop where each mosquito will continue to feed until one Since we are running the game for a month and each feeding cycle lasts 3 days, you will need an outer loop thatĭivides 30 by 3. Jgrasp update generator#If the random generator generates a 3, the comment will be Chug. If the random generator generates a 2, the comment will be Gulp. If the random generator generates a 1, the comment will be Sip. Because this is a game, we will have a sports commentator Milligrams of blood the mosquito will drink in a bite. Import the random class which will be used to generate 3 possible numbers from 1 to 3 that represent how many The only input that you are to get for the mosquitos are their names. Thankfully, a mosquito’s lifespan is only a month or two at the most. They usually have to bite several times to get their fill, and a chemical within their body tells them when they areĪfter the mosquito is full, she goes off to rest for up to 3 days before laying eggs.Īfter laying eggs, the feeding cycle starts all over again. Only the females need to bite humans/animals/ birds because they need protein to make eggs. They can consume up to 3 times their body weight in the blood that they acquire from their victims and still fly. They usually weigh between 2 and 2.5 milligrams. It's Summer and we will be bitten by mosquitos so let’s play a game to see which of 2 “hangry” mosquitos scores the Jgrasp update code#NOTE: When submitted, all code is debugged and runs correctly for all test cases otherwise the gĮs otherwise the grade is a 32.5 regardless of which requirements are met after the code is debugged. Requirements or a message for a tie if needed.Ī printf statement is used to print the table headingsĪ printf statement is used to print the table detail linesĬurly braces are paired and indented correctlyĪ comments area is used at the top of program to indicate the programmer, version, and purpose of the programĬomments are included to document how the program works Score and display the name of the mosquito with the highest score as shown in the program The sum for each mosquito for each feeding cycle will need to be reset to 0 after one feeding cycle If a mosquito extracts 3 mg, then a message should print out that says “Chug" and 3 mg should be If a mosquito extracts 2 mg, then a message should print out that says “Gulp" and 2 mg should be If a mosquito extracts 1 mg, then a message should print out that says “Sip" and 1 mg should beĪdded to the sum for that cycle for the mosquito and for the overall score for the mosquito. Scanner or JOptionPane is used to gather user inputĪ random generator generates 3 values from 1 to 3 that represent 1 mg, 2 mg, or 3 mg of blood extracted.Īn outer loop counts the 10 feeding cycles in the month of JuneĪn inner loop that is controlled by the mg extracted until one or the other mosquito has scored at least Variables are declared with correct data type and use camelCaseĬONSTANTS are declared with correct data type and use ALL_CAPS ITP 120 Grading Rubric Programming Assignment 2
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |