In the Department of Mathematics and Computer Science (MACS), undergraduate course codes begin with either M (for Mathematics courses) or CS (for Computer Science courses). Thereafter, the code has four (4) digits. The first digit is the year of study, which is 1 to 6. The second digit is the credit hours, which is again 1 to 5. For Mathematics courses, the third and the fourth digits is just a running index to differentiate the course from the others. For Computer Science courses, the third digit is the area of specialisation, which is from 0 to 4. The fourth and the last digit is just a running index to differentiate the course from the others. a) Draw a finite state machine (FSM) accepting/generating course codes in MACS. b) As the result of a) above, write the corresponding C++ function int is_MACS_course(char * str) I| C++ code which will determine whether or not the given string, str, represents the correct code for MACS courses.

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter5: Working With Multiple Worksheets And Workbooks
Section: Chapter Questions
Problem 4AYK
icon
Related questions
Question
4:
In the Department of Mathematics and Computer Science (MACS), undergraduate
course codes begin with either M (for Mathematics courses) or CS (for Computer
Science courses). Thereafter, the code has four (4) digits. The first digit is the year of
study, which is 1 to 6. The second digit is the credit hours, which is again 1 to 5. For
Mathematics courses, the third and the fourth digits is just a running index to
differentiate the course from the others. For Computer Science courses, the third digit is
the area of specialisation, which is from 0 to 4. The fourth and the last digit is just a
running index to differentiate the course from the others.
a) Draw a finite state machine (FSM) accepting/generating course codes in MACS.
b) As the result of a) above, write the corresponding C++ function
int is_MACS_course(char * str)
{
I/ C++ code
which will determine whether or not the given string, str, represents the correct code
for MACS courses.
Transcribed Image Text:4: In the Department of Mathematics and Computer Science (MACS), undergraduate course codes begin with either M (for Mathematics courses) or CS (for Computer Science courses). Thereafter, the code has four (4) digits. The first digit is the year of study, which is 1 to 6. The second digit is the credit hours, which is again 1 to 5. For Mathematics courses, the third and the fourth digits is just a running index to differentiate the course from the others. For Computer Science courses, the third digit is the area of specialisation, which is from 0 to 4. The fourth and the last digit is just a running index to differentiate the course from the others. a) Draw a finite state machine (FSM) accepting/generating course codes in MACS. b) As the result of a) above, write the corresponding C++ function int is_MACS_course(char * str) { I/ C++ code which will determine whether or not the given string, str, represents the correct code for MACS courses.
Expert Solution
steps

Step by step

Solved in 4 steps with 7 images

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage