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

Computer-Assisted Instruction: Programming Exercise: Write a program to allow th

ID: 3711602 • Letter: C

Question

Computer-Assisted Instruction: Programming Exercise: Write a program to allow the user to pick a type of arithmetic problem to study. An option of 1 means addition problems only, 2 means subtraction problems only, 3 means multiplication problems only, 4 means division problems only and 5 means random mixture of all these types. (Computer- Assisted Instruction) The use of computers in education is referred to as computer- assisted instruction (CAI). Write a program that will help an elementary school student learn arithmetic operations. Use a Random object to produce two positive one- digit integers. The program should then prompt the user with a question, such as How much is 6 times 7? The student then inputs the answer. Next, the program checks the student’s answer. If it’s correct, display the message "Very good!" and ask another multiplication question. If the answer is wrong, display the message "No. Please try again." and let the student try the same question repeatedly until the student finally gets it right. Modifying Exercise: (Computer- Assisted Instruction: Reducing Student Fatigue) One problem in CAI environments is student fatigue. This can be reduced by varying the computer’s responses to hold the student’s attention, so that various comments are displayed for each answer as follows: Possible responses to a correct answer: Very good! Excellent! Nice work! Keep up the good work! Possible responses to an incorrect answer: No. Please try again. Wrong. Try once more. Don't give up! No. Keep trying. Use random- number generation to choose a number from 1 to 4 that will be used to select one of the four appropriate responses to each correct or incorrect answer. Use a switch or if statement to issue the responses. Modifying Exercise (Computer- Assisted Instruction: Monitoring Student Performance) More sophisticated computer- assisted instruction systems monitor the student’s performance over a period of time. Count the number of correct and incorrect responses typed by the student. After the student types 10 answers, your program should calculate the percentages that are correct. If the percentage is lower than 75%, display "Please ask your teacher for extra help.", then reset the program so another student can try it. If the percentage is 75% or higher, display "Congratulations, you are ready to go to the next level!", then reset the program so another student can try it.

Please make the program in Perl SCRIPTING

Please make the program simple

Explanation / Answer

ANS:-

PROGRAM:-

Copyable Code:
----------------------------------------------------------------------------------------------------


#perl_Computer_Assisted_Instruction.pl

use strict;
use warnings;


sub start_program{

print "Please select type of arithmetic problem to study.";
print "select 1 for addition problems ";
print "select 2 for subtraction problems ";
print "select 3 for multiplication problems ";
print "select 4 for division problems ";
print "select 5 for random arithmetic problem problems ";
chomp (my $option= <STDIN>);

if($option == 1){
addtion_problems();
}
elsif($option == 2){
substract_problems();
}
elsif($option == 3){
multiply_problems();
}
elsif($option == 4){
division_problems();
}
elsif($option == 5){
random_arthmetic_problems();
}
else{
print "You have not selected any option ";
}
}


sub addtion_problems(){
#get 2 random positive number;
my $a= get_random_number_lower_upper_limit(1,101);
my $b =get_random_number_lower_upper_limit(1,101);
my $answer_status = 0;
do
{ print "what is sum of $a and $b ? ";
chomp(my $user_answer = <STDIN>);
my $answer = $a + $b;  
if ($user_answer eq $answer ){
$answer_status = 1;
}
answer_message($answer_status);
}while($answer_status eq 0);
  
}

sub substract_problems(){
#get 2 random positive number;
my $a= get_random_number_lower_upper_limit(1,101);
my $b =get_random_number_lower_upper_limit(1,101);
my $answer_status = 0;
do
{ print "what is diffence of $a and $b ? ";
chomp(my $user_answer = <STDIN>);
my $answer = $a - $b;
if ($user_answer eq $answer ){
$answer_status = 1;
}
answer_message($answer_status);
}while($answer_status eq 0);
  
}


sub multiply_problems(){
#get 2 random positive number;
my $a= get_random_number_lower_upper_limit(1,101);
my $b =get_random_number_lower_upper_limit(1,101);
my $answer_status = 0;
do
{ print "what is $a times $b ? ";
chomp(my $user_answer = <STDIN>);
my $answer = $a * $b;
if ($user_answer eq $answer ){
$answer_status = 1;
}
answer_message($answer_status);
}while($answer_status eq 0);
  
}

sub division_problems(){
#get 2 random positive number;
my $a= get_random_number_lower_upper_limit(1,101);
my $b =get_random_number_lower_upper_limit(1,101);
my $answer_status = 0;
do
{ print "what is $a divide by $b ? ";
chomp(my $user_answer = <STDIN>);
my $answer = $a / $b;
$answer = sprintf("%.3f", $answer); #round to 3 decimal point  
  
if ($user_answer eq $answer ){
$answer_status = 1;
}
answer_message($answer_status);
}while($answer_status eq 0);  
}


sub random_arthmetic_problems(){
my $random_option= get_random_number_lower_upper_limit(1,5);
if( $random_option eq 1){
addtion_problems();
}
elsif( $random_option eq 1){
substract_problems()
}
elsif( $random_option eq 1){
multiply_problems();
}
elsif( $random_option eq 1){
division_problems();
}

}

sub answer_message{
my $answer = shift;
if($answer == 1){
print " Very good! ";

}
else{
print "No. Please try again ";
  
}
}  

sub get_random_number_lower_upper_limit{

my $lower_limit = shift;
my $upper_limit = shift;

my $random_number = int(rand($upper_limit-$lower_limit)) + $lower_limit;
return $random_number;

}


start_program();

---------------------------------------------

##reducefatigue.pm

use strict;
use warnings;

# get a questionare of 5 questions
# for each question find if answer is correct or inncorect
# if in correct any one of correct response
# if in correct any one of incorrect response

sub question_source{
my $source = shift;
  
if($source == 1){
print "what is the result of 5 +3 ?"

}
if($source == 2){
print "what is the result of 5 - 3 ?"
}
if($source == 3){
print "what is the result of 5 * 3 ?"
}
if($source == 4){
print "what is the result of 5 - 5 ?"
}
if($source == 5){
print "what is the result of 5 + 5 ?"
}
  
my $user_answer = <STDIN>;
chomp $user_answer;
return $user_answer;
}

sub get_random_number{
# generate a random number in perl in the range 1-4
my $lower_limit = 1;
my $upper_limit = 5;

my $random_number = int(rand($upper_limit-$lower_limit)) + $lower_limit;
return $random_number;
}


sub check_answer{
my $user_answer = shift;
my $question = shift;
  
my @answerArray = ("first_index", "8", "2", "15", "0" , "10");
my $returnvalue = ( $user_answer == $answerArray[$question] ) ? 1 : 0;
return $returnvalue;
}


my @correct_answer_response =( "dummy not used",
"Very good!",
"Excellent!",
"Nice work! ",
"Keep up the good work!"
);

my @incorrect_answer_response =( "dummy not used",
"No. Please try again.",
"Wrong. Try once more. ",
"Don't give up! ",
"No. Keep trying."
);




my $no_of_questions = 5;
for my $question ( 1.. $no_of_questions){
my $user_answer1 = question_source($question);
my $answer = check_answer($user_answer1, $question);  
my $random_number = get_random_number();
if($answer == 1){
# print "The Answer is correct "
print $correct_answer_response[$random_number] . " "
}
else{
#print "The Answer is incorrect "
print $incorrect_answer_response[$random_number] . " "
}
  

}

##

perl_Monitoring_Student_Performance.pl

use strict;
use warnings;


sub start_program{


print "You will get 10 question on addition. Please solve as much as possible ";
my $continue_question = 'N';
do{
my $answer_count = 0;
my $total_questions = 10;
for( my $i =0; $i < $total_questions; $i++){

my $answer_status = addtion_problems();
$answer_count += $answer_status;
}
print "You have answered $answer_count out of $total_questions " ;
my $percent = ($answer_count/$total_questions)*100;
print "Your percentage is $percent %";
if($percent lt 75){
print "Please ask your teacher for extra help. ";
}
else{
print "Congratulations, you are ready to go to the next level! ";
}
print "Do you want to try again [Y/N] ";
chomp( $continue_question = <STDIN>);
} while($continue_question eq 'Y' || $continue_question eq 'y');
}


sub addtion_problems{
#get 2 random positive number;
my $a= get_random_number_lower_upper_limit(1,101);
my $b =get_random_number_lower_upper_limit(1,101);
my $answer_status = 0;
print "what is sum of $a and $b ? ";
chomp(my $user_answer = <STDIN>);
my $answer = $a + $b;  
if ($user_answer eq $answer ){
$answer_status = 1;
}
answer_message($answer_status);
return $answer_status ;
  
}

sub answer_message{
my $answer = shift;
if($answer == 1){
print " Very good! ";

}
else{
print "Sorry! Incorrect ";
  
}
}  

sub get_random_number_lower_upper_limit{

my $lower_limit = shift;
my $upper_limit = shift;

my $random_number = int(rand($upper_limit-$lower_limit)) + $lower_limit;
return $random_number;

}

start_program();

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