Question
I gat this C++ assignment, but I have no idea from where I should start, I would really appreciate if someone helps me out. this
I gat this C++ assignment, but I have no idea from where I should start, I would really appreciate if someone helps me out.
this assignment should be written in C++.
A. OBJECTIVES:
Doing this project, students will have the chances to practice with the following concepts; therefore, you should review them when you are working on the project: ? Repetition structures using: for, while, or do..while loop ? Selection structure: using if, if else, or switch statement. ? Practice using the array of int, double or string. ? Read data from the keyboard. ? Read data from the file ? Write data to the file. ? Using manipulators: setw, fixed, showpoint, or precision, etc. to display data as format. ? Using user-defined functions ? How to declare an array and how to initialize or access to array elements....
REQUIREMENT:
Write the program that allows users to enter the file name to store the information of students then provides the menu to allow users to select the following tasks and only terminate the program when users select exit...
Each task has to be handle in a user-defined function.
GRADING STUDENTS
1. Enter Information of Students in class.
2. Enter the scores of Students.
3. Grading.
0. Exit.
TASK 1: ENTER INFORMATION OF STUDENTS IN CLASS
-Open the file with the above file name as output file.
-Read information of one student that includes: student id, last name, first name, phone.
-Store the information to the output file in the following format.
id,lastname,firstname,phone
-then allow users to continue to input the information of other students until users want to stop For example in the output file:
1234567,Le,Liem,2147255796
2222222,Smith,James,4691234567
3124567,David,Kevin,9727654321
TASK2: READ THE SCORES
-open the above file to read (input file)
-open a file tempFile.txt to write (output file)
-read file:
for each line:
-Display the student id then ask users to confirm by answer Y or N, for example:
You want to enter the score of student with id: 0097785 (Y/N)?
-If answer is Y, display the menu to allow users select the following assignments:
1. Quizzes
2. Homeworks
3. Labs
4. Tests
5. Project
6. Discussion
7. Team work
8. Extra credit
0. exit
-For each type, ask users to type all the scores on one lines separate by space. Read the scores as decimal numbers then store in variables. If there are more than one sore for one type store them in an array. For example for read input:
Enter the scores of quizzes separate by space: 2.5 3.5 4.0 5.0 3.25 4.5 3.5 5.0 5.0 4.25 2.5 2.5 5.0 5.0
The size of arrays should be:
Quizzes: 14 Max score:5 Total: 70
Homeworks 10 Max score: 10 Total: 100
Labs: 7 Max score: 30 Total: 210
Tests: 3 Max score: 100 Total: 300
Project 1 Max score: 80 Total: 80
Discussion 1 Max score: 20 Total: 20
Team work 1 Max score: 20 Total 20
Extra credit 1 Max score: 5 Total scores: 800 (not include extra credit)
-Re-display the above menu when users finish one type until users select 0
-After finishing the scores of one student, you should combines all information and scores in to one line. All information are separated by comma. Information and other type of assignments are separated by dash.
You can combine information and scores by call the method mergeOneLine that is provided (you can download from project on eCampus: (the sumScore, percentage, and letterGrade are set to default values 0.0 and X)
string mergeOneLine(int id, string last, string first, string phone, float quizzes[], float homeworks[], float labs[], float tests[], float project, float discussion, float teamWork, float extra, float sumScore, float percentage, char letterGrade)
write the above merge line to file tempFile.txt
For example in the file one student should be written to the tempFile.txt 1234567,Smith,James,4691234567-2.50,3.50,4.00,5.00,3.25,4.50,3.50,5.00,5.00,4.25,2.50,2.50,5.00,5.00- 8.50,9.00,10.00,8.50,9.25,7.50,6.75,8.00,9.00,10.00-30.00,38.50,29.25,23.50,25.00,22.50,28.00-88.50,75.50,78.50-75.50-10.00- 20.00-5.00-0.00-0.00-X
? read next line then do the same until the end of file
? at the end of this task2 do the following lines of code:
tempFile.close();//output file
ifile.close();//input file
//remove original input file
remove(fileName);
//rename the tempFile.txt back to orignial file
rename("tempFile.txt", fileName);
TASK3: GRADING
-open the above file to read (input file)
-open a file tempFile.txt to write (output file)
-read file:
for each line you read:
-split information from the line by using delimeter comma (,) or dash (-); then assign each piece of information to the following
For example the line is read from file:
1234567,Smith,James,4691234567-2.50,3.50,4.00,5.00,3.25,4.50,3.50,5.00,5.00,4.25,2.50,2.50,5.00,5.00- 8.50,9.00,10.00,8.50,9.25,7.50,6.75,8.00,9.00,10.00-30.00,38.50,29.25,23.50,25.00,22.50,28.00-88.50,75.50,78.50-75.50-10.00- 20.00-5.00-0.00-0.00-X
Will be splitted into:
Id = 1234567
Last name = Smith
First name = James
Phone = 4691234567
Quizzes = 2.50,3.50,4.00,5.00,3.25,4.50,3.50,5.00,5.00,4.25,2.50,2.50,5.00,5.00 //these scores are stored in array
Homeworks = 8.50,9.00,10.00,8.50,9.25,7.50,6.75,8.00,9.00,10.00 //these scores are stored in array
Labs = 30.00,38.50,29.25,23.50,25.00,22.50,28.00 //these scores are stored in array
Tests = 88.50,75.50,78.50 //these scores are stored in array
Project = 75.50
Discussion = 10.00
Team work = 20.00
Extra credit = 5.00
Sum of score = 0.00
Percentage = 0.00
Letter grade = X
-After calculate the percentage and determine the letter grade, you should call the method mergeOneLine again to create a line to write to the output file tempFile.txt
-Read another line the do the same until the end of input file
? After finishing all students do the same thing as task2 to rename the tempFile.txt back to orignial input file
? Also, display the result of class on the screen in the following format;
GRADING CLASS
Total students: 20
Grade A: 5 25%
Grade B: 10 50%
Grade C: 4 20%
Grade D: 0 0%
Grade F: 1 5%
C. INSTRUCTION HOW TO DO THE LAB
To do the lab you should follow the following steps: ANALYZE:
-You should read the requirement again to see:
* what the requirement gives you and
* what it asks you to do: How many tasks? What do you need to do in each task?
PSEUDO-CODE From the list of tasks analyzed from the above ANALYZE, write the pseudo-code Psuedo-code is written in English that lists what you have to do step by step in the main such that your program is qualified to the requirement
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