b) Consider the following C programs in Table Q5b. Write the first 3 output sequences generated...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
b) Consider the following C programs in Table Q5b. Write the first 3 output sequences generated by Arduino code 1 and Arduino Code 2. Arduino Code 1 /* Global variable definition char stone; char problem = 'blind' ; char person = 'blind'; void setup () { Serial.begin(9600); Serial.println("Welcome to the well-being assistant program"); } void loop () { if(person == problem){ stone = problem; } Table Q5b: Arduino C programs Arduino Code 2 if((person != problem) && (problem==stone)) { delay(1000); Serial.println("Help Not Needed"); } } else if((person == problem) && (problem==stone)) { delay(1000); Serial.println("Help Needed"); } int i; float temp = 25.0; void setup (void) { Serial.begin(9600); Serial.println("Welcome to the weather station."); } void loop(void) { if(temp >=20.0 && temp < 30.0) { for(i temp;i>23; i--) { windy"); temp = temp+3; delay(1000); Serial.println("The weather is cool and delay(1000); } } else { (8 marks) delay(1000); Serial.print("The temperature is: "); Serial.println(temp); Serial.println("The weather is getting hot & humid"); delay(1000); } b) Consider the following C programs in Table Q5b. Write the first 3 output sequences generated by Arduino code 1 and Arduino Code 2. Arduino Code 1 /* Global variable definition char stone; char problem = 'blind' ; char person = 'blind'; void setup () { Serial.begin(9600); Serial.println("Welcome to the well-being assistant program"); } void loop () { if(person == problem){ stone = problem; } Table Q5b: Arduino C programs Arduino Code 2 if((person != problem) && (problem==stone)) { delay(1000); Serial.println("Help Not Needed"); } } else if((person == problem) && (problem==stone)) { delay(1000); Serial.println("Help Needed"); } int i; float temp = 25.0; void setup (void) { Serial.begin(9600); Serial.println("Welcome to the weather station."); } void loop(void) { if(temp >=20.0 && temp < 30.0) { for(i temp;i>23; i--) { windy"); temp = temp+3; delay(1000); Serial.println("The weather is cool and delay(1000); } } else { (8 marks) delay(1000); Serial.print("The temperature is: "); Serial.println(temp); Serial.println("The weather is getting hot & humid"); delay(1000); }
Expert Answer:
Answer rating: 100% (QA)
It seems there is an issue with the provided code There are syntax errors and inconsistencies in bot... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
1. Consider the full-wave phase-controlled rectifier circuit of Fig. Pl.1 and supplied from an ac source of v(t) = 110 sin 377t and with a= 45. The load is and R-L-E load with R=2.5 92, L= 750 F 380...
-
An engineer was asked to estimate some measurements for a client. The client wants to know an off-the-cuff estimate on how many stone slabs would be needed to fill the land area between two...
-
Assume the following: Sales price and cost of a property are $ 3 , 0 0 0 , 0 0 0 and $ 2 , 1 0 0 , 0 0 0 , respectively, so that the total profit to be recognized is $ 9 0 0 , 0 0 0 . Seller received...
-
1. Consider the following problem: Suppose that the interest rate in this year is 5% and all investors expect that interest rates for the next 3 years will be as follows: Year 1 2 3 Forward Interest...
-
A boxer can hit a heavy bag with great force. Why can't he hit a piece of tissue paper in midair with the same amount of force?
-
A couple of magnitude M = 80 lbin. and the three forces shown are applied to an angle bracket. (a) Find the resultant of this system of forces. (b) Locate the points where the line of action of the...
-
A column arrangement similar to Figure \(15-2\) is used for organic liquids. A large reservoir of water is under the column. The water is stirred and solute concentration in the water is constant....
-
Roscoe & Jones, Ltd, a CPA firm in Silver Bell, Arizona, has completed the audit of the financial statements of Excelsior Corporation as of, and for, the year ended December 31, 20X1. Findings...
-
Preparing a Statement of Cash Flows Indirect Method Sketchers Corporation s recent comparative balance sheet and income statement follow. Balance Sheet, December 3 1 Prior Year Current Year Assets...
-
Express Delivery is a rapidly growing delivery service. Last year, 80% of its revenue came from the delivery of mailing "pouches" and small, standardized delivery boxes (which provides a 20%...
-
Personal jurisdiction is possible over the objection of an out of state defendant _ _ _ _ _ _ _ _ _ _ . if the court believes that justice would be served at anytime and for whatever reason under due...
-
1. What is something that is unique about India? Explain. 2. What is something that is surprising about India? Explain. 3. Why should you choose India as a country to research on for the topics...
-
Assume that the actual dividend yield is 4.0% for the S&P 500 index. i) Calculate the theoretical equilibrium futures price for the June 2020 E-mini S&P 500 stock index futures contract. ii) What is...
-
Discuss how subsidy and subvention in the followinghealthcare institutions are impacted byan ageing population: 1) Public Polyclinic 2)Public Hospital 3)Public National Speciality Centres (e.g....
-
An economist has forecast that the term structure of interest rates will remain flat. According to the liquidity preference theory, what does the economist's forecast imply will happen to future...
-
The capital structure of Robinson Inn is current at 60% of equity (i.e., 40% of the debt). You find the debt issued by Robinson Inn has a pretax interest rate of 12%. You also find Robinson Inn...
-
A car rounds an unbanked curve of radius 70 m. If the coefficient of static friction between the road and car is 0.7, what is the maximum speed at which the car traverses the curve without slipping?...
-
What is the purpose of the journal wizard?
-
Quince Interests is a partnership with a tax year that ends September 30, 2012. During that year, Potter, a partner, received $3,000 per month as a guaranteed payment, and his share of partnership...
-
Karim Depak received a Form 1099-B showing the following stock transactions and basis during 2012: None of the stock is qualified small business stock. Calculate Karim's net capital gain or loss...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1 and 2. On September 1, Irene opened a retail store that specializes in sports car...
-
Veering off the mission is one of the key challenges in the boardroom. Why is mission focus so essential to an organization?
-
How do you convince a new member to go through orientation if he has already served on numerous boards and feels he understands what board service is all about?
-
List specific examples of a board not meeting the duties of care, loyalty, and obedience.
Study smarter with the SolutionInn App