Applescript Doing C++

liunx

Guest
Hey,<br />yall have been a great help.<br /><br />I have recently discoved the power of apple script and have been recomended for me to use applescript instead of C++ for what i am trying to do<br /><br />i am trying to make an applescript application do what my C++ code is doing here:<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><br />#include <iostream><br />#include <string><br /><br />using namespace std;<br /><br />int main()<br />{<br />    int number_incorrect=0, number_correct=0, total_questions=0, point_value, score=100;<br />    string name;<br />    char answer;<br />    <br />    <br />    cout<<"\n\nWelcome to CET PRETEST";<br />    cout<<"\nWhat is your name:";<br />    cin>>name;<br /><br />//must not have 3 questions    <br />    <br />    cout<<"\n\nGet ready "<<name<<endl;<br />    ++total_questions;<br />    cout<<"\n\nQuestion 1:\nA computer takes _____ and gives ______.";<br />    cout<<"\n    A) AC-AC \n    B) AC-DC \n    C) DC-AC \n    D) DC-DC";<br />    cout<<"\nYour answer:";<br />    cin>>answer;<br />    cout<<"\ncorrect answer: B"<<endl;<br />    if (answer == 'B' || answer=='b')<br />        ++number_correct;<br />        <br />    <br />    else<br />        ++number_incorrect;<br /><br />    <br />    cout<<"\ntotal correct:"<<number_correct<<endl;<br />    <br />    ++total_questions;<br />    cout<<"\n\nQuestion 2:\nCMOS stands for:";<br />    cout<<"\n\n    A) Computer Made On Service\n    B) Computer Mode Onside Service\n    ";    <br />    cout<<"C) Complementry Metal Oxcide Semicunductor\n    D) Computer Mode Online Service";<br />    cout<<"\nEnter your Answer:";<br />    cin>>answer;<br />    cout<<"\ncorrect answer: C"<<endl;<br />    if (answer == 'C' || answer=='c')<br />        ++number_correct;<br />    <br />    <br />    else<br />        ++number_incorrect;<br />    <br />    cout<<"\nTotal correct:"<<number_correct<<endl;<br />    <br />    ++total_questions;<br />    cout<<"\n\nQuestion3:\nSIMM stands for what?";<br />    cout<<"\n\n A) single inline memory module\n B)    standard intergrated memory mode\n C)    Standard inline mmory mode\n D)    seriously infected motherboard mainframe"<<endl;<br />    cout<<"Your answer:";<br />    cin>>answer;<br />    cout<<"\ncorrect answer: A";<br />    if (answer == 'A' || answer =='a')<br />        ++number_correct;<br />    else<br />        ++number_incorrect;<br />    <br />    cout<<"\n Total correct:"<<number_correct<<endl;<br />    <br />    ++total_questions;<br />    cout<<"\n\nQuestion"<<total_questions<<"\nA floppy drive cable has how many pins?";<br />    cout<<"\n\n A) 20\n B) 30\n C) 32\n D) 40"<<endl;<br />    cout<<"Your answer:";<br />    cin>>answer;<br />    cout<<"correct answer: C";<br />    if (answer=='C' || answer=='c')<br />        ++number_correct;<br />    else<br />        ++number_incorrect;<br />    cout<<"\nTotal correct:"<<number_correct<<endl;<br />    cout<<"\nTotal incorrect:"<<number_incorrect<<endl;<br />    <br />    <br />    <br /><br />//score<br />    point_value=100/total_questions;//100 divided by 2 = 50<br />    score=point_value*number_correct;//50 times number correct<br />    cout<<"\n\nYour score is: "<<score<<endl;<br /><br />return 0;<br />}<br /><!--c2--></div><!--ec2--><br /><br />i am trying to use applescript so that i can put the above code in a GUI. I am having a hard time figuring out how to do math in apple script<br />could yall help please<br />thx <br />chris
</div>
 
Top