A class Student can have three member variables: name, age, and an array of grades of two exams marks [5]. The grades can be integers (0-100), doubles (0.0-100.00) and characters (A-F, where F denotes grades less than 50). Write a class template to accommodate all five types of grades. The class template must have two constructors (no-arg constructor, and a constructor that takes 7 parameters: name, age and grades of 5 exams). Write a  c++ function to read an object from console, and another function to print the object to the console. Implement the class template by creating three objects with three different types (int, double and char) of grades, and printing the objects on the console.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 2CP
icon
Related questions
Question

A class Student can have three member variables: name, age, and an array of grades of two exams marks [5]. The grades can be integers (0-100), doubles (0.0-100.00) and characters (A-F, where F denotes grades less than 50). Write a class template to accommodate all five types of grades. The class template must have two constructors (no-arg constructor, and a
constructor that takes 7 parameters: name, age and grades of 5 exams). Write a  c++ function to read an object from console, and another function to print the object to the console. Implement the class template by creating three objects with three different types (int, double and char) of grades, and printing the objects on the console.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Knowledge Booster
Introduction to Template
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT