0% found this document useful (0 votes)
41 views2 pages

Sahyadri College of Engineering & Management, Mangaluru Mini-Project Report

This document is a mini-project report submitted by student Likhith R for their C and C++ Industry Connect Program course. The report describes an "Angry Professor" program that determines if a discrete mathematics class is cancelled based on student arrival times and a cancellation threshold number. The program takes student arrival times as input, counts those that arrived on time or early, and checks if that count is below the threshold to return "YES" or "NO" for class cancellation. The sample input and output are provided along with the C source code implementing the program logic.

Uploaded by

Kartik Naik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views2 pages

Sahyadri College of Engineering & Management, Mangaluru Mini-Project Report

This document is a mini-project report submitted by student Likhith R for their C and C++ Industry Connect Program course. The report describes an "Angry Professor" program that determines if a discrete mathematics class is cancelled based on student arrival times and a cancellation threshold number. The program takes student arrival times as input, counts those that arrived on time or early, and checks if that count is below the threshold to return "YES" or "NO" for class cancellation. The sample input and output are provided along with the C source code implementing the program logic.

Uploaded by

Kartik Naik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Sahyadri College of Engineering & Management, Mangaluru

Department of Information Science & Engineering


Mini-Project Report

Course Title : C and C++ Industry Connect Program Date: 10/10/2018 Sem / Section:3/A
Faculty: Mr. Vijay C P & Mr. Srinath K S
Student Name:Likhith R USN:4SF17CS078

Title: Angry Professor

Description:

A Discrete Mathematics professor has a class of students. Frustrated with their lack of discipline, he decides to cancel class if
fewer than some number of students are present when class starts. Arrival times go from on time to arrived late.
Given the arrival time of each student and a threshold number of attendees, determine if the class is canceled.

Input Format:
The first line has two space-separated integers, n and k , the number of students (size of a ) and the cancellation threshold.
The second line contains n space-separated integers stores the arrival time of each student in array.
Output format:
If the class is cancelled then print YES
If the the class is not cancelled then print NO.

Input:
53
0 -1 +5 -3 +2

Expected Output:
NO

Source Code:

//Author: Likhith R
//Date: 10/11/2018
#include<stdio.h>
#include<string.h>
int n,k;
char* angry_professor(int *b)
{
int i,students=0;
for(i=0;i<n;i++)
{
if(b[i]<=0)
{
students=students+1; //calculating number of students
on time and before time
}
}
if(students<k)
{
return "YES";
}
else
{
return "NO";
}
}
void main()
{
int a[10],i;
char *ans;
printf("Enter the number students and cancellation threshold\n");
scanf("%d%d",&n,&k); //reading n,k
printf("Enter the arrival time of the %d students\n",n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
ans=AP(a);
puts(ans);
}

Output:
NO

Student Signature with Date:

You might also like