Engineering > QUESTIONS & ANSWERS > SAN JOSÉ STATE UNIVERSITY E10 Introduction to Engineering Homework 3 Programming. (All)
SAN JOSÉ STATE UNIVERSITY E10 Introduction to Engineering Homework 3 Programming. SAN JOSÉ STATE UNIVERSITY E10 Introduction to Engineering 2. (6 pts) What is the value of the variable ‘A’ at ... end of the following program? Show your reasoning. Line 0 Void main (void) Line 1 { Line 2 int A; Line 3 int COUNT; Line 4 A=1; Line 5 COUNT=0; Line 6 while (COUNT < 5) Line 7 { Line 8 if (COUNT<2) Line 9 { A=A+4; } Line 10 else { Line 11 A=A+COUNT; } Line 12 COUNT = COUNT +1; Line 13 } Line 14 } 3. (6 pts) Find and indicate all of the errors in the following program. (Hint: one of the errors has to do with an unwanted infinite loop) Line 0 void main(void) Line 1 { Line 2 int P; Line 3 int Q; Line 4 int R; Line 5 P = 30; Line 6 Q = 0; Line 7 R= 4; Line 8 if ( P > R;) Line 9 { Q = R - P; Line 10 R= 0; Line 11 if ( Q=0) Line 12 { S = P + Q +R ;} Line 13 P =2; Line 14 while (P <20) Line 15 { S=P+1; Line 16 Q=Q+1; Line 17 R= R+1 Line 18 } Line 19 } 5. (3 pts) There are 5 red LEDs on the electronic board (IRB). Describe what it means when they are on. The answer to this is found in the robot documentation on the web site. Hint: read Robot Guidelines. In the Robot Project Guidelines notes, the 5 red LEDs represent as status indication. LED 1, LED 2, and LED 3 are ON, these detectors are at high rate gives out random flashing. LED 4 is ON, 1KHz is selected where the circuit turned to the red beacon. LED 5 is ON, the setting of the circuit is at low sensitivity. [Show More]
Last updated: 2 years ago
Preview 1 out of 5 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Apr 28, 2023
Number of pages
5
Written in
This document has been written for:
Uploaded
Apr 28, 2023
Downloads
0
Views
78
In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·