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.
-
You purchase 100 shares of stock at $100 ($10,000); the margin requirement is 40 percent. What are the dollar and percentage returns if a. You sell the stock for $112 and buy the stock for cash? b....
-
What is the basic purpose of a code of ethics for a profession?
-
A purchase invoice for \($1,200\) with credit terms 2/10, n/30, and a return of \($300\) received by the seller prior to payment, is paid within the discount period. A check should be sent for (a)...
-
Selected transactions for Essex Company during July of the current year are listed in Problem 5-3B. In Problem 5-3B. The following were selected from among the transactions completed by Essex Company...
-
How can budgeting apps benefit everyone?. How can budgeting apps benefit everyone - regardless of life stage, age, level of income and debt? Research available budgeting apps and give a free one a...
-
Shauna Coleman is single. She is employed as an architectural designer for Streamline Design (SD). Shauna wanted to determine her taxable income for this year. She correctly calculated her AGI....
-
Which degree does China puts high expectations on "new productive forces" manifest a post-Reform divergence from (or continuation of) the Reform era? Based on rationales mentioned in the news, how...
-
Explain the applicability of statistical sampling to (a) the general standards and (b) the first field work standard.
-
You are the lead systems developer for your local university and have been told that the athletic department would like to modernize their online ticket sales and ordering system for sporting events....
-
Delineate the differences between components, entities, items, and CIs and their Entity Relationships (ERs)?
-
Contrast judgmental and statistical sampling.
-
What do you think led mankind to embark upon the study of Artificial Intelligence? Which fields of study particularly fed into it? What human desires did the study of Artificial Intelligence seek to...
-
Ellis first consumed alcohol on weekends when he was age 14. He now had a high tolerance and would drink a pint of liquor to "get drunk" every 2-3 days or sometimes more often. He has had occasional...
-
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...
-
Suppose the exchange rate for the Swiss franc is quoted as SF 1.50 in the spot market and SF 1.53 in the 90-day forward market. a. Is the dollar selling at a premium or a discount relative to the...
-
Can the numerical instability be avoided by simply using higher precision (larger number of decimal digits) in the computations, thus reducing the round-off error? If not, what would be the effect of...
-
Use the Neumann analysis to determine stability properties of the scheme applied to the linear convection equation \(u_{t}+c u_{x}=0\), where \(c\) is a positive constant. -u At u - u -1 +c = 0 .
Study smarter with the SolutionInn App