Write the code to maintain a list of student records. The main flow of your program should be to read all information from file(s) and place it in arrays, loop and do stuff with the records (e.g., add, update, look up, etc.), before exiting optionally write the new information back to the file(s) before exiting. Please note the files are only accessed at the beginning and the end, do not change the files during the "do stuff loop" (unless you have a "save changes" option in the loop)
A student record will consist of a name, address, ID (7 digits and ID > 1000000), list of phone numbers, and a list of courses completed.
A name object will have 3 parts, first, middle, and last. These three name parts are restricted to only a-z and A-Z characters. You may optionally add additional fields
An address will consist of street number, street name, city, state (2 characters) and zip code. Zip codes will be stored as long (not strings). Zip plus 4 is optional.
A phone number will consist of area code, exchange, extension and type. For instance, with the number 216-687-2000, 216 is the area code, 687 is the exchange and 2000 is the extension. All fields are long (not strings).
A course will consist of a department name (3 characters), number (long), semester (string), year (long), credit hours(long) and grade (2 characters).
Fields in all objects need the appropriate set and get routines (still no properties).
The student object has set and get routines for all data. The student object also methods to return the student's GPA, number of hour attempted, number of hours completed (assume only C- and higher count toward graduation). equals and compareto in the student object are dependent only on the ID field and the tostring only returns their name and ID.
All objects also need Equals and ToString methods.
Reiterating, after reading in the information from the file(s), the program asks the end user to add, update or look up information until the end user is done. When done the program optionally writes the information back into the file(s).
Using a GUI will greatly help in adding or updating a student record, however it is not required. When looking up information of a student, simply display all information including the. Optionally you might want a few ways to display a student's information - everything, contact information only, school information only, or short school info only (no individual course info).
C# PROGRAM:
using System;
using System.Collections.Generic;
using System.IO;
namespace RecordStuffAddUpdateLookup
{
class Program
{
static void Main(string[] args)
{
List<Student>list=new List<Student>();
using (StreamReader reader = new
StreamReader("..//..//TextFile1.txt"))
{
while (true)
{
string line = reader.ReadLine();
if (line == null)
{
break;
}
string []arr=line.Split(',');
Student obj=new Student();
obj.name=arr[0];
obj.address=arr[1];
obj.id=Convert.ToDouble(arr[2]);
obj.phoneNumbers=Convert.ToDouble(arr[3]);
obj.courses=arr[4];
list.Add(obj);
}
}
string check="";
do
{
Console.WriteLine("1.Add");
Console.WriteLine("2.Update");
Console.WriteLine("3.Lookup");
Console.WriteLine("4.Exit");
Console.WriteLine("Choose your number");
switch (Console.ReadLine())
{
case "1":
Student obj = new Student();
Console.WriteLine("Enter the name");
obj.name = Console.ReadLine();
Console.WriteLine("Enter the address");
obj.address = Console.ReadLine();
Console.WriteLine("Enter the id");
obj.id = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter the phoneNumber");
obj.phoneNumbers = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter the courses");
obj.courses = Console.ReadLine();
list.Add(obj);
Console.WriteLine("Added");
break;
case "2":
Console.WriteLine("Enter the name you want to edit");
string name = Console.ReadLine();
for (int i = 0; i < list.Count; i++)
{
if (list[i].name == name)
{
Console.WriteLine("Enter the address");
list[i].address = Console.ReadLine();
Console.WriteLine("Enter the id");
list[i].id = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter the phoneNumber");
list[i].phoneNumbers = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter the courses");
list[i].courses = Console.ReadLine();
}
}
break;
case "3":
Console.WriteLine("Enter the name you want to search");
string Name = Console.ReadLine();
for (int i = 0; i < list.Count; i++)
{
if (list[i].name == Name)
{
Console.WriteLine("Name is " + list[i].name);
Console.WriteLine("Address is " + list[i].address);
Console.WriteLine("id is " + list[i].id);
Console.WriteLine("phone number is " + list[i].phoneNumbers);
Console.WriteLine("Courses is " + list[i].courses);
}
}
break;
case "4":
check = "q";
break;
}
}
while (check != "q");
using (StreamWriter writer = new
StreamWriter("..//..//TextFile1.txt"))
{
for(int i=0;i<list.Count;i++)
{
writer.WriteLine(list[i].name + "," + list[i].address + "," +
list[i].id + "," + list[i].phoneNumbers + "," +
list[i].courses);
writer.WriteLine(Environment.NewLine);
}
}
}
}
class Student
{
public string name;
public string address;
public double id;
public double phoneNumbers;
public string courses;
}
}
Write the code to maintain a list of student records. The main flow of your program...
Program in IDLE: At a university, each student is assigned a system login name, which the student uses to log into the campus computer system. As part of your internship with the university's Information Technology department, you have been asked to write the code that generates system login names for students. You will use the following algorithm to generate a login name: 1) Get the first 3 characters of the student's first name. 2) Get the first 2 characters of...
Write this code on python 3 only.
Suppose class Student represents information about students in a course. Each student has a name and a list of test scores. The Student class should allow the user to view a student's name, view a test score at a given position, view the highest test score, view the average test score, and obtain a string representation of the student's information. When a Student object is created, the user supplies the student's name and...
Write a program that will maintain a personal phonebook. The program should be menu driven. Create a new phonebook Print the phonebook Add person to the phonebook Remove a person from the phonebook Sort Modify a person Search for a person by name Save to a data file (Can't be done but leave an error message if the user selects) Retreive phonebook from data file (Can't be done but leave an error message if the user selects) Quit Create a...
You will create a class to keep student's information: name, student ID, and grade. The program will have the following functionality: - The record is persistent, that is, the whole registry should be saved on file upon exiting the program, and after any major change. - The program should provide the option to create a new entry with a student's name, ID, and grade. - There should be an option to lookup a student from his student ID (this will...
Write a class called Student. The specification for a Student is: Three Instance fields name - a String of the student's full name totalQuizScore - double numQuizesTaken - int Constructor Default construtor that sets the instance fields to a default value Parameterized constructor that sets the name instance field to a parameter value and set the other instance fields to a default value. Methods setName - sets or changes the student name by taking in a parameter getName - returns...
In C++, write a complete program that receives a series of student records from the keyboard and stores them in three parallel arrays named studentID and courseNumber and grade. All arrays are to be 100 elements. The studentID array is to be of type int and the courseNumber and grade arrays are to be of type string. The program should prompt for the number of records to be entered and then receive user input on how many records are to...
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)...
Write a Java program which will store, manipulate, and print student registration information. As part of the solution, identify the following classes: Student Admissions. The class Student must have the following fields – Name, Address, Id number, Courses, and Date, where: Name is a user defined class comprising of at minimum first name and last name. Address is a user defined class comprising of fields - street, city, state, and zip code. Date is a predefined class in the java.util...
In this exercise, we will be refactoring a working program. Code refactoring is a process to improve an existing code in term of its internal structure without changing its external behavior. In this particular example, we have three classes Course, Student, Instructor in addition to Main. All classes are well documented. Read through them to understand their structure. In brief, Course models a course that has a title, max capacity an instructor and students. Instructor models a course instructor who...
(TCOs C-F) List the names of subroutines of the hierarchy chart, and then write complete pseudocode for the following problem. You will not have to create a data dictionary for this exercise. Problem: Students get a discount on the tuition paid. The discount is based on a student's code and the registered number of course credits. A student with a code "M" for a military job, and registered for more than four credits is eligible for 5% discount on the...