Student Information and Grading System for Java Programming

Status
Not open for further replies.

blueblurry_23

Honorable
Feb 23, 2013
3
0
10,510
Hello, good day, can you please help me building this program im having such a hard time doing this specially with the part of c. Changing user account and d. Edit Existing Student Grades....your help will be very much appreciated and my scholarship depends on this program and i hope you can help..im already done with the other part but i just want to be sure if i did the right program.help me pls..pls...thanks a lot......
The Program
I. Login Screen
a. Must display the name of the group and the title of the program
b. Should read from a text file named UserAccounts.itp
c. Should ask the user to input a username and password
d. If the username and/or password is incorrect, the program should ask the [prompt the user that the inputted information is incorrect, otherwise, display the name of the full name of the user and Main Screen of the program. Terminate program after 3 consecutive failed login.

II. Main Screen
a. Should display the following:
MAIN MENU
[1] Manage Student Information
[2] Manage Student Grades
[3] Manage User Accounts
[4] About
[5] Log-Out
[6] Exit
-----------------------------------------
Enter choice:

b. Ask the user to input his/her choice according to the module to be processed (i.e. the user will input 1 to display the Manage Student Information Screen. Each number represents a module

III. Manage Student Information
a.Display the following and ask the user to input his/her choice according to the module to be processed.
b. Add New Student
• Ask the user to input the following information:
o Student number
o Full name
o Course
o Section
• Before saving the information, check if the student number exists in the file StudInfo.itp. If the student number exists in the file, the program should prompt the user, otherwise, save the inputted information to StudInfo.itp
c. Display List of Students
• Read from the file StudInfo.itp and display all existing student information
d. Delete Existing Student Information
• Display a list of students and ask the user to input the Student number of the student that will be deleted from the fileStudInfo.itp
e. Back to Main Menu
• Display the main screen

IV. Manage Student Grades Module
a. This module will display the following:
b. This module will read and write a text file named StudGrades.itp
c. Add New Student Grade
• This will ask the user to input the student number and grades from Prelim to Finals and will automatically compute for the subject grade, but before saving the grades to the file, it should check if the student has an existing record on the StudGrades.itpfile. If a record exists, a variable with a data type Boolean should be set to true, it should prompt the user and will not save the grades to the file, otherwise save the grades to the file.

d. Edit Existing Student Grades
e. This will ask the user to input the Student Number who has the grades to be changed. If the student grade record is found, the grades should be displayed and the user will input the new grades from prelim to finals and compute for the subject grade. Save the Student Number, Student Name and grades to StudGrades.itp if the user really wants to alter the grades.
f. Display List of students’ grades
g. Delete Existing Student Grades
h. mimic the process of deleting a record from Manage Student Information but save the file to StudGrades.itp

Manage User Accounts
a. This module will read and write to a text file named UserAccounts.itp and will display the following on the screen for the user to choose a transaction:
b. Add New User Account
• To add a new user account, it requires the following:
i. Full name of the user
ii. Desired login username
iii. Desired Password (at least 4 characters)
iv. Re-enter the password (should match with the desired password, otherwise account will not be saved to the text file and will prompt the user to try again or re-enter the information)
• Save the new user account information to the text file if it satisfies the above requirements.

c. Change user account
• The modification of user account is only limited to the desired login username and the password (full name of the user should not be editable) • Upon editing, the user is required to enter the old username, the new desired username, the old password, the new desired password (should also re-enter the new desired password). If the said information does not matched, modification will not be successful and no changes will be made to the User Account.
• Only the logged in user can modify his/her account. The logged in user cannot modify other user’s Accounts.
d. Display List of Users
• This will only display the Full name of the user and his/her username
e. Back to Main Menu
• Displays the main screen
 

blueblurry_23

Honorable
Feb 23, 2013
3
0
10,510
How to do this part of the program......
1)c. Add New Student Grade
• This will ask the user to input the student number and grades from Prelim to Finals and will automatically compute for the subject grade, but before saving the grades to the file, it should check if the student has an existing record on the StudGrades.itpfile. If a record exists, a variable with a data type Boolean should be set to true, it should prompt the user and will not save the grades to the file, otherwise save the grades to the file.
d. Edit Existing Student Grades
e. This will ask the user to input the Student Number who has the grades to be changed. If the student grade record is found, the grades should be displayed and the user will input the new grades from prelim to finals and compute for the subject grade. Save the Student Number, Student Name and grades to StudGrades.itp if the user really wants to alter the grades.

and this too
c. Change user account
• The modification of user account is only limited to the desired login username and the password (full name of the user should not be editable)
• Upon editing, the user is required to enter the old username, the new desired username, the old password, the new desired password (should also re-enter the new desired password). If the said information does not matched, modification will not be successful and no changes will be made to the User Account.
• Only the logged in user can modify his/her account. The logged in user cannot modify other user’s Accounts.

thanks..... :D
 

Ijack

Distinguished
It looks like you are asking people to do this for you, but I'm sure that's not the case. Which particular part of your assignment are you having difficulty with? It's difficult to see what your problem is without seeing what code you have written.

Perhaps if you show us your code and explain where it isn't working and what is going wrong we could help. But a general "how do I write this program?" is unlikely to produce results.
 

blueblurry_23

Honorable
Feb 23, 2013
3
0
10,510
import java.io.*;

public class addstud {

public addstud()
{

}

public void addnew()throws Exception
{
BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
BufferedReader readFile=new BufferedReader(new FileReader("Studinfo.itp"));
BufferedWriter writeFile=new BufferedWriter(new FileWriter("Studinfo.itp",true));

String fn,cs;


System.out.println("Enter Student number:");
String sn=input.readLine();
System.out.println("Enter Fullname:");
fn=input.readLine();
System.out.println("Enter Course & Section");
cs=input.readLine();



int lineNum=0;
String line;

while((line=readFile.readLine())!=null)
{

lineNum++;
if(line.equals("Student number:" + sn))
{
System.out.println("Inputted student number already exists.");
break;
}
else
{

writeFile.newLine();
writeFile.write("Student number:" + sn);
writeFile.newLine();
writeFile.write("Fullname:" + fn);
writeFile.newLine();
writeFile.write("Course & Section:" + cs);
System.out.println(sn +"\n" + fn + "\n" + cs + "\n" + "\nstudent info successfully written to textfile.");
break;
}

}
writeFile.close();
readFile.close();
}
}

the info is already written in a text file so it should prompt the user that the imfo already exist but in my case even i input the same info it still save in the textfile....what is my mistake in this program...tnx
 

Ijack

Distinguished
Suppose your data file currently reads:

Student number: 1
...
Student number: 2
...
...

to take a very simple example. What happens when you run it and enter "2" for your student number.

1. Enter the "while" loop.
2. Read line from the file - line now contains "Student number: 1".
3. Compare line with what you have just entered - "Student number: 2"
4. Are the equal? No.
5. Go to the "else" clause.
6. Write "Student number: 2" to the file (even though the entry already exists later in the file.
7. etc.

You need to read the entire file before processing the "if" statement. Set a Boolean switch (call it "done" perhaps, which is initially set to false) to true if it finds a match. Now you can do the "if" statement and only write the entry to the file if no match was found ("done" is still false). Note that you only set "done" to false before the "while" loop; within the loop you only change it if you find a match.
 
Status
Not open for further replies.