Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am willing to double the points for this (email me at thecontact(at)gmail(dot)

ID: 3565711 • Letter: I

Question

I am willing to double the points for this (email me at thecontact(at)gmail(dot)com if you're able to get it done.)

Using a LINUX operating system environment (SecureShell, etc..),

construct a C program using selection and repetition control structures, satisfying the following properties:

1. The program should prompt the user and get integer numbers from the keyboard, one number at a time.

2. As each number is input, the program should keep track of several things: 1. (The number of integers input so far; 2. The sum of the integers input so far; 3. The largest of the integers input so far; 4. The smallest of the integers input so far; 5. A count of how many integers input are greater than 20; and 6. A count of how many integers input are between 10 and 90, inclusive.)

3. Once the above tasks are carried out for a single integer input, the program should prompt and obtain the next integer and repeat the above tasks.

4. The repetition should continue until the user inputs the integer 99999. This input of 99999 should not be counted among the integers, the calculation of the sum, average, largest, smallest, or other counts mentioned above. 5. If the number of integers input is positive, the program should then print out the following quantities, one item per line, appropriately labeled, and aligned to produce easily readable output. Remember, the last input of 99999 should not be included in any of the counts or calculations: The total number of integers input The sum of the integers input The square root of the sum of the integers input The average of the integers input The smallest of the integers input The largest of the integers input The number of integers greater than 20 The number of integers between 10 and 90, inclusive

6. If the number of integers input is zero, the program should print out the message "No input was provided."

The program should include the following:

1. A function named getNumber, which takes in one address parameter so that the integer input from the keyboard is picked up. 2. A function named current_largest, which keeps track of the largest of the integers input so far. 3. A function named current_smallest, which keeps track of the smallest of the integers input so far. 4. A function named counter_20, which keeps count of the number of integers input, which are greater than 20. 5. A function named between_counter, which keeps count of the number of integers input, which are between 10 and 90, includive. 6. A function named print_results, which prints out all of the results listed above in one place. 7. The main function, which consists of a loop to make the repetition work as described above, calculate the sum and average, as well as calling the needed functions described above for each integer input.

Explanation / Answer

#include<stdio.h>
#include<math.h>

int main(){
int num;
int numCount = 0, sum = 0, largest = 0;
int smallest = 9999999, countAbove20 = 0;
int countBetween = 0;

do{
printf("Enter a num : ");
scanf("%d",&num);

if(num == 99999){
break;
}
numCount++;
sum += num;
if(num > largest){
largest = num;
}
if(num < smallest){
smallest = num;
}
if(num > 20){
countAbove20++;
}
if(num > 10 && num < 90){
countBetween++;
}
}while(num != 99999);

if(numCount > 0){
printf("The total number of integers input is %d ",numCount);
printf("The sum of the integers input is %d ",sum);
printf("The square root of the sum of the integer input is %f ",sqrt(sum));
printf("The avarage of the integers input is %d ",sum/numCount);
printf("The smallest of the integers input is %d ",smallest);
printf("The largest of the integers input is %d ",largest);
printf("The number of integers greater than 20 are %d ",countAbove20);
printf("The number of integers between 10 and 90 are %d ",countBetween);
}else{
printf("No input was provided ");
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote