Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve for C and follow instructions In a TV show, each minute can be either interesting or boring. Assume that if 7 consecutive minutes

Please solve for C and follow instructions

image text in transcribed

In a TV show, each minute can be either interesting or boring. Assume that if 7 consecutive minutes are boring, then an average viewer will stop watching the show. Write a C program that calculates how many minutes that an average viewer will watch a TV show, given the interesting minutes. Assume the TV shows are 45 minutes long. Requirements - Name your program project4_minutes.c. - Follow the format of the examples below. - The program will read in the number of interesting minutes, then read in the interesting minutes. - The program should include the following function. Do not modify the function prototype. int find_minute(int minutes, int n ); - minutes represents the input array for interesting minutes, n is the length of the array (the number of interesting minutes). The function returns the how many minutes an average viewer will watch the show. - This function should use pointer arithmetic- not subscripting - to visit array elements. In other words, eliminate the loop index variables and all use of the [] operator in the function. - In the main function, call the find_minute function and display the result. - Pointer arithmetic is NOT required in the main function. Examples (your program must follow this format precisely) Example \#1 Enter the number of interesting minutes: 3 Enter the interesting minutes: 71328 Output: 20 Note: In the first example, minutes 14,15,16,17,18,19,20 are all boring and thus an average viewer will stop watching after the 20 th minute. So, the average viewer will watch for 20 minutes

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles Of Database Systems With Internet And Java Applications

Authors: Greg Riccardi

1st Edition

020161247X, 978-0201612479

More Books

Students also viewed these Databases questions