Question

In: Computer Science

In 2 to 3 paragraphs describe the C program written below (What the program is supposed...

In 2 to 3 paragraphs describe the C program written below (What the program is supposed to do). State the requirements for the program (How does the program meet the requirements) and discuss the logical process your program uses to meet those requirements (The process steps to meet the requirements).

#include "stdio.h"

int main(void)

{

//initialize array
int arr[100];

  //initialize variables
  int i=0, j=0, n=0;

   //infinite loop which will stop when user enters -1
  while(n != -1)

{
  

printf("Enter percentage grade(0-100). Enter -1 to stop: ");

//read grade
  scanf("%d",&n);

  //if user entered grade is not -1
if(n != -1)
{
//save it to array
arr[i++] = n;
  
}
//if user entered -1, then exit this loop
else
{

break;

}  
  
}
  
  
printf("\n\nThe grades are: \n");

//loop which will iterate till no:of user entered grades
for(j=0; j<i; j++)

{
  //print the grade
  printf("%d ",arr[j]);

}
  
return 0;

}

Solutions

Expert Solution


Related Solutions

. Written presentations should be a minimum of 2-3 paragraphs per each diagnosed condition (3 conditions...
. Written presentations should be a minimum of 2-3 paragraphs per each diagnosed condition (3 conditions minimum). Symptom Presentation: Adrenalin: Increased epinephrine (catecholamine production) from the adrenal medulla Heart Rate: Increased resting heart rate with intermittent bursts of arrhythmia Blood Pressure: Systemic hypertension reported over the past 8 months Hypertensive Retinopathy: arteriolar constriction, vascular wall changes, cotton-wool spots, yellow hard exudates, and optic disk edema Previously, you researched and considered three conditions through the process of differential diagnosis that would...
A program written in C that asks for the distance to be entered and then prints...
A program written in C that asks for the distance to be entered and then prints the fare A transportation company has the following rates For the first 100 miles                                                       20 cents a mile For the next 100 miles                                                       a) + 10 cents per mile over 100 miles For the next 100 miles                                                       b) + 8 cents per mile over 200 miles more than 300 miles                                                          c) + 5 cents per mile over 300 miles Write a program that asks...
1. Describe the origin of exponents in 2-3 paragraphs (please cite)
1. Describe the origin of exponents in 2-3 paragraphs (please cite)
Write 3 paragraphs (5-7 sentences) describe: 1.What Ocean Acidification is and what causes it 2. What...
Write 3 paragraphs (5-7 sentences) describe: 1.What Ocean Acidification is and what causes it 2. What are the affects of acidification to the ocean environment and marine life. 3. What does NOAA stand for and what do they do?
(Written in C)The input below shows a grid dimension (first line), the following 2 are the...
(Written in C)The input below shows a grid dimension (first line), the following 2 are the positions of the start cell and end cell, and the rest is the positions of cells blocked. Keep in mind that the input is an txt file to be read through stdin (you can not type input multiple times). How do I read the input using scanf . Also, it is not allow to store input into array (because we can not assume the...
You may use either written paragraph or bullet-point format. Part 1 should be 2–3 paragraphs in...
You may use either written paragraph or bullet-point format. Part 1 should be 2–3 paragraphs in length or an equivalent amount of content in bullet-point form. Part 1: Pricing Strategy Briefly describe pricing for your product or service. How does this compare to competitors, assuming competitors are at or near break-even point with their pricing? Analyze pricing alternatives and make recommendations about pricing going forward based on the following: How sensitive are your customers to changes in price? What revenue...
Marketing and Advertising. 2 to 3 paragraphs long List and describe the three different variables that...
Marketing and Advertising. 2 to 3 paragraphs long List and describe the three different variables that you feel contribute to overall ad effectiveness. List three different variables that you feel take away the effectiveness of ads.
Make an essay of 2-3 paragraphs and discuss the nature of an exponentially growing quantity. Describe...
Make an essay of 2-3 paragraphs and discuss the nature of an exponentially growing quantity. Describe its characteristics. Discuss population growth as an example. Discuss the impact of population growth on the demand for electric power in the U.S. Explain why electric power use can grow faster than population growth. What impact does this have on quality of life issues, both for the general public, and those in the energy industries? What’s the impact on energy resource, and disposal of...
In 2-3 paragraphs and on your own words, describe Missing data and how to deal with...
In 2-3 paragraphs and on your own words, describe Missing data and how to deal with it
2) Describe in 2-3 paragraphs the key differences (strengths and weaknesses) of Quantitative versus Qualitative research...
2) Describe in 2-3 paragraphs the key differences (strengths and weaknesses) of Quantitative versus Qualitative research methods as you interview Millennial and Gen Z participants on the impact of Covid 3) Why is conducting Covid research among students so important? 4) Why is the notion of ‘do no harm’ so important when conducting marketing research on topics such as CBD legalization and the use of cannabis in vaping devices?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT