Uploaded by layetab310

PF Assignment 1 Fall 2022

advertisement
Programming Fundamentals
Assignment 1
Course Code: CSCP 1013
Total Marks: 30
(Char Array, Filing)
DEADLINE: 16th November, 2022
Submission: On portal (.cpp file)
Problem: You have to design a student portal. The function of this portal will be to calculate
grades of each student.
It should be a menu based program. The menu should include:
1- Register
2- Log In
3- Calculate Result
4- Print Result
5- Print All
Task1: Take input from console: Student will set up their account by entering reg# and
password.
Sample Output:
Enter Reg#: L1F20BSCS0001
Enter Password: UCP789
Console
Task 2: File Writing: You have to maintain files for registration and passwords separately on
the same serial number.
The names of the files should be: (reg.txt) and (pswd.txt)
1 L1F20BSCS0001
reg.txt
1 UCP789
pswd.txt
Task 3: Matching Console Input with Text File Record: When the student wish to log in after
setting up account. You have to check whether this registration number is present in your
registration.txt file or not. If it is present take password and match the password with the password
file on the same serial number. You can keep a counter for tracking the serial number. Display
appropriate message if the registration number does not match to the file or the password is wrong
or does not match.
Sample Output:
1-Register
2- Log In
3- Calculate Result
4- Print Result
5- Print All
4- Print Result
5- Print All
2
Enter user name: L1F20BSCS0050
User name does not exist.
1-Register
2- Log In
3- Calculate Result
2
Enter user name: L1F20BSCS0001
Enter password: UCP123
Wrong password
Enter Password: UCP789
Login Successful
Console
Task 5: Calculate percentage: Once student has logged in successfully, take marks of 5 subjects
out of 100 from user. You can use any subject name for the purpose of displaying on console.
Calculate percentage of these marks. After you have calculated percentage, create a file named
“result.txt” which has registration number and percentages of all the registered students till this
point.
Sample Output:
Login Successful
1
L1F20BSCS0001
Enter Marks of Subject1: 85
Enter Marks of Subject2: 45
Enter Marks of Subject3: 75
Enter Marks of Subject4: 92
Enter Marks of Subject5: 65
Console
Result.txt
72.4%
Task 6: Register at least 10 records. Each record should have percentage calculated and saved in
result file on the same serial number as in reg.txt or pswd.txt. Print records from odd serial numbers
from result.txt file and display them on console.
Sample Output:
1
L1F20BSCS0001
72.4%
3
L1f20BSCS0010
84.6%
5
L1F20BSCS0020
45.8%
7
L1F20BSCS0030
95.6%
9
L1F20BSCS0040
72.0%
Result.txt
Console
Task 7: Make sure the use of eof() and is_open() for each file while you read from.
Total # of File for Writing: 3
Rubric:
Implementation
Definition of variable, arrays, fstream identifiers with meaningful names
Incomplete definition of variable, arrays, fstream identifiers with meaningless
names
Opening and Closing Files
Incomplete opening and closing
Reading and writing Files successfully
Incomplete reading and writing file
7 Tasks Completed Successfully
Incomplete or wrong implementation of each task
Missing Task
Menu
Usage of char array (successful)
Poor usage of arrays
No usage of arrays/files/function
Total
Points
5
1
2.5
1
2.5
1
2*=14
1*7=7
0*7=0
1*5=5
1
0
0
30
You can achieve 100% in this assignment as maximum marks by doing original work and following
up the rubric. Minimum Marks Possible: 3 Zero Marks in Case of Plagiarism.
Download