A. Consider “inclass2.h” header file. Define a structure which can hold the following student information: id, first name, last name, and gpa. Use appropriate header file guards. ( Max size of first and last name is 20, id is 7 and gpa is double).
B. Consider an array of student struct with the MAX_SIZE 10 and a first name. These will be provided as an input to your function. Write a function/method that using the given inputs prints out the ID for all the students with the same first name.
INPUTS: The struct array should be declared and initialized in the main function. The following students information should be used to initialize the first 5 elements of the array Mary Robin aaa111 4.0
Ada Thorne bbb222 3.9
Mary Gray ccc333 3.8
Arthur Eden ddd444 3.7
Mary Aslani eee555 3.6
A variable should be declared and initialized with the name “Mary” in the main and should be provided to the function in part B of the question as one of the inputs ( to print out the id of the students with the same first name).
Note: Could you plz go through this code and let me
know if u need any changes in this.Thank You
_________________

// studentsdata.txt
Mary Robin aaa111 4.0
Ada Thorne bbb222 3.9
Mary Gray ccc333 3.8
Arthur Eden ddd444 3.7
Mary Aslani eee555 3.6
______________________
// inclass2.h
struct Student{
char firstName[20];
char lastName[20];
char id[7];
double gpa;
};
________________________
// inclass2.c
#include <string.h>
#include <stdio.h>
#include "inclass2.h"
void searchStudentsFirstName(struct Student arr[],int
cnt,char fname[])
{
int flag=0,i;
for(i=0;i<cnt;i++)
{
if(strcmp(arr[i].firstName,fname)==0)
{
printf("%s\n",arr[i].id);
flag=1;
}
}
if(flag==0)
{
printf("No students found\n");
}
}
_____________________________
// main.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "inclass2.h"
int main()
{
char fname[20],lname[20],id[7];
double gpa;
const int MAX_SIZE=10;
int cnt=0;
struct Student stds[MAX_SIZE];
FILE* f1;
f1 = fopen("studentdata.txt", "r");
//Opening the output file in read mode
if (f1 == NULL) {
printf("** File not found **");
exit(1);
}
else {
//Reading the data from the file
while(fscanf(f1,"%s%s%s%lf",fname,lname,id,&gpa)!=EOF)
{
strcpy(stds[cnt].firstName,fname);
strcpy(stds[cnt].lastName,lname);
strcpy(stds[cnt].id,id);
stds[cnt].gpa=gpa;
cnt++;
}
//closing the files
fclose(f1);
char first[20]={"Mary"};
searchStudentsFirstName(stds,cnt,first);
}
return 0;
}
__________________________
Output:

_______________Could you plz rate me well.Thank
You
A. Consider “inclass2.h” header file. Define a structure which can hold the following student information: id,...
IN C PLEASE Question 16 A. Consider “inclass2.h” header file. Define a structure which can hold the following student information: id, first name, last name, and gpa. Use appropriate header file guards. ( Max size of first and last name is 20, id is 7 and gpa is double). B. Consider an array of student struct with the MAX_SIZE 10 and a first name. These will be provided as an input to your function. Write a function/method that using the...
Write a C++ program that includes the following: Define the class Student in the header file Student.h. #ifndef STUDENT_H #define STUDENT_H #include <string> #include <iostream> using namespace std; class Student { public: // Default constructor Student() { } // Creates a student with the specified id and name. Student(int id, const string& name) { } // Returns the student name. string get_name() const { } // Returns the student id. int get_id () const { } // Sets the student...
Define a class called Student with ID (string), name (string), units (int) and gpa (double). Define a constructor with default values to initialize strings to NULL, unit to 0 and gpa to 0.0. Define a copy constructor to initialize class members to those of another Student passed to it as parameters. Overload the assignment operator (=) to assign one Student to another. Define a member function called read() for reading Student data from the user and a function called print()...
Files given in this assignment (right-click on the file to download) Assignment7.cpp (need to complete) Student.h (Given. Just use it, don't change it!) Student.cpp (Partially filled, need to complete) 1. Assignment description In this assignment, you will write a simple class roster management system for ASU CSE100. Step #1: First, you will need to finish the design of class Student. See the following UML diagram for Student class, the relevant header file (class declaration) is given to you as Student.h,...
O Fit to page ID Page vi Programming assignment 6 Assume that the following student information is stored in a MATLAB structure student student name contains the full name of the student student..pa contains the GPA of the student student.standing contains whether the student is in good academic standing (true/fake) Write a function update(student, field, value) that does the following: Thes as an input a student structure, a student field name, and a value Epla 2. Returns a student structure...
1. Create a file that contains 3 rows of data of the form: First Name Middle Name Last Name Month Day Year Month Day Year GPA. This file represents student data consisting of first name, middle name, last name, registration month, registration day, registration year, birth month, birth day, birth year, current gpa. ...or you may download the data file inPut.txt. inPut.txt reads: Tsia Brian Smith 9 1 2013 2 27 1994 4.0 Harper Willis Smith 9 2 2013 9...
I need code in java
The Student class:
CODE IN JAVA:
Student.java file:
public class Student {
private String name;
private double gpa;
private int idNumber;
public Student() {
this.name = "";
this.gpa = 0;
this.idNumber = 0;
}
public Student(String name, double gpa, int
idNumber) {
this.name = name;
this.gpa = gpa;
this.idNumber = idNumber;
}
public Student(Student s)...
For C++ Create a student structure that has fields for first name, last name, hometown, state, year in college and major. Keep the number of students to a reasonabe level. Place each structure into an array sorted by last name and within last name, by first name. Read the student information from a file and print the sorted array to the screen and then to an output file. I was using the code below to guide me but it keeps...
The object class should be a Student with the following attributes: id: integer first name: String last name: String write the accessors, mutators, constructor, and toString(). In your main test class you will write your main method and do the following things: Create an array of Student objects with at least 5 students in your array. Write a sort method that must be your original work and included in the main class. The sort method will sort based on student...
Program in C Student Data using Structs In this assignment you will create a program (using multiple .c files) to solve the following problem: You have been hired by the university to create a program that will read in input from a .txt file. This input will contain a student name, student id #, their age and their current gpa. You should use the following struct for your student data: struct Student{ char name[50]; int id; float...