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:
#include<simplecpp>

int noOfDays(int m){
        int jan=31, feb=28, mar=31, apr=30, may=31, jun=30;
        int jul=31, aug=31, sep=30, oct=31, nov=30, dec=31;
        if((m==1)){
                return jan;
        }
        else if((m==2)){
                return feb;
        }
        else if((m==3)){
                return mar;
        }
        else if((m==4)){
                return apr;
        }
        else if((m==5)){
                return may;
        }
        else if((m==6)){
                return jun;
        }
        else if((m==7)){
                return jul;
        }
        else if((m==8)){
                return aug;
        }
        else if((m==9)){
                return sep;
        }
        else if((m==10)){
                return oct;
        }
        else if((m==11)){
                return nov;
        }
        else if((m==12)){
                return dec;
        }
}

int oneWeekLater(int d, int m){
        int jan=31, feb=28, mar=31, apr=30, may=31, jun=30;
        int jul=31, aug=31, sep=30, oct=31, nov=30, dec=31;
        int newd;
        if((m==1)){
               newd=d+7;
               if(newd>jan){
                       newd=newd-jan;
               }
        }
        else if((m==2)){
               newd=d+7;
               if(newd>feb){
                       newd=newd-feb;
               }
        }
        else if((m==3)){
               newd=d+7;
               if(newd>mar){
                       newd=newd-mar;
               }
        }
        else if((m==4)){
               newd=d+7;
               if(newd>apr){
                       newd=newd-apr;
               }
        }
        else if((m==5)){
               newd=d+7;
               if(newd>may){
                       newd=newd-may;
               }
        }
        else if((m==6)){
               newd=d+7;
               if(newd>jun){
                       newd=newd-jun;
               }
        }
        else if((m==7)){
               newd=d+7;
               if(newd>jul){
                       newd=newd-jul;
               }
        }
        else if((m==8)){
               newd=d+7;
               if(newd>aug){
                       newd=newd-aug;
               }
        }
        else if((m==9)){
               newd=d+7;
               if(newd>sep){
                       newd=newd-sep;
               }
        }
        else if((m==10)){
               newd=d+7;
               if(newd>oct){
                       newd=newd-oct;
               }
        }
        else if((m==11)){
               newd=d+7;
               if(newd>nov){
                       newd=newd-nov;
               }
        }
        else if((m==12)){
               newd=d+7;
               if(newd>dec){
                       newd=newd-dec;
               }
        }
        return newd;

}

Grading criterion: Function noOfDays: Condition to check the number of days in the month
Rating A: Correctly checks the condition for the number of days in the month and appropriately sets the value to be returned

Rating B: Some issue. 

Rating C: Major issue. 

Rating D: 0
Assigned grade: A