Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PROJECT 1 DESCRIPTION: Write a C++ class definition called SIMPLER_VOIP_FSM whic

ID: 3889212 • Letter: P

Question

PROJECT 1 DESCRIPTION: Write a C++ class definition called SIMPLER_VOIP_FSM which will evaluate the student performance. The prototype for the class SIMPLER_VOIP_FSM is defined as follows: class SIMPLER_VOIP_FSM{ public: // public methods for this class SIMPLER_VOIP_FSM(void); // example: g.SIMPLER_VOIP_FSM(); // constructor; void SIMPLER_VOIP_FSM_READ(void); // example: g.SIMPLER_VOIP_FSM_READ(void); // method to read student grades // returns no values; void SIMPLER_VOIP_FSM_PRINT(void); // example: g.SIMPLER_VOIP_FSM_PRINT(void); // method to print state information; // returns no values; void PRINT_FSM_STATE(int); // example: g.PRINT_FSM_STATE(x); // method to print information related state x; // returns no values; void VERIFY_FSM_STATE(int, int); // example: g.VERIFY_FSM_STATE(x, y); // method to verify if there is a state whose id is x // and whose out degree is y; // returns no values; private: // private var to be used by this class only (not from main) int n; // no of states; int state_id[10]; // ids for states; int out_degree[10]; // no of outgoing edges from a single state; int edge_inputs[10][5]; // inputs for the edges leaving each state; int edge_outputs[10][5]; // outputs for the edges leaving each state; int edge_tail_state_id[10][5]; // ids for the ending states for the // edges leaving each state; }; The objects of SIMPLER_VOIP_FSM class will read the input values from a file called in.1 given with the following format: n state_id_0 x edge_input_0_0 edge_output_0_0 tail_state_id_0_0 ... edge_input_0_x edge_output_0_x tail_state_id_0_x state_id_1 y edge_input_1_0 edge_output_1_0 tail_state_id_1_0 ... edge_input_1_y edge_output_1_y tail_state_id_1_y ... state_id_n-1 z edge_input_n-1_0 edge_output_n-1_0 tail_state_id_n-1_0 ... edge_input_n-1_z edge_output_n-1_z tail_state_id_n-1_z where n (1<= m <= 10) is the number of states, state_id_i (between 0 and 999 inclusive) is the id for a given states, x,y, and z (1<= x,y,z <= 5) are the number of edges leaving state 0, 1, and n-1, respectively, edge_input_i_j is the input for the jth outgoing edge from the ith state, edge_output_i_j is the output for the jth outgoing edge from the ith state, and tail_state_i_j is the id for next state for the jth outgoing edge from the ith state. ____________________________________ An example of SIMPLER_VOIP_FSM constructor is as follows: SIMPLER_VOIP_FSM g(); which instantiates an object g of class SIMPLER_VOIP_FSM. The constructor should initialize all the varaibles to 0. The output to out.1 file is: ++++++++++++++++ START ++++++++++++++++++++++ CONTSTRUCTOR SUCCESSFULLY INITIATED AN OBJECT. ++++++++++++++++ END ++++++++++++++++++++++ MAKE SURE THAT EVERY LINE TO out.1 ENDS WITH A endl. ____________________________________ The definition of SIMPLER_VOIP_FSM_READ method is as follows: g.SIMPLER_VOIP_FSM_READ(); where g is a object of class SIMPLER_VOIP_FSM. This method should read the contents of the in.1 file and populate the private data elements. The output to out.1 is: ++++++++++++++++ START ++++++++++++++++++++++ THERE ARE n STATES IN THIS SIMPLER_VOIP_FSM ++++++++++++++++ END ++++++++++++++++++++++ where n is the number of states. MAKE SURE THAT EVERY LINE TO out.1 ENDS WITH A endl. ____________________________________ The definition of SIMPLER_VOIP_FSM_PRINT method is as follows: g.SIMPLER_VOIP_FSM_PRINT(); where g is a object of class SIMPLER_VOIP_FSM. This method should print the following into out.1: ++++++++++++++++ START ++++++++++++++++++++++ OUTPUT FROM SIMPLER_VOIP_FSM_PRINT INTERFACE: THIS SIMPLER_VOIP_FSM HAS n STATES STATE id_0 HAS x OUTGOING EDGES AS FOLLOWS: EDGE INPUT: in_0_0 EDGE OUTPUT: out_0_0 TAIL STATE: next_state_0_0 ... EDGE INPUT: in_0_x EDGE OUTPUT: out_0_x TAIL STATE: next_state_0_x STATE id_1 HAS y OUTGOING EDGES AS FOLLOWS: EDGE INPUT: in_1_0 EDGE OUTPUT: out_1_0 TAIL STATE: next_state_1_0 ... EDGE INPUT: in_1_y EDGE OUTPUT: out_1_y TAIL STATE: next_state_1_y ... STATE id_n-1 HAS z OUTGOING EDGES AS FOLLOWS: EDGE INPUT: in_n-1_0 EDGE OUTPUT: out_n-1_0 TAIL STATE: next_state_n-1_0 ... EDGE INPUT: in_n-1_z EDGE OUTPUT: out_n-1_z TAIL STATE: next_state_n-1_z ++++++++++++++++ END ++++++++++++++++++++++ where n is the number of states and x, y, and z are the outdegrees for states 0, 1, and n-1, respectively. MAKE SURE THAT EVERY LINE TO out.1 ENDS WITH A endl. ____________________________________ google-chrome The definition of PRINT_FSM_STATE method is as follows: g.PRINT_FSM_STATE(x); where g is a object of class SIMPLER_VOIP_FSM and x is an integer. If there is a state whose id is x, the output to out.1 file is: ++++++++++++++++ START ++++++++++++++++++++++ OUTPUT FROM PRINT_FSM_STATE INTERFACE: STATE x HAS z OUTGOING EDGES AS FOLLOWS: EDGE INPUT: in_x_0 EDGE OUTPUT: out_x_0 TAIL STATE: next_state_x_0 ... EDGE INPUT: in_x_z EDGE OUTPUT: out_x_z TAIL STATE: next_state_x_z ++++++++++++++++ END ++++++++++++++++++++++ where z is the outdegree for state x. If there is no such state, the output ot out.1 is: ++++++++++++++++ START ++++++++++++++++++++++ OUTPUT FROM PRINT_FSM_STATE INTERFACE: THIS FSM DOES NOT HAVE A STATE WITH ID x. ++++++++++++++++ END ++++++++++++++++++++++ MAKE SURE THAT EVERY LINE TO out.1 ENDS WITH A endl. ____________________________________ The definition of VERIFY_FSM_STATE method is as follows: g.VERIFY_FSM_STATE(x, y); where g is a object of class SIMPLER_VOIP_FSM and x and y are integers. If there is a state whose id is x and whose outdegree is y, the output to out.1 is: ++++++++++++++++ START ++++++++++++++++++++++ OUTPUT FROM VERIFY_FSM_STATE INTERFACE: THIS FSM HAS A STATE WITH ID x AND OUTDEGREE OF y. ++++++++++++++++ END ++++++++++++++++++++++ If there x and/or y does match, the output to out.1 is: ++++++++++++++++ START ++++++++++++++++++++++ OUTPUT FROM VERIFY_FSM_STATE INTERFACE: THIS FSM DOES NOT HAVE A STATE WITH ID x AND OUTDEGREE OF y. ++++++++++++++++ END ++++++++++++++++++++++ MAKE SURE THAT EVERY LINE TO out.1 ENDS WITH A endl. ____________________________________ Your header file will be used by our staff as a header file called p1.h. 2 examples of main functions utilizing such a header are as follows: :::::::::::::: EXAMPLE 1 ::::::::::::::::::::: ---------CONTENTS OF main1.cc FILE:----------- #include #include "p1.h" // example program: main1.cc int main () { SIMPLER_VOIP_FSM g; // instantiate an object g which is of class STATE g.SIMPLER_VOIP_FSM_READ(); // READ THE CONTENTS OF in.1 g.PRINT_FSM_STATE(12); return 0; } ---------CONTENTS OF in.1 FILE:--------------- 4 10 1 100 500 11 11 3 101 501 12 102 502 13 103 503 10 12 2 102 502 13 103 503 10 13 1 103 503 10 ---------EXPECTED CONTENTS OF out.1 FILE:----- ++++++++++++++++ START ++++++++++++++++++++++ CONTSTRUCTOR SUCCESSFULLY INITIATED AN OBJECT. ++++++++++++++++ END ++++++++++++++++++++++ ++++++++++++++++ START ++++++++++++++++++++++ THERE ARE 4 STATES IN THIS SIMPLER_VOIP_FSM ++++++++++++++++ END ++++++++++++++++++++++ ++++++++++++++++ START ++++++++++++++++++++++ OUTPUT FROM PRINT_FSM_STATE INTERFACE: STATE 12 HAS 2 OUTGOING EDGES AS FOLLOWS: EDGE INPUT: 102 EDGE OUTPUT: 502 TAIL STATE: 13 EDGE INPUT: 103 EDGE OUTPUT: 503 TAIL STATE: 10 ++++++++++++++++ END ++++++++++++++++++++++ :::::::::::::: EXAMPLE 2 ::::::::::::::::::::: ---------CONTENTS OF main2.cc FILE:----------- #include #include "p1.h" // example program: main2.cc int main () { SIMPLER_VOIP_FSM g; // instantiate an object g which is of class STATE g.SIMPLER_VOIP_FSM_READ(); // READ THE CONTENTS OF in.1 g.SIMPLER_VOIP_FSM_PRINT(); // PRINT THE PRIVATE DATA INTO out.1 FILE g.VERIFY_FSM_STATE(11, 3); // VERIFY THAT STATE 11 WITH OUTDEGREE 3 // EXISTS IN FSM return 0; } ---------CONTENTS OF in.1 FILE:--------------- 4 10 1 100 500 11 11 3 101 501 12 102 502 13 103 503 10 12 2 102 502 13 103 503 10 13 1 103 503 10 ---------EXPECTED CONTENTS OF out.1 FILE:----- ++++++++++++++++ START ++++++++++++++++++++++ CONTSTRUCTOR SUCCESSFULLY INITIATED AN OBJECT. ++++++++++++++++ END ++++++++++++++++++++++ ++++++++++++++++ START ++++++++++++++++++++++ THERE ARE 4 STATES IN THIS SIMPLER_VOIP_FSM OUTPUT FROM SIMPLER_VOIP_FSM_PRINT INTERFACE: THIS SIMPLER_VOIP_FSM HAS 4 STATES STATE 10 HAS 1 OUTGOING EDGES AS FOLLOWS: EDGE INPUT: 100 EDGE OUTPUT: 500 TAIL STATE: 11 STATE 11 HAS 3 OUTGOING EDGES AS FOLLOWS: EDGE INPUT: 101 EDGE OUTPUT: 501 TAIL STATE: 12 EDGE INPUT: 102 EDGE OUTPUT: 502 TAIL STATE: 13 EDGE INPUT: 103 EDGE OUTPUT: 503 TAIL STATE: 10 STATE 12 HAS 2 OUTGOING EDGES AS FOLLOWS: EDGE INPUT: 102 EDGE OUTPUT: 502 TAIL STATE: 13 EDGE INPUT: 103 EDGE OUTPUT: 503 TAIL STATE: 10 STATE 13 HAS 1 OUTGOING EDGES AS FOLLOWS: EDGE INPUT: 103 EDGE OUTPUT: 503 TAIL STATE: 10 ++++++++++++++++ END ++++++++++++++++++++++ ++++++++++++++++ START ++++++++++++++++++++++ OUTPUT FROM VERIFY_FSM_STATE INTERFACE: THIS FSM HAS A STATE WITH ID 11 AND OUTDEGREE OF 3. ++++++++++++++++ END ++++++++++++++++++++++ How to input data and output file even though code was given but maybe was not complete?

Explanation / Answer

class Student{ int age; int standard; string first_name; string last_name; public: Student() { age = 0; standard = 0; first_name.clear(); last_name.clear(); } void set_age(int newAge) { age = newAge; } void set_standard(int newStandard) { standard = newStandard; } void set_first_name(string newFirst_name) { first_name = newFirst_name; } void set_last_name(string newLast_name) { last_name = newLast_name; } int get_age() {return age;} int get_standard() {return standard;} string get_first_name() {return first_name;} string get_last_name() {return last_name;} string to_string() { stringstream ss; char c = ','; ss
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote