Question: Answer all Q PLZ Experiment #2 - C Program Structure/Variables, Data types, Input and Output Diplome First Year EECP. Lab Activity (Skill Test) Task 1:
Experiment #2 - C Program Structure/Variables, Data types, Input and Output Diplome First Year EECP. Lab Activity (Skill Test) Task 1: Create an algorithm, flowchart and C program that will accept the year of birth and display the age (3 Marks). Process: age=2021-yob Run Mode Run Mode with Input and Output Year of Birth: Year of Birth: 2000 your age 121 ...Progris finished with exit cadeo Press ENTER to exit console. Task la. Algorithm (0.5 mark) 1 Task 1b. Flowchart (0.5 mark) 2. 3. 5. 6. 7. 8. Task 1c. Source Code - Paste the program below. (1.5 marks) Task 1d. Output Paste the output of the program below. (0.5 mark) Experiment #2 - C Program Structure/Variables, Data types, Input and Output Der Fine Year EECP Task 2: Create a C program using the following equations and display the resulta, T and 5 [3 marks) input value of x.ya: 135 T-3a+y result --30.236069 793.708206 -224.944275 ST+a+x ... Program finished with eat code Press ENTER to east coasted Task 2a. Source Code Paste the program below. (2.5 marks). Task 2b. Output - Paste the output of the Cprogram below. (0.5 mark) Task 3: Below is the expected output of the c program that follows. Hello. May 1 know the first letter of your name: D I am pleased to meet you D can you tell me your year of birth: 2002 It 15 so nice to meet 18 year old person, we are about the same age By the way, I need to exchange my 300 US dollars to Omani rials, can you tell me the exchange rate right now: 0.387 Thank you, I will now have a cash total of 116.100 Omani rials Bye. It was nice meeting you. ... Program finished with exit code o Press ENTER to exit console. Find the errors and correct them so that the c program below will give the correct results as shown above. (3 marks) // Ahmed Al Kindi 12S12345 Experiment 2 Task 2 Working with Different Data Types (Troubleshooting the errors) / #include int mani() { char name: int yob, age: float xchange, cash; print("Hello. May i know the first letter of your name: "); scanf("%c",&Name); printf("I am pleased to meet you %c " name): printf(" Can you tell me your year of birth: "); sacnf("%d",&YOB): Age = 2020-yob; printf(" it is so nice to meet %c year old person, we are about the same agen", age) printf(" By the way, I need to exchange my 300 US dollars to Omani rials, Incan you tell me the exchange rate right now: scanf("%d",&xchange): cash = 300 * xChange: printf("Thank you, I will now have a cash total of %0.3f Omani rialsn,cash"); printf(" Bye. It was nice meeting you. "); return 0; } VI. CONCLUSION (End of Activity Assessment) This section tests your understanding of the experiment / topic you learnt in this session. 3 marks Each correct answer will be awarded 0.100 mark. 1. C Program Structure Re-arrange the numbering of the items below so that it follows the correct structure of any program, from the first up to the last line of code: Number based on Correct Order 8. #include reprocessor directive 6. void main() l'it is used at the start of the main function" 7. { start of main() function" 5. float A, B. Ave; variables declaration 1. scanf("%f%f", &A, &B): 'input statement 3. Ave = (A + B)/2 processing statement 2. printf("Ave = %f " Ave): output statement" l'end of main() function 2 DataTypes and Format Specifiers In the statements below, select the correct choice: I integer) or F (float) or D (double) or C (for character). 1. char 2. It is used to store whole positive or negative numbers 3. %d 4. Examples of this are: 501.-70.-1234 5. It is used to store 1 letter / character 6. % 7. int 8. Examples of this are: 'D','%,8, 9. %C 10. It is used to store real numbers (with a precision up to 6 digits) 11. Examples of this are: -345.67.8965.0412 12. % 13. It is used to store real numbers (with a precision up to 15 digits) 14. Examples of this are: -94.9878543097, 100.125634978 3. Input and Output Functions / Control Characters in C Match column A with column B by putting a line. Column A Column B 1 control character to create a new line scanf("Format Specifiers &variable 1, &variable2......., 2 used for formatted input from keyboard 3 syntax for the output function in C printf("Higherit Collegeinof Technology:"> 4 example of formatted input from keyboard print 5 used for formatted output on the screen scanf("%f%, &x &y! 6 syntax for the input function in C scant 7 example of formatted output on the screen printf("Format Control String". Constants/Variables/Expressions): control character to create a tab of 8 characters in OOO BBC DO F 00099999999999 00000000000000 OOOOOOOOOOOOOC 00000000000000 OOOOOOOOOOOOOO F O. UL OOOO 8