Question
The size of the STUDENT data type is the size of all the component data types inside the class. So, the size of the student
The size of the STUDENT data type is the size of all the component data types inside the class. So, the size of the student is the sum of the size of the Id Number, First Name, Last Name, and GPA.
See if you can calculate the size of STUDENT manually. What is your answer? Now let us write a program to compute the size of STUDENT.
C++ Code
//Student.h
class STUDENT
{
private:
int IdNumber;
char FirstName[20];
char LastName[20];
float GPA;
};
Java Code
//Student.java
public class STUDENT
{
private int IdNumber;
private char[] FirstName;
private char[] LastName;
private float GPA;
}
Write a JAVA AND C++ program
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started