Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello there , I need help with my assignment Plz. Clear answers . COMP 1900 - Fall 2018 Lab 7: Basic Arrays (15 pts) Number

Hello there , I need help with my assignment Plz. Clear answers . image text in transcribed
image text in transcribed
COMP 1900 - Fall 2018 Lab 7: Basic Arrays (15 pts) Number of Psople: Individual Dus: By the end of your lab session today. You MUST submit this before leaving the lab Grader: Please refer to the COMP 1900 syllabus for your lab TA. Questions about grading? Contact him/her first Coding Style: Use camelCase for variable names, use consistent indentation in your code, and include a reasonable amount of comments throughout your code. The TAs may deduct points for poor coding style Note the change in naming conventions for your fol Within the 1900 folder on your desktop, create a new folder named Lab 7LastnameFirstname. ers -this is to make grading easier for the TAs! 1. (5 pts) Within your Lab7 folder, create a new file named AlternatingSum.java. Write a program that allows the user to enter 5 int values and stores them into an array. Your program should then compute and display the alternating sum of those 5 elements. For example, in an array that contains (1.8,9,-3 4), the alternating sum would be computed as 1 -8+9-(-3)+4-9 Note that the array length is fixed at 5 for this problem. Howevet, your code should be written such that it works for an array of any length, simply by changing the length used during array instantiation. 2. (10 pts) Suppose you're training for a footrace, and you've been keeping track of your total miles run per week. You have data for several weeks now, and you want to determine whether you've been steadily increasing your weekly mileage. Within your Lab7 folder, create a new file named RunAnalyzer java. Write a program that allows the user to enter weekly miles run for a user-specified number of weeks. Your program should then determine and report whether the data is consistently increasing. (If the miles run in any week are less than or equal to the miles run in the previous week, the data is not consistently increasing.) The program should also compute and display the average miles run per week. This average mileage should be computed and displayed regardless of whether the data is consistently increasing. Underlined portions Here are two examples of what your program might look like when you run it. indicate user input Example 1: How nany weoks of data do you have? Enter iles run for week 1: Enter niles run for week 2: 3.2 Enter ailes run for week 3: 3.8 Enter miles run for week 4: Your weekly sileage is consistently increasing Average veekly mileage: 3.625

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students also viewed these Databases questions