Question

Stalter code for Program 3b ou e your nane Prog 3b hidet.h> /* connon defines and acros */ #include #include く -derivative. h. derivative-specific definitions void main(void) unsigned short hot0. pleasant0. cold 0 i-0 unsigned short tenps 55. 62. 68. 7459. 45. 41.58. 60 67 65, 78, 82. 88, 91 92. 90, 93. 87. 80, 78, 79, 72, 68. 61, 59-99 / vrite a vhile loop to count the days in each category while(1):Using Embadded C programing

Write a program to process a collection of daily high temperatures. Your program should count the number of hot days (high temperature 85 or higher), the number of pleasant days (high temperature 60–84), and the number of cold days (high temperatures less than 60). Test your program on the following data:

55 62 68 74 59 45 41 58 60 67 65 78 82 88 91

92 90 93 87 80 78 79 72 68 61 59 -99

Note that the last value (-99) is used as a sentinel value and should not be counted as a cold day

On the next page is a screen shot of a working solution with the while loop missing. After you write your loop and get the program running, you can test it by hitting run, then hitting the halt button. Examine memory the variables hot, pleasant and mild. Make sure they are visible in your screen shot.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

while(temps[i] != -99) {

if(temps[i] >= 85)
++hot;
else if(temps[i] >= 60 && temps[i] >= 84)
++pleasant;
else if(temps[i] <60)
++cold;

i++;
}

=============
Add these while loop, u will see pleasant, hot and cold updated.

Thanks, let me know if there is any concern. PLEASE RATE

Add a comment
Know the answer?
Add Answer to:
Using Embadded C programing Write a program to process a collection of daily high temperatures. Your...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. Forecast demand for Year 4. a. Explain what technique you utilized to forecast your demand....

    1. Forecast demand for Year 4. a. Explain what technique you utilized to forecast your demand. b. Explain why you chose this technique over others. Year 3 Year 1 Year 2 Actual Actual Actual Forecast Forecast Forecast Demand Demand Demand Week 1 52 57 63 55 66 77 Week 2 49 58 68 69 75 65 Week 3 47 50 58 65 80 74 Week 4 60 53 58 55 78 67 57 Week 5 49 57 64 76 77...

  • Consider the below matrixA, which you can copy and paste directly into Matlab.

    Problem #1: Consider the below matrix A, which you can copy and paste directly into Matlab. The matrix contains 3 columns. The first column consists of Test #1 marks, the second column is Test # 2 marks, and the third column is final exam marks for a large linear algebra course. Each row represents a particular student.A = [36 45 75 81 59 73 77 73 73 65 72 78 65 55 83 73 57 78 84 31 60 83...

  • Write a python nested for loop that prints out the following pattern 100 99 98 97...

    Write a python nested for loop that prints out the following pattern 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33...

  • Please compute your z -don't use a package State your conclusion in plain English - not...

    Please compute your z -don't use a package State your conclusion in plain English - not just rejection 1 Students in the online class are suspicious that their schools 60 point loss may have caused their teacher to take out his frustration on the students by giving them a harder than usual exam. They manage to hack into his computer and get the following data: Scores for test Nov 2011 71 74 64 77 58 72 73 79 50 78...

  • I need to develop the 7 functions below into the main program that's given on top...

    I need to develop the 7 functions below into the main program that's given on top Write a C program to create array, with random numbers and perform operations show below. Il Project 3 (53-20). 1 Projects CS5,00 This file contains the function Programcution Dagine and one include <timo // Defining some constants definer_SIZE 20 define LOVE LIMIT 1 eine UPR UNIT define TALSE eine Tut 1 wold randomizery (int[], int, Int, int) wold pinay in. St, Int); En find...

  • I need it in JAVA Write a program that randomly populates an array of size 100,...

    I need it in JAVA Write a program that randomly populates an array of size 100, sorts it, and then finds the median. The random numbers must be from 0-99 and all integer values. Also since there is an even set of numbers the median is found by taking the mean of the two middle numbers (In other words the 50th and 51st). You have to code your own sorting method. You may not use a built in java sorter....

  • C++: Create a grade book program that includes a class of up to 20 students each...

    C++: Create a grade book program that includes a class of up to 20 students each with 5 test grades (4 tests plus a Final). The sample gradebook input file (CSCI1306.txt) is attached. The students’ grades should be kept in an array. Once all students and their test scores are read in, calculate each student’s average (4 tests plus Final counts double) and letter grade for the class. The output of this program is a tabular grade report that is...

  • Calculate the range, mean, mode, median, Standard deviation Calculate the skewness and kurtosis for the above...

    Calculate the range, mean, mode, median, Standard deviation Calculate the skewness and kurtosis for the above data and interpret the data. The following is data collected from the daily salary employees of ZZ COMPANY.. 68 19 43 11 37 30 19 67 65 34 96 23 93 73 46 39 21 12 89 52 33 21 18 57 80 56 91 62 56 48 84 23 78 96 49 36 90 42 65 15 43 36 65 59 34 71...

  • Question 9-15 are based on the random sample below which is obtained to test the following hypoth...

    Question 9-15 are based on the random sample below which is obtained to test the following hypothesis about the population mean. Test the hypothesis that the mean is less than 80. 80 100 81 93 80 57 98 90 71 56 58 78 59 55 55 77 72 78 56 94 98 59 93 86 89 62 60 66 59 71 96 97 94 69 64 77 87 77 64 90 90 95 98 99 56 69 72 81 95...

  • write a program that uses a function to read in the grades for four classes and...

    write a program that uses a function to read in the grades for four classes and then uses a function to calculate the average grade in each of the classes. input the grades for one student. we will name her Beverly. output how Beverly's grade differs from each classe average. Make sure that your output is very clear. Below is your data: English 90 70 85 45 95 95 82 97 99 65 History 63 94 60 76 83 98...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT