Two Dimensional Arrays Labwork PDF

Title Two Dimensional Arrays Labwork
Course Model-Based Software Development
Institution University College Cork
Pages 1
File Size 54.1 KB
File Type PDF
Total Downloads 10
Total Views 136

Summary

Two Dimensional Arrays Labwork...


Description

Software Development 2 Lab 1 - Individual Topic: Two Dimensional Arrays

Exercise 1. Write a program that creates and fills a two-dimensioned array of doubles called stats having three rows and four columns. Use an initialiser list to populate the array. Write a loop to total the contents of the array stats. Calculate the average value of the array. Output the total and the average.

Exercise 2. Write a program that reads 5 student’s test scores with 4 tests for each student, in the range 0 through 100, and print the following statistics to two decimal places: Validate the score, store it in a temporary variable until it is validated , so that a number outside the 0..100 range is not accepted, loop until a valid score entered. When result is valid store it in the array. Calculate the overall average of all the results and print it. For each of the 5 students print: Their average and the difference between the overall average score and their average score (this can be either positive or negative). Print an appropriate message congratulating them if their average is equal to or over the overall average or telling them their average is below the overall average. Count the number of students whose average is equal to or greater than the overall average. Print the number of students whose average score equals or exceeds the overall average at the end of the run....


Similar Free PDFs