Problem: In this problem, you are required to write only two functions in the file implementation.cpp. A main program (main.cpp) is already provided and must not be modified.

Function 1: noOfDays

int noOfDays(int m)

Write a function named noOfDays that takes a single integer m (1 to 12 inclusive) and returns the number of days in that month for the year 2025.

You may refer to a calendar to determine the correct number of days for each month.

Examples:

noOfDays(7) must return 31  
noOfDays(2) must return 28  

When this function is called:
- Argument m is guaranteed to be between 1 and 12.

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

Function 2: oneWeekLater

int oneWeekLater(int d, int m)

Write another function named oneWeekLater which MUST USE the function noOfDays.

This function takes two integers:
- d represents the day.
- m represents the month.

The function should return a single integer representing the day (between 1 and 31) that occurs exactly 7 days after the given day and month.

Examples:

oneWeekLater(20, 8) must return 27  
oneWeekLater(24, 2) must return 3  

Explanation:
- 27 August is 7 days after 20 August.
- 3 March is 7 days after 24 February.

When this function is called:
- Argument d is guaranteed to be between 1 and 31.
- Argument m is guaranteed to be between 1 and 12.

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

Main Program

A main program (main.cpp) is already provided. It reads the day and month from input and calls the functions noOfDays and oneWeekLater with appropriate arguments.

You must only implement the required functions in implementation.cpp.

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

Note

- Do not print any extra messages such as:
  cout << "Enter a number"
  cout << "The computed answer is"
- Use cout only to print the computed final output.
- Do not print unnecessary spaces.
- Do not hard-code the answers.
- If any test case passes by simply printing output without logic, marks will not be awarded.

Student submission:
//Including simplecpp in our program
#include<simplecpp>


//Creating a function to determine no. of days in a month
int noOfDays(int m){
//Writing a condition for months with 31 days
    if(m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12){
        return m = 31;  
    }
    //Writing a condition for months with 30 days
    else if(m == 4 || m == 6 || m == 9 || m == 11){
    return m = 30;
    }
    //Writing a condition for February
    else if(m == 2){
        return m = 28;
    }
}

//Writing a function to return the date after 1 week has passed
int oneWeekLater(int d, int m){
    //Writing a condition for months with 31 days
    if(noOfDays(m) == 31){
        if(d > 24){
            return m = 7 + d - 31;
        }
        else return d+7;

    }
    //Writing a condition for months with 30 days
    else if(noOfDays(m) == 30){
        if(d > 23){
            return m = 7 + d - 30;
        }
        else return d+7;
        
    }
    //Writing a condition for February
    else if(noOfDays(m) == 28){
        if(d > 21){
            return m = 7 + d - 28;
        }
        else return d+7;
        
    }
    



}

Grading criterion: Function noOfDays: Declaration and header
Rating A: Correctly declares the function and definition i.e. correct return type along with the name of the function and its arguments

Rating B: Some issue. 

Rating C: Major issue. 

Rating D: 0
Assigned grade: A