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...
-
The amount y of photosynthesis that takes place in a certain plant depends on the intensity x of the light present, according to y = 120x2 - 20x3 .... for x ( 0 (a) Graph this function with a...
-
Record the following transactions of J. Min Designs in a general journal: DATE TRANSACTIONS 2016 April 1 Purchased merchandise on credit from ORourke Fabricators, Invoice 885, $3,000, terms 1/10,...
-
What are the most controversial terms of the term sheet? Why are these terms considered to be controversial?
-
The production supervisor of the Machining Department for Gilman Company agreed to the following monthly static budget for the upcoming year: Gilman Company Machining Department Monthly Production...
-
Puck A (4kg) is traveling due East at 10m/s when it collides with Puck B (7kg), which is initially at rest. After a glancing collision, Puck A continues at 6m/s at an angle of 16 North of East. Puck...
-
Virginia Tech operates its own power generating plant. The electricity generated by this plant supplies power to the university and to local businesses and residences in the Blacksburg area. The...
-
Q25. Write a Servlet program which retrieves record from database
-
Explain how organizations should choose appropriate T&D methods.
-
Should organizations rely solely on recruiting through the Internet? Why or why not?
-
How can HRIS T&D applications help firms foster organizational learning?
-
What are the advantages and disadvantages of e-learning?
-
In each of the following situations, formulate the null and alternative hypotheses. a. A new product will be introduced if it is preferred by more than 70 percent of the consumers in the target...
-
Translate the following verbal statement into an algebraic equation and then solve: Maji bought a bookcase on sale for $100, which was one-third of the original price. What was the original price of...
-
Consider model (9.18). What is the effect on the model parameter estimates, their standard errors, and the goodness-of-fit statistics when (a) The times at risk are doubled, but the numbers of deaths...
-
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...
-
If you were advising an investor interested in purchasing a sport franchise, what advice would you give?
-
What must players and agents understand about risk? How should an agent structure a players contract if it contains deferred compensation?
-
An owner of several sport assets holds the following portfolio: What is the beta of this portfolio? ASSET INVESTMENT BETA Team A $100,000,000 0.5 Team B $100,000,000 1.0 Facility A $100,000,000 1.5...
Study smarter with the SolutionInn App