SlideShare a Scribd company logo
1 of 2
Download to read offline
For Programming Embedded Systems
Q-03 *Which lines create an array of tasks?
A) line 4
B) line 41
C) line 11
D) line 30 I. #include "rims.h" 2 3 4. typedef struct task state BL LedOff; break; default: int
state; unsigned long period; unsigned long elapsedTime: int (*TickFct) (int); taski state ) I
Transitions switch (state) case BL Ledoff: 11. task tasks [2] break; case BL Ledon: 13. const
unsigned char tasksNum 2; 14. const unsigned long periodBlinkLed = 1500; 15. const unsigned
long periodThreeLeds 500; break; default: break; ) // State actions 17, const unsigned long
tasksPeriodGCD = 500; return state 19. int TickFct BlinkLed (int state) 20. int TickFct
ThreeLeds (int state) 22. unsigned char process!ngRdyTasks = 0; 23. void TimerISR 98. enum
TL States TL TO, TL T1, TL T2 TL State; 100 99. int TickFct ThreeLeds (int state) ( 101
VARIABLES MUST BE DECLARED STATIC/ unsigned char i; if (processingRdyTasks)
/*e.g., static int x = 0; */ /*variables for state machine go here. printf ("Period too short  "): 103
switch (state) case -1: process!ngRdyTasks = 1; for (1 = 0; 1 = 107 108 109 tasks [i].period) case
TL TO: tasks [1]. state = 1 tasks[i].TickFct (tasks[i].state); state = TL T1; tasks[i].elapsedTime0
break; case TL T1: 112 113 tasks [1].elapsedTime += tasksPeriodGCD; processingRdyTasks - 0;
state = TL T2 115 116 38. int main) break; case TL T2: unsigned char i=0; tasks [1]. state =-1;
tasks [1].period = periodBlinkLed; tasks [1] .elapsedTime tasks [1] ·period; tasks [1].TickFct
6T1ckFct BlinkLed; 118 119 120 121 122 123 1 state = TL T0; break; default: state --1; tasks [1]
, state = -1; tasks [1].period periodThreeLeas; tasks [1].elapsedTime = tasks [1].period; tasks
[1].TICkFct = &TICkfct; ThreeLeas; 125 switch (state) 127 128 129 130 case TL TO: get
Timerset (tasksPeriodGCD); break case TL T1: TimerOn () while (1) Sleep return 0 133 135 137
139 h break case TL T2: 61. enum BL States BL Ledoff, BL Ledon BL State; 62. int TickFct
BlinkLed (int state) *VARIABLES MUST BE DECLARED STATIC break; 64. /*e.g., static Int
X = 0; */ 65. /*variables for state machine go here/ default: break switch (state) case-1: return
state state = BL LedOff break; 146 case BL Ledoff: state = BL Ledon; break; case BL Ledon: 1
Solution
Answer :-
C) line 11
Explanation :
Creating Array :
You can create an array by using the new operator .
Syntax :

More Related Content

Similar to For Programming Embedded SystemsQ-03 Which lines create an array .pdf (6)

DHow2 - L6 VHDL
DHow2 - L6 VHDLDHow2 - L6 VHDL
DHow2 - L6 VHDL
 
Snake.c
Snake.cSnake.c
Snake.c
 
New text document
New text documentNew text document
New text document
 
The Inner Secrets of Compilers
The Inner Secrets of CompilersThe Inner Secrets of Compilers
The Inner Secrets of Compilers
 
Loops
LoopsLoops
Loops
 
Transfer functions, poles and zeros.
Transfer functions, poles and zeros.Transfer functions, poles and zeros.
Transfer functions, poles and zeros.
 

More from expressionnoveltiesk

There seems to be some evidence supporting the idea of a political b.pdf
There seems to be some evidence supporting the idea of a political b.pdfThere seems to be some evidence supporting the idea of a political b.pdf
There seems to be some evidence supporting the idea of a political b.pdf
expressionnoveltiesk
 
explain how fungi acquire their nutrients. describe the basic body p.pdf
explain how fungi acquire their nutrients. describe the basic body p.pdfexplain how fungi acquire their nutrients. describe the basic body p.pdf
explain how fungi acquire their nutrients. describe the basic body p.pdf
expressionnoveltiesk
 
Define microbial growth. Ftsz and septum are important features of s.pdf
Define microbial growth.  Ftsz and septum are important features of s.pdfDefine microbial growth.  Ftsz and septum are important features of s.pdf
Define microbial growth. Ftsz and septum are important features of s.pdf
expressionnoveltiesk
 
SOMEONE HELP Complete sentences, stating the differences and relati.pdf
SOMEONE HELP Complete sentences, stating the differences and relati.pdfSOMEONE HELP Complete sentences, stating the differences and relati.pdf
SOMEONE HELP Complete sentences, stating the differences and relati.pdf
expressionnoveltiesk
 
Question 12 20 pts Explain five criteria of Statement No. 52 in deter.pdf
Question 12 20 pts Explain five criteria of Statement No. 52 in deter.pdfQuestion 12 20 pts Explain five criteria of Statement No. 52 in deter.pdf
Question 12 20 pts Explain five criteria of Statement No. 52 in deter.pdf
expressionnoveltiesk
 
Please write a project proposal by seeing the following project repo.pdf
Please write a project proposal by seeing the following project repo.pdfPlease write a project proposal by seeing the following project repo.pdf
Please write a project proposal by seeing the following project repo.pdf
expressionnoveltiesk
 
Male, 40 y o. comes to the office. First scheduled the appointment fo.pdf
Male, 40 y o. comes to the office. First scheduled the appointment fo.pdfMale, 40 y o. comes to the office. First scheduled the appointment fo.pdf
Male, 40 y o. comes to the office. First scheduled the appointment fo.pdf
expressionnoveltiesk
 
List and describe the authentication methods businesses use to protec.pdf
List and describe the authentication methods businesses use to protec.pdfList and describe the authentication methods businesses use to protec.pdf
List and describe the authentication methods businesses use to protec.pdf
expressionnoveltiesk
 
Let K be a field. Prove that every not trivial (not necessarily fini.pdf
Let K be a field. Prove that every not trivial (not necessarily fini.pdfLet K be a field. Prove that every not trivial (not necessarily fini.pdf
Let K be a field. Prove that every not trivial (not necessarily fini.pdf
expressionnoveltiesk
 

More from expressionnoveltiesk (20)

The major place where grantic continental crust is manufactured is.pdf
The major place where grantic continental crust is manufactured is.pdfThe major place where grantic continental crust is manufactured is.pdf
The major place where grantic continental crust is manufactured is.pdf
 
There seems to be some evidence supporting the idea of a political b.pdf
There seems to be some evidence supporting the idea of a political b.pdfThere seems to be some evidence supporting the idea of a political b.pdf
There seems to be some evidence supporting the idea of a political b.pdf
 
The CSUN IEEE chapter is to choose a president, treasurer and secret.pdf
The CSUN IEEE chapter is to choose a president, treasurer and secret.pdfThe CSUN IEEE chapter is to choose a president, treasurer and secret.pdf
The CSUN IEEE chapter is to choose a president, treasurer and secret.pdf
 
The atmosphere on earth contains nitrogen in a form that is unusable .pdf
The atmosphere on earth contains nitrogen in a form that is unusable .pdfThe atmosphere on earth contains nitrogen in a form that is unusable .pdf
The atmosphere on earth contains nitrogen in a form that is unusable .pdf
 
explain how fungi acquire their nutrients. describe the basic body p.pdf
explain how fungi acquire their nutrients. describe the basic body p.pdfexplain how fungi acquire their nutrients. describe the basic body p.pdf
explain how fungi acquire their nutrients. describe the basic body p.pdf
 
Define microbial growth. Ftsz and septum are important features of s.pdf
Define microbial growth.  Ftsz and septum are important features of s.pdfDefine microbial growth.  Ftsz and septum are important features of s.pdf
Define microbial growth. Ftsz and septum are important features of s.pdf
 
Suppose that a nation has a labor force of 100 people. In January, A.pdf
Suppose that a nation has a labor force of 100 people. In January, A.pdfSuppose that a nation has a labor force of 100 people. In January, A.pdf
Suppose that a nation has a labor force of 100 people. In January, A.pdf
 
For which of the following types of interpolation is it possible, in .pdf
For which of the following types of interpolation is it possible, in .pdfFor which of the following types of interpolation is it possible, in .pdf
For which of the following types of interpolation is it possible, in .pdf
 
SOMEONE HELP Complete sentences, stating the differences and relati.pdf
SOMEONE HELP Complete sentences, stating the differences and relati.pdfSOMEONE HELP Complete sentences, stating the differences and relati.pdf
SOMEONE HELP Complete sentences, stating the differences and relati.pdf
 
Recontruct the cultural differences argumentSolutionCultural d.pdf
Recontruct the cultural differences argumentSolutionCultural d.pdfRecontruct the cultural differences argumentSolutionCultural d.pdf
Recontruct the cultural differences argumentSolutionCultural d.pdf
 
Question 12 20 pts Explain five criteria of Statement No. 52 in deter.pdf
Question 12 20 pts Explain five criteria of Statement No. 52 in deter.pdfQuestion 12 20 pts Explain five criteria of Statement No. 52 in deter.pdf
Question 12 20 pts Explain five criteria of Statement No. 52 in deter.pdf
 
Please write a project proposal by seeing the following project repo.pdf
Please write a project proposal by seeing the following project repo.pdfPlease write a project proposal by seeing the following project repo.pdf
Please write a project proposal by seeing the following project repo.pdf
 
Does a countrys Institutional and legal system play a major role i.pdf
Does a countrys Institutional and legal system play a major role i.pdfDoes a countrys Institutional and legal system play a major role i.pdf
Does a countrys Institutional and legal system play a major role i.pdf
 
Most primate species    a. live in social groups.    b. live sol.pdf
Most primate species    a. live in social groups.    b. live sol.pdfMost primate species    a. live in social groups.    b. live sol.pdf
Most primate species    a. live in social groups.    b. live sol.pdf
 
please do D E and F .C. Describe loads on Structures wl liui. . D..pdf
please do D E and F .C. Describe loads on Structures wl liui. . D..pdfplease do D E and F .C. Describe loads on Structures wl liui. . D..pdf
please do D E and F .C. Describe loads on Structures wl liui. . D..pdf
 
Male, 40 y o. comes to the office. First scheduled the appointment fo.pdf
Male, 40 y o. comes to the office. First scheduled the appointment fo.pdfMale, 40 y o. comes to the office. First scheduled the appointment fo.pdf
Male, 40 y o. comes to the office. First scheduled the appointment fo.pdf
 
Describe and discuss the 2 pathways for antigen processing exogenou.pdf
Describe and discuss the 2 pathways for antigen processing exogenou.pdfDescribe and discuss the 2 pathways for antigen processing exogenou.pdf
Describe and discuss the 2 pathways for antigen processing exogenou.pdf
 
List and describe the authentication methods businesses use to protec.pdf
List and describe the authentication methods businesses use to protec.pdfList and describe the authentication methods businesses use to protec.pdf
List and describe the authentication methods businesses use to protec.pdf
 
Let X equal the number of flips of a fair cointhat are required to.pdf
Let X equal the number of flips of a fair cointhat are required to.pdfLet X equal the number of flips of a fair cointhat are required to.pdf
Let X equal the number of flips of a fair cointhat are required to.pdf
 
Let K be a field. Prove that every not trivial (not necessarily fini.pdf
Let K be a field. Prove that every not trivial (not necessarily fini.pdfLet K be a field. Prove that every not trivial (not necessarily fini.pdf
Let K be a field. Prove that every not trivial (not necessarily fini.pdf
 

Recently uploaded

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 

Recently uploaded (20)

FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use Cases
 

For Programming Embedded SystemsQ-03 Which lines create an array .pdf

  • 1. For Programming Embedded Systems Q-03 *Which lines create an array of tasks? A) line 4 B) line 41 C) line 11 D) line 30 I. #include "rims.h" 2 3 4. typedef struct task state BL LedOff; break; default: int state; unsigned long period; unsigned long elapsedTime: int (*TickFct) (int); taski state ) I Transitions switch (state) case BL Ledoff: 11. task tasks [2] break; case BL Ledon: 13. const unsigned char tasksNum 2; 14. const unsigned long periodBlinkLed = 1500; 15. const unsigned long periodThreeLeds 500; break; default: break; ) // State actions 17, const unsigned long tasksPeriodGCD = 500; return state 19. int TickFct BlinkLed (int state) 20. int TickFct ThreeLeds (int state) 22. unsigned char process!ngRdyTasks = 0; 23. void TimerISR 98. enum TL States TL TO, TL T1, TL T2 TL State; 100 99. int TickFct ThreeLeds (int state) ( 101 VARIABLES MUST BE DECLARED STATIC/ unsigned char i; if (processingRdyTasks) /*e.g., static int x = 0; */ /*variables for state machine go here. printf ("Period too short "): 103 switch (state) case -1: process!ngRdyTasks = 1; for (1 = 0; 1 = 107 108 109 tasks [i].period) case TL TO: tasks [1]. state = 1 tasks[i].TickFct (tasks[i].state); state = TL T1; tasks[i].elapsedTime0 break; case TL T1: 112 113 tasks [1].elapsedTime += tasksPeriodGCD; processingRdyTasks - 0; state = TL T2 115 116 38. int main) break; case TL T2: unsigned char i=0; tasks [1]. state =-1; tasks [1].period = periodBlinkLed; tasks [1] .elapsedTime tasks [1] ·period; tasks [1].TickFct 6T1ckFct BlinkLed; 118 119 120 121 122 123 1 state = TL T0; break; default: state --1; tasks [1] , state = -1; tasks [1].period periodThreeLeas; tasks [1].elapsedTime = tasks [1].period; tasks [1].TICkFct = &TICkfct; ThreeLeas; 125 switch (state) 127 128 129 130 case TL TO: get Timerset (tasksPeriodGCD); break case TL T1: TimerOn () while (1) Sleep return 0 133 135 137 139 h break case TL T2: 61. enum BL States BL Ledoff, BL Ledon BL State; 62. int TickFct BlinkLed (int state) *VARIABLES MUST BE DECLARED STATIC break; 64. /*e.g., static Int X = 0; */ 65. /*variables for state machine go here/ default: break switch (state) case-1: return state state = BL LedOff break; 146 case BL Ledoff: state = BL Ledon; break; case BL Ledon: 1 Solution Answer :- C) line 11 Explanation : Creating Array :
  • 2. You can create an array by using the new operator . Syntax :