Friday, August 28, 2015

Final Proposed Vocabulary and Grammar

       A detailed survey was developed and administered with the purpose of gathering the feedback from the programming community regarding alternative options for the proposed vocabulary and grammar.  The questions selected for the survey represent an assortment of programming commands that fall under each of the programming control flow structures: Sequential Structures; Decision or Conditional Structures, and Looping or Repetitive Structures.  The participants were students of Computer Science and Computer Engineering  from the University of Puerto Rico and the Polytechnic University of Puerto Rico. 
       After performing a qualitative and quantitative analysis of the results obtained from the survey, which contains 10 questions (each one is a multiple choice featuring two or more possible verbalizations of the code and one write-in answer slot for alternative suggestions), a final version of the grammar and vocabulary was proposed, and is presented in Table 1. It is expected to be embraced by the programming community.
       The proposed voice command is written in bold, arial, and red, the corresponding C++ code, as a consequence of the voice command, in italics, bold, and black (this is the output produced by the voice-recognition software in an editor), and variables and literals presented in italics, and green.  

Table 1: Final Proposed Vocabulary and Grammar      
Programming structure
Voice commands
Variable definition
defining integer variable
            int ;
total
            int total;
Standard output: literals
printing literal
            cout << “ ”;
hello world
           cout << “ hello world”;
Standard output: variables
printing variable
            cout << ;
total
            cout << total;
Mathematical operations
printing
            cout << ;
grouping
            cout << () ;
total adding 2
            cout << ( total + 2 ) ;
moving right, symbol frontslash 4
            cout << ( total + 2 ) / 4 ;
Standard input
getting input into variable total
cin >> total;
Modulus operations
total modulus 3
            total % 3
Relational operations
total symbol greater than seven
total > 7
Logical operations
(statementA) operating and
            (statement) &&
negating (statementB)
            (statement) && !(statement)
Loops
inserting for loop
            for ( ; ; )
            {

            }
inserting initiation (initializeExpression)
inserting condition (conditionalExpression
inserting modification (modifyExpression)
            for ( initializeExpression; conditionalExpression; modificationExpression)
            {

            }
entering loop (statement(s))
            for ( initializeExpression; conditionalExpression; modificationExpression)
            {
                        statement(s);
            }
Conditionals
inserting conditional
if()
{
}
inserting condition total symbol greater than seven
if( total > 7)
{
}
printing literal eight
if( total > 7)
{
cout << “8”;
}
else printing literal six
if( total > 7)
{
cout << “8”;
}else
{
cout << “6”;
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.