CISY 103 – Lab02 CISY 105 – Lab07 Chapter 7 Purpose  To use a partially filled array to hold int or double data entered by the user  To calculate the average of an array of int or double Overview...

1 answer below »
need to different copies for the same lab


CISY 103 – Lab02 CISY 105 – Lab07 Chapter 7 Purpose  To use a partially filled array to hold int or double data entered by the user  To calculate the average of an array of int or double Overview Collect a series of int or double values from the user until the user enters a sentinel value when done. Display back to the user what they entered. Calculate and display the average value. Technical Items  For this lab you can write 1 file that has a main method  You must use an Array [ not ArrayList ] of int or double  Your Array must be able to hold up to 10 items  You must use a sentinel value so the user can indicate they have finished entering data  Do not allow the user to overfill the array (see Sample Run 3)  If a user enters no data, note that (see Sample Run 2)  On the output back to the user display a header and show the index  After the displayed array show the average Rubric  name in a comment at the top (2 points)  Class/file name (5 points) (naming convention starts with upper case, subsequent words upper case)  Variable Declarations (15 points) (datatypes and naming convention starts with lower case, subsequent words upper case, variables declared at top of method)  Declaration/Allocation of an Array [ not ArrayList ] of 10 int/double items (10 points)  Sentinel controlled loop for entry of data from the user (20 points)  Not allowing the user to overfill the array (see Sample Run 3) (10 points)  For the output back to the user display a header (5 points)  For the loop that outputs back to the user their values, display the index and the value from the array(15 points)  Calculate and show the average of the values entered (5 points)  If a user enters no data, note that (see Sample Run 2) (5 points)  proper indenting (8 points) · body of class indented, body of methods indented, body of loop indented Deviations Instead of fruit sold which is used in the samples, you can use a different “theme” as long as you meet the technical requirements of the program. Example: Puppies bought or Zombies killed [ keep it clean and professional please] Sample Run 1 (no fruit) Enter the number of fruits sold(-1 when done): -1 What? you didn't sell any fruit! Sample Run 2 Enter the number of fruits sold(-1 when done):81 Enter the number of fruits sold(-1 when done):60 Enter the number of fruits sold(-1 when done):75 Enter the number of fruits sold(-1 when done):58 Enter the number of fruits sold(-1 when done):32 Enter the number of fruits sold(-1 when done):5 Enter the number of fruits sold(-1 when done):94 Enter the number of fruits sold(-1 when done):-1 Fruit # Sold ===== ====== 0 81 1 60 2 75 3 58 4 32 5 5 6 94 Average Fruits Sold: 57.9 Sample Run 3 (filled array) Enter the number of fruits sold(-1 when done):432 Enter the number of fruits sold(-1 when done):257 Enter the number of fruits sold(-1 when done):659 Enter the number of fruits sold(-1 when done):854 Enter the number of fruits sold(-1 when done):715 Enter the number of fruits sold(-1 when done):336 Enter the number of fruits sold(-1 when done):954 Enter the number of fruits sold(-1 when done):157 Enter the number of fruits sold(-1 when done):511 Enter the number of fruits sold(-1 when done):27 Array is full! Fruit # Sold ===== ====== 0 432 1 257 2 659 3 854 4 715 5 336 6 954 7 157 8 511 9 27 Average Fruits Sold: 490.2 Submitting the Lab You must submit the .java file on Canvas. Cheating and Late Policies Please see the syllabus for the Cheating Policy (don't cheat) and the Late Policy (-10 pts per calendar day) Page 1
Answered Same DayMar 27, 2021

Answer To: CISY 103 – Lab02 CISY 105 – Lab07 Chapter 7 Purpose  To use a partially filled array to hold int or...

Aditi answered on Mar 28 2021
125 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here