Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

PW2 Report Dharvin 10DTK21F1007

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

ELECTRICAL ENGINEERING DEPARTMENT

DEC 20012 PROGRAMMING FUNDAMENTAL


PRACTICAL WORK ASSESSMENT

SESSION: 2021/2022
CLASS : DTK2B

TITLE Practical Work 2


PRACTICAL NUMBER 1/2/3/4/5/6

ITEM \ STUDENT S1 S2 S3 S4
1. Fixes /10 /10 /10 /10

2. Complete /10 /10 /10 /10

3. Manipulates /10 /10 /10 /10

Practical Skill 4. Builds /10 /10 /10 /10


Assessment 5. Display /10 /10 /10 /10
[CLO2 PLO5]
6. Test Description and results /10 /10 /10 /10
7. Efficiency /10 /10 /10 /10
8. Source Code /10 /10 /10 /10

Total Practical Skill Assessment [80%]


1.Theory and Discussion /10
Report
2.Conclusion / 10
Assessment
Total Report Assessment [20%] /20

STUDENTS NAME REGISTER NUMBER TOTAL MARKS


100%
DHARVIN A/L RAJENDRAN 10DTK21F1007
S1

S2

S3

S4

LECTURER’S NAME PN.LIM BEE LING DATE 30/03/2022


RUBRIC FOR ASSESSING PRACTICAL WORK AND REPORTS
DEC20012 PROGRAMMING FUNDAMENTALS

PRACTICAL SKILL ASSESSMENT PERFORMANCE OF STUDENT DURING EXECUTION OF PRACTICAL WORK 1-6
CLO2 Build programs written in C language for assigned mini project during practical work sessions
PLO5 Apply appropriate techniques, resources, and modern engineering and IT tools to well-defined engineering
problems, with an awareness of the limitations (DK6);
DK 6 Codified practical engineering knowledge in recognised practice area
Marks
Item 10 8 6 4 2
The program works The program The program The program The program
Fixes and all error are produces 4 produces 3 correct produces 2 correct produces 1
fixed correct results results results correct result
The program works The program The program The program The program
and complete all complete 4 complete 3 complete 2 complete 1
Complete
statements statements statements correctly statements statements
correctly correctly correctly
The program works The program The program works The program The program is
and meets all of the works and meets and produces the produces correct producing
specifications and all of the correct results and results but does incorrect
Manipulates The code is specifications. displays them not display them results.
exceptionally well correctly. It also correctly.
organized and very meets most of the
easy to follow. other specifications.
The use of flowchart The flowchart The flowchart have The flowchart have The flowchart
symbols and its have one error in two errors in the three errors in the have more
sequence is correct, the symbols or symbols or sequence symbols or than three
Builds from step 1 to end sequence of step of step sequence of step errors in the
and well organized symbols or
and very easy to sequence of
understand. step
All outputs is correct. 1 output is 2 outputs incorrect. 3 outputs 4 outputs
incorrect. incorrect. incorrect.
 Measurements are  Measurements are
both accurate and  Measurements mostly accurate  Measurements  Measuremen
precise are accurate  Observations are are somewhat ts are
 Observations are with reasonable generally complete inaccurate and incomplete,
very thorough and precision  Work is organized very imprecise inaccurate
may recognize  Observations  Only 2 or 3 minor  Observations are and
possible errors in are thorough errors using incomplete or imprecise
data collection  Work is symbols, units and recorded in a  Observations
Display  Work is neat and generally neat significant digits confusing way are
organized and organized  There are 3 or incomplete
 Includes  Includes more minor or not
appropriate symbols, units errors using included
symbols, units and and significant symbols, units  Symbols,
significant digits digits and significant units and
digits or 2 major significant
errors figures are
not included
A program
solution is not
submitted or
is
The program submitted but
The program
1 program compiles visual
All the program compiles successfully
compiles not successfully and inspection of
compiles successfully and
successfully provides a the code
Test and provides a provides a successful
provides a successful solution indicates that
description successful solution solution to the
solution to the to the the submitted
and results to the problem problem situation for
problem problem situation code is less
situation. some but not all
situation. for some but not all than 50%
input
input complete as
would be
required to
solve the given
problem
.
Unable to
Efficiency Unable to solve Unable to solve all solve all the
Able to solve all
some of the the problems, but problems, but
Able to solve all the the problems
problems, but manage to fix all manage to fix
problems correctly correctly with
manage to fix all the the problems some of the
without supervision. minimum
problems correctly correctly with problems
supervision.
with supervision. supervision. correctly with
supervision.
Program runs Program code Program code Program code Program code
without errors and contains minimal contains significant contains major has not been
Source code produces correct errors amounts of code errors and completed
results have not been produces incorrect
completed results

Excellent mechanics, Significant Some grammatical Poor grammar, Lack of clarity,


sentence structure, mechanics, lapses, uses weak poor
and organization structure and emotional response communication presentation
organization in lieu of relevant of thinking
Knowledge: points Knowledge: Limited
Comprehensive, in- Knowledge: Up to superficial Knowledge:
depth and wide date and relevant Knowledge: Relevant knowledge/respons Little
ranging but not e relevance/som
Theory &
Understanding: comprehensive e accuracy
Discussion
Understanding: High level of Understanding:
Outstanding ability ability to Understanding: Limited ability to Understanding
to grasp concepts conceptualize Some ability to draw out concepts : Minimal
and Relate theory to essential ideas conceptualize and relate theory awareness
practice. and relate theory essential ideas and to practice. that external
to practice. relate theory to concepts exist
practice.

1. The conclusion 1. The Did not make


1. The 1. The conclusion
thoroughly and conclusion connections to
conclusion states the results
accurately states the the results and
Conclusion explains the of the
explains the results of the process of the
results of the experiment.
results of the experiment. experiment.
experiment
experiment and
why they and why they 2. Made 2. but did not
occurred. occurred. connections made
2. The explanations between connections
of all variables 2. Explanations variables and between
are clear and of all results, variables and
support the variables results,
conclusion. support the 3. but I did not
3. findings are conclusion. analyze or 3. but did not
based on the explain the analyze or
experimental 3. provided connections. explain the
process. evidence to connections.
4. analyze or support or
explain the explain
connections. findings.

TOTAL
(100%)
ELECTRICAL ENGINEERING DEPARTMENT

DEC20012: PROGRAMMING FUNDAMENTALS

build programs written in C language for assigned mini project during


CLO2
practical work session ( P4 , PLO 5 )
PRACTICAL WORK 2 : Selection Statements
PRACTICAL WORK DATE :
LECTURER’S NAME: PN.LIM BEE LING

NAME : DHARVIN A/L TOTAL


RAJENDRAN STUDENT ID : 10DTK21F1007 MARKS
1. Fixes
2. Complete
3. Manipulates
4. Builds
Practical Skill 5. Display
Assessment 6. Test description and results
[CLO2]
7. Efficiency
8. Source code
Total Practical Skill Assessment
A. Total Practical Skill Assessment (80%)
1. Theory & Discussion
Report 2. Conclusion
Assessment
Total Report Assessment
B. Total Report Assessment (20%) = /15*20
Total A+B (100%)
DATE SUBMIT : DATE RETURN :
1 LEARNING OUTCOMES (LO):
1.Understand selection statements.
2.Apply selection statements.
2 OBJECTIVE
1. To fixes, Complete and Manipulates the selection statement.
2. To builds flowchart of selection statement.
3. To display the output of selection statement.
3 THEORY
 The C statements that are used for altering the normal flow of a program are called control statements.
 Various control statements, such as selection and looping statements, are available in C.
 Selection statements are used to execute a set of instructions, just once, when the specified condition is
satisfied.
 The types of selection statements available in C are if and switch.
 Looping statements are used to execute a set of instructions repeatedly, as long as the specified condition is
satisfied.
 The types of looping statements available in C are for, while and do-while.
 The if statement is used for checking conditions and transferring the control to the body of the if statement
based on the condition.
 The selection statement, which allows you to choose from a number of choices, is the switch statement.
4 EQUIPMENT / TOOLS
Computer, C programming language ( Dev-cpp, codeblock, dll)
PART A : Independent Learning (NF2F)
(Student must do this task at home or before entering a computer lab)
Define control statements.
Answer: Control statement is a statement that determines whether other
statements will be executed.

List the types of control statements.


Answer: 1. Sequence
2. Selection
3. Repetition

Define selection statement


Answer: Allows choosing between two or more execution paths in a
program.

list selection statements


Answer: a) if
b) if-else
c) switch

Define IF statement
Answer: one way decision statement

Define IF-ELSE statement


Answer: two-way decision statement

Define SWITCH statement


Answer: multi branching control statement
PART B: Laboratory PW5 (Dependent Learning (F2F)
(To be done in a computer lab)
Write the syntax for Simple IF Statement Draw flowchart for IF Statement
Answer: Answer:
if(expression) start
{
statement block
} False
expression

True

Statement 1 Statement 2

End

Write the syntax for IF-ELSE Draw flowchart for IF-ELSE


Statement Statement
Answer:
Answer: if(expression) start
{
statement 1 False
} else expression
{
statement 2 True
}
Statement 1 Statement 2

End

Write the syntax for SWITCH Statement Draw flowchart for SWITCH Statement
Answer: Answer:
switch(expression)
start
{ cas
e
1: statement(
break;
expression
case
2 : statement(
break; Case 1
case
Statement (s)
3 : statement(
break; Case 2

… Statement (s)
case
n : statement( default
break;
default : statement(s); Statement (s)
}
next_statement; End
PART B: PRACTICAL WORK AT LABORATORY
Practical Assignments 1 (Fixes Program)
To calculate series and parallel circuits.

Series parallel
Find an errors and correct the programme to illustrate the working of IF-ELSE statements to calculate the
total resistance for series and parallel circuit. Get the output after fixes all errors
#include <stdio> Correction:
main() #include<stdio.h >
{ main ()
int selection; {
float series, parallel; int selection;
float R1=100,R2=300, R3=500; float series, parallel;
printf("1: Series Circuit\n"); float R1=100,R2=300, R3=500;
printf("2. Parallel Circuit \n"); printf("1: Series Circuit\n");
printf("Please Select your choice \n "); printf("2. Parallel Circuit \n");
scanf("%d", $selection); printf("Please Select your choice \n ");
IF (selection==1) scanf("%d", &selection);
{ if (selection==1)
series = R1+R2+R3; {
printf(" Total resistance = %.2d Ohm\n",series); series = R1+R2+R3;
} printf(" Total resistance = %.2f Ohm\n",series);
else if (selection==2) }
{ else if (selection==2)
PARALLEL = 1/(1/R1 +1/R2+1/R3) ; {
printf(" Total resistance = %.6f Ohm\n",parallel); parallel = 1/(1/R1 +1/R2+1/R3) ;
} printf(" Total resistance = %.6f Ohm\n",parallel);
else }
{ else
printf(" wrong choice \n "); {
} printf(" wrong choice \n ");
return 0; }
} return 0;
}
Output:
If selection =2
Practical Assignments 2 (Complete Program)

RT = R1 + R2 + R3
Series parallel
Complete all statements in the programme below to illustrate the working of SWITCH statements to calculate
the total resistance for series and parallel circuit. Get the output after fixes all errors
#include <stdio.h>
main()
{
Int ;
float series, parallel,R1,R2,R3;
printf("******************************************");
printf("\nEnter the value of R1= ");
scanf( );
printf("\nEnter the value of R2= ");
scanf("%f",&R2);
printf("\nEnter the value of R2= ");
scanf ( );
printf("******************************************");
printf("\n1: Series Circuit");
printf("\n2. Parallel Circuit "); printf("\nPlease
Select your choice ");
printf("******************************************");
scanf("%d",&selection);
switch(selection)
{
case 1:
series = R1+R2+R3;
printf(" ”, );
break;
case 2:
parallel = 1/(1/R1 +1/R2+1/R3) ;
printf(" ”, );
break;
default:
printf(" wrong choice \n ");
}
return 0;
}
Output:
If choice =2 If choice =1
Practical Exercise 1: Manipulates Program 1
By referring to the Practical Assignments 2, draw flowchart and write a C program using SWITCH
statements to calculate the total capacitance of three capacitors of series and parallel connected. Get the
output of the programme. ( the formula of series and parallel capacitors are given below

Series parallel
Ask input from user the value of C1,C2 and C3

Flowchart :

Start

Initialization – C1, C2, C3, CT,selection

Accept C1,C2,C3

Select choice

False
Wrong choice Case 𝐶𝑇 = 𝐶1 + 𝐶3 + 𝐶3
default
True
1
𝐶𝑇 =
1 1 1
+ +
𝐶1 𝐶2 𝐶3

Display CT

Program:
Output:
If choice =1 If choice =2
Practical Exercise 2: Manipulates Program 2:
By referring to the Practical Assignments 2, draw flowchart and write a C program using IF-ELSE
statement to make a choice for calculate:
Choice 1: Total resistance of the circuit, Rtotal

Choice 2: Current, I

Choice 3: Voltage drop across resistor 8Ω, VR3

Choice 4: Current through resistor 4Ω, IR1

referring to the circuit below

Ask input from user R1,R2,R3 and E

Flowchart :
Program:
Output:
Case 1

Case 3
Discussion for practical work 2
From this practical work 2, I have understood selection statements such as if and switch and apply in codin

Conclusion for practical work 2

In conclusion, I have fixes, complete and manipulates the selection statement and builds flowchart of selectio

You might also like