Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C programming 1. Circle the correct choices for the following questions. a. Whic

ID: 3838719 • Letter: C

Question

C programming

1. Circle the correct choices for the following questions. a. Which of the following are examples of embedded systems? (Circle all that apply.) v. Supercomputer i. Microwave Oven vi. Notebook Computer ii, Game Console vii. Smart Watch iii. Cell Phone viii. ATM iv, Traffic Light Controller b. If want to use a variable in an embedded system to hold a temperature value that has a range from -60 to +70, which of the following data types is the best to use? (Circle only one.) iv, float v. double ii. signed char iii. unsigned char 2. Write True or False after the following statements. a. Many embedded systems do not have support for floating point arithmetic. b. C is the most popular programming language for embedded systems. 3. Given the following implementations to compute n function int pow3(n) return n n n; lookup table const int pow3 tblll "fo, 1, 8, 27, 64, 125, 216, 343, 512, 729, 1000, 1331, 1728, 2197, 2744, 3375, 4096, 4913, 5823, 6859, 8000 a. Which one would be faster to execute, ii. pow3 tbl[12] pow3(12) b. Which one likely requires more memory to implement? ii. pow3 tbl pow3 c. What is the range of values for n using the lookup table pow3 tbl? Based on the pow3 function from Problem 3, write a new function named pow3P that it takes as input the address (location) of the result. This function shall use the address to update the result directly and not return any value Example function call for pow3P Example function call for pow3 int result int result; pow3P(10, &result;); result pow3(10)

Explanation / Answer

6)

#include <stdio.h>
#include <time.h>

int main() {
time_t t = time(NULL);
struct parseTimedate *parseTimedate = localtime(&t);
char s[64];
strftime(s, sizeof(s), "%c", parseTimedate);
printf("%s ", s);
}

5 - structure for timedate with 7 fields

struct TimeDate
{
int hour;
int minute;
int second;
int dayintheweek;
int day;
int month;
int year;
};

1) - a) microwave oven, cellphone, smart watch, atm, traffic light controller

1) - b) unsigned char is used for storing the temperature

2)- a) false because Many small embedded systems, however, do not have an FPU (internal or external). Therefore, they manipulate floating-point numbers, when necessary, the y follow theold way. They use software subroutines, often called a "floating point emulation library'

2) - b) true because c is the most popular language for embedded systems