yall have been a great help.
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
i am trying to make an applescript application do what my C++ code is doing here:
#include <iostream>
#include <string>
using namespace std;
int main()
{
int number_incorrect=0, number_correct=0, total_questions=0, point_value, score=100;
string name;
char answer;
cout<<"\n\nWelcome to CET PRETEST";
cout<<"\nWhat is your name:";
cin>>name;
//must not have 3 questions
cout<<"\n\nGet ready "<<name<<endl;
++total_questions;
cout<<"\n\nQuestion 1:\nA computer takes _____ and gives ______.";
cout<<"\n A) AC-AC \n B) AC-DC \n C) DC-AC \n D) DC-DC";
cout<<"\nYour answer:";
cin>>answer;
cout<<"\ncorrect answer: B"<<endl;
if (answer == 'B' || answer=='b')
++number_correct;
else
++number_incorrect;
cout<<"\ntotal correct:"<<number_correct<<endl;
++total_questions;
cout<<"\n\nQuestion 2:\nCMOS stands for:";
cout<<"\n\n A) Computer Made On Service\n B) Computer Mode Onside Service\n ";
cout<<"C) Complementry Metal Oxcide Semicunductor\n D) Computer Mode Online Service";
cout<<"\nEnter your Answer:";
cin>>answer;
cout<<"\ncorrect answer: C"<<endl;
if (answer == 'C' || answer=='c')
++number_correct;
else
++number_incorrect;
cout<<"\nTotal correct:"<<number_correct<<endl;
++total_questions;
cout<<"\n\nQuestion3:\nSIMM stands for what?";
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;
cout<<"Your answer:";
cin>>answer;
cout<<"\ncorrect answer: A";
if (answer == 'A' || answer =='a')
++number_correct;
else
++number_incorrect;
cout<<"\n Total correct:"<<number_correct<<endl;
++total_questions;
cout<<"\n\nQuestion"<<total_questions<<"\nA floppy drive cable has how many pins?";
cout<<"\n\n A) 20\n B) 30\n C) 32\n D) 40"<<endl;
cout<<"Your answer:";
cin>>answer;
cout<<"correct answer: C";
if (answer=='C' || answer=='c')
++number_correct;
else
++number_incorrect;
cout<<"\nTotal correct:"<<number_correct<<endl;
cout<<"\nTotal incorrect:"<<number_incorrect<<endl;
//score
point_value=100/total_questions;//100 divided by 2 = 50
score=point_value*number_correct;//50 times number correct
cout<<"\n\nYour score is: "<<score<<endl;
return 0;
}
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
could yall help please
thx
chris

New Topic/Question
Reply



MultiQuote



|