C++ Lab 4.1.1 Multi-dimensional arrays of variable length Objectives Familiarize the student with: Scenario creating two-dimensional
Fantastic news! We've Found the answer you've been seeking!
Question:
C++
Transcribed Image Text:
Lab 4.1.1 Multi-dimensional arrays of variable length Objectives Familiarize the student with: Scenario • creating two-dimensional arrays; • accessing two-dimensional arrays; • creating variable-length arrays. Write a program that will calculate the average grade of a student and print a summary report. The following rules apply: . a student may sign up for any number of courses; • during a course, the student may receive any number of grades; grades are integer numbers in the range [1..5]; the final grade for a course is the arithmetic mean of all grades received during the course; • the overall final grade is the arithmetic mean of the final grades received for all the courses the student has taken. All floating-point numbers printed by the program should be limited to two decimal points. The input is given in the following form: C N1 G11 G12.. Gin N2 621 622 62n Ne Gel Ge2.. Gcn Where: C Nx number of courses taken by the student number of grades received during course number x Gabb-th grade received in course number a Example input 3 42345 245 3445 Example output Course 1: final 3.50, grades: 2 3 4 5 Course 2: final 4.50, grades: 4 5 Course 3: final 4.33, grades: 4 3 5 Overall final 4.11 Lab 4.1.1 Multi-dimensional arrays of variable length Objectives Familiarize the student with: Scenario • creating two-dimensional arrays; • accessing two-dimensional arrays; • creating variable-length arrays. Write a program that will calculate the average grade of a student and print a summary report. The following rules apply: . a student may sign up for any number of courses; • during a course, the student may receive any number of grades; grades are integer numbers in the range [1..5]; the final grade for a course is the arithmetic mean of all grades received during the course; • the overall final grade is the arithmetic mean of the final grades received for all the courses the student has taken. All floating-point numbers printed by the program should be limited to two decimal points. The input is given in the following form: C N1 G11 G12.. Gin N2 621 622 62n Ne Gel Ge2.. Gcn Where: C Nx number of courses taken by the student number of grades received during course number x Gabb-th grade received in course number a Example input 3 42345 245 3445 Example output Course 1: final 3.50, grades: 2 3 4 5 Course 2: final 4.50, grades: 4 5 Course 3: final 4.33, grades: 4 3 5 Overall final 4.11
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
In your recent assignment, you have approached Sulaman Emas Sdn Bhd (SESB) to establish a better understanding of the business processes and the applications of internal control procedures in the...
-
Write a Java program that will calculate the average value of array elements.
-
Write a computer program that will calculate the optimum value of the orbital exponent k for the H+2 trial function (13.54) for a given R value. Have the program calculate W1 + 1/R [where W1 is given...
-
Comment on the following statement: A financial projection presents an organizations expected results, given a hypothetical assumption.
-
Here is a forecast of sales by National Bromide for the first four months of 2010 (figures in $ thousands): On the average 50% of credit sales are paid for in the current month, 30% are paid in the...
-
True or False: In a least-squares regression, the response variable is normally distributed with mean y \x and standard deviation .
-
Shareholder value is cash-oriented. Do you agree with this statement? Give reasons.
-
Lemontree Rentals, Inc.'s, unadjusted and adusted trial balances at june 30, 2016, follow. Requirements 1. Make the adjusting entries that account for the differences between the two trial balances....
-
The following cost data for the year just ended pertain to Sentiments, Inc., a greeting card manufacturer Direct material $2,200,000 Advertising expense 99,000 Depreciation on factory building...
-
Given two arrays each of length n, arr1, and arr2, in one operation, any two elements of an array can be swapped. This can occur any number of times. Find the maximum possible sum of i*(arr2[1]-...
-
Martha, who is single, has a main home in Houston. In the current year, she rented it for 10 days, receiving $5,000 in rental income. Martha paid $20,000 in mortgage interest and $10,000 in real...
-
What trade policy instruments does Japan's government currently employ? Which theory/theories of international trade does this use of trade policy instruments support? Explain using illustrative...
-
Is a undecided major still acceptable these days as far as when you finish school? Do jobs accept that type of degree?
-
You receive an e-mail from a consumer-advocacy group asking you to write to a large bookstore. In it, you are to complain about its habit of running local bookstores out of business by selling books...
-
Rohan decides to invest in bonds instead of stocks because he has heard that bonds are a lower-risk investment. He uses the bond's credit rating to make his investment decisions. What is true about...
-
How many shares will need to be issued to raise the desired amount of capital? Zach Kirkhorn, CFO 8,393.49 Incorrect. Hint: how many shares at the current price equal to the amount being raised? How...
-
Question: Prepare projected profitability estimates for the first five years (details are given below) CKC Pharmaceuticals Ltd is embarking upon a bulk drugs project. The following information and...
-
The outer loop controls the number of students. Note that the inner loop of this program is always executed exactly three times, once for each day of the long weekend. Modify the code so that the...
-
Verify that the Ep expression (17.58) holds for 1, 3-butadiene.
-
True or false? (a) The reduced mass of a two-particle system is always less than m1 and less than m2. (b) When we solve a two-particle system (whose potential-energy V is a function of only the...
-
(a) Consider some permutation of the integers 1, 2, 3, ( ( ( ( n. The permutation is an even permutation if an even number of interchanges of pairs of integers restores the permutation to the natural...
-
Figure P18-39 shows two similar unit pulse waveforms. The only difference is that the first pulse is positive from \(-T / 2\) to \(T / 2\), while the second pulse goes from \(+\mathrm{A}\) to...
-
Describe the principal types of audits performed by independent auditors and indicate the established criteria and primary users of each tyr
-
Contrast the activities of independent, internal, and governmental auditors.
Study smarter with the SolutionInn App