Please help with coding

Hello. I am having a hard time figuring out what to do. This is what I need to do:

Add a new function called ‘Tap’, that sends a ‘t’ each time it is pushed. Rewrite the Arduino program code to include a global variable called counter that will accumulate how many times the Tap button has been pressed. You should then add code in the loop to check to see if the Tap button has been pressed and then display the current value of counter if so. Next, have the motor move forward for 1 second each time the counter is odd, and stop each time the counter is
even.

This is my code

//Define the H-bridge components of the L298N Motor Controller
#define ENA 5 //Define enable pin for one set of output pins
#define ENB 6 //Define enable pin for the other set of pins
#define IN1 7 //Define enable for Motor 0
#define IN2 8 //Define enable for Motor 1
#define IN3 9 //Define enable for Motor 2
#define IN4 11 //Define enable for Motor 3

//Define pin for LED
#define LED 13

bool state = LOW;
char getstr;
unsigned char carSpeed = 220; //define speed for motors (car)
int counter;


void setup() 
{
  Serial.begin(9600); //start serial communication
  pinMode(LED,OUTPUT); //set LED pin to output mode
  pinMode(IN1,OUTPUT); //set H-bridge pins to OUTPUT
  pinMode(IN2,OUTPUT); //
  pinMode(IN3,OUTPUT); //
  pinMode(IN4,OUTPUT); //
  pinMode(ENA,OUTPUT); //
  pinMode(ENB,OUTPUT); //
  stop();
}

//Control LED sub function
void stateChange()
{
  state =! state;
  digitalWrite(LED,state);
}


void stop()
{
  digitalWrite(ENA,LOW);
  digitalWrite(ENB,LOW);
  Serial.println("Stop!");
}

void forward(int milli)
{
  digitalWrite(ENA,HIGH);
  digitalWrite(ENB,HIGH);
  digitalWrite(IN1,HIGH);
  digitalWrite(IN2,LOW);
  digitalWrite(IN3,LOW);
  digitalWrite(IN4,HIGH);
  Serial.println("Forward");
  delay(milli);
  stop(); 
}

void back(int milli)
{
  digitalWrite(ENA,HIGH);
  digitalWrite(ENB,HIGH);
  digitalWrite(IN1,HIGH);
  digitalWrite(IN2,LOW);
  digitalWrite(IN3,LOW);
  digitalWrite(IN4,HIGH);
  Serial.println("Back");
  delay(milli);
  stop();
}

void left(int milli)
{
  digitalWrite(ENA,HIGH);
  digitalWrite(ENB,HIGH);
  digitalWrite(IN1,LOW);
  digitalWrite(IN2,HIGH);
  digitalWrite(IN3,LOW);
  digitalWrite(IN4,HIGH);
  Serial.println("Left");
  delay(milli);
  stop();
}

void right(int milli)
{
  digitalWrite(ENA,HIGH);
  digitalWrite(ENB,HIGH);
  digitalWrite(IN1,LOW);
  digitalWrite(IN2,HIGH);
  digitalWrite(IN3,LOW);
  digitalWrite(IN4,HIGH);
  Serial.println("Right");
  delay(milli);
  stop();
}

void tap()
{
  Serial.println("Tap");
}


void loop() 
{
  //The Bluetooth serial port to recieve the data in the function
  getstr = Serial.read();
  if(getstr == 'a')
  {
    stateChange();
  }
  if(getstr == 'f')
  {
    forward(1000);
  }
  if(getstr == 'b')
  {
    back(1000);
  }
  if(getstr == 'l')
  {
    left(1000);
  }
  if(getstr == 'r')
  {
    right(1000);
  }
  if(getstr == 's')
  {
    stop();
  }
}

When is the assignment due?

Due tomorrow at midnight eastern standard time

dennyman:
Due tomorrow at midnight

Which time-zone?

What is the problem? Does the sketch not work?

Have you got something called “Tap”?

At a minimum, you need to define a pin variable for the pin that the button switch is connected to. How much work have you already done on the professor's sketch?

You need to follow simple directions to pass most courses. You were asked to, "Add a new function called 'Tap', that sends a 't' each time it is pushed". You seem to have added a function called 'tap' that sends a 'Tap' every time it is pushed. That's not a great start, considering how easy it would be to be correct.

When was the exercise handed over to you?
How many exercises did you have before this exercise?

If this is the very first exercise the teacher handed over to you on the very first day of your programming course
where the programming-course was announced as suited for total beginners. it is unfair,
I don't know if it is this way.

I guess

a.) you had have time to read the basics of programming at least a few days

b.) have had 4 to 10 former exercises that are more basic than this one.
but haven't done them or just copied and pasted the solution from somebody else.

If you go on asking other people doing your homework it will get worse more and more.

I recommend this introduction to programming Arduinos

Arduino Programming Course
It is easy to understand and a good mixture between writing about important concepts
and get you going.

best regards Stefan