In this task you are required to write a code that generates the student university ID based on his registration information like his first name, last name, school and year of admission and sequence...

Help meIn this task you are required to write a code that<br>generates the student university ID based on his<br>registration information like his first name, last<br>name, school and year of admission and<br>sequence number. all this information are stored<br>in the student file. The name of the student file<br>should be entered by the user.<br>The information in the student file are stored in<br>the following order: First_name Last_name School<br>Year Seq<br>The structure of the student ID is as follows:<br>• The first three letters of the first name in<br>upper case followed by<br>• The school code appears as two digits.The<br>code for each school is shown in the table<br>below<br>• The year which is the last two digits of the<br>year field in the input file preceded by a 0.<br>• The sequence number of the student as<br>three digits.<br>Important Notes:<br>• If the first name of the student is less than<br>three letters or the first three letters have<br>non alphabatical values then you should<br>print

Extracted text: In this task you are required to write a code that generates the student university ID based on his registration information like his first name, last name, school and year of admission and sequence number. all this information are stored in the student file. The name of the student file should be entered by the user. The information in the student file are stored in the following order: First_name Last_name School Year Seq The structure of the student ID is as follows: • The first three letters of the first name in upper case followed by • The school code appears as two digits.The code for each school is shown in the table below • The year which is the last two digits of the year field in the input file preceded by a 0. • The sequence number of the student as three digits. Important Notes: • If the first name of the student is less than three letters or the first three letters have non alphabatical values then you should print "Invalid". • If the school name is not listed in the table then you should put "99" in the school code field. School Code Engineering 01 Sciences 02 Pharmacy 03 Medicine 04 Dentistry 05 I/O Program Input: • the name of the file that has the student information Program Output: A single line that outputs the student ID
Sample Testcase 0:<br>Input:<br>File name, the file contains: Mohammad<br>Ahmad Pharmacy 2021 004<br>Output:<br>МОНоз021004<br>Sample Testcase 1:<br>Input:<br>File name, the file contains: An@s Ahmad<br>Engineering 1998 015<br>Output:<br>Invalid<br>Sample Testcase 2:<br>Input File name, the file contains: Anas<br>Ahmad Law 1998 015<br>Output: ANA99098015<br>1<br>#include <iostream><br>2 #include <fstream><br>4 using namespace std;<br>6.<br>int main()<br>7<br>{<br>char filename [20]; // Do<br>not change this line. It is<br>similar to string<br>8<br>9<br>cin>>filename;<br>10<br>ifstream in (filename);<br>11<br>12<br>//start your code here<br>13<br>14<br>15<br>16<br>//End<br>17<br>18<br>return 0;<br>19 }<br>

Extracted text: Sample Testcase 0: Input: File name, the file contains: Mohammad Ahmad Pharmacy 2021 004 Output: МОНоз021004 Sample Testcase 1: Input: File name, the file contains: An@s Ahmad Engineering 1998 015 Output: Invalid Sample Testcase 2: Input File name, the file contains: Anas Ahmad Law 1998 015 Output: ANA99098015 1 #include 2 #include 4 using namespace std; 6. int main() 7 { char filename [20]; // Do not change this line. It is similar to string 8 9 cin>>filename; 10 ifstream in (filename); 11 12 //start your code here 13 14 15 16 //End 17 18 return 0; 19 }
Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here