void byValue(int x) { x = 100; } // original value α ααααα
void byRef(int &x) { x = 100; } // original value αααα«αQ3. Function Overloading:
Explanation: Multiple functions with the same name but different parameters. The compiler chooses the right one based on the arguments passed. α αα΅ α΅α α«ααΈα αα α¨α°αα«α© parameters α«ααΈα functionsα’ compiler α¨αα α©α α΅α arguments α°ααα©α α΅αααααα function αααα£αα’
int add(int a, int b) { return a + b; } // ααα΅ int
float add(float a, float b) { return a + b; } // ααα΅ float
// α αα΅ α΅α αα "add" - αα parameters ααα«α«α
PART IV β Output Questions
Q1. 2D Array output:
Explanation: The loops run only for
i=2, j=0 β that is val[2][0] = 1. β Output: 1
Q2a. break version:
Explanation:
sum=+i means sum = +i (assign), not sum += i (add). When i=3, break fires immediately before assignment.i=5 β sum=5, i=4 β sum=4, i=3 β break!
β Output: 4
Q2b. continue version:
Explanation:
continue skips to the next iteration. sum+=i comes after continue so it never executes. Sum stays 0. β Output: 0
Q3. String program:
Explanation:
strncpy(z, y, 9) copies first 9 characters of y into z. Then z[9]='\0' ends the string.β Output:
String y: It is a nice day
String z: It is a n
Q
4. Swap function:
Explanation : A is pass by value (copy), B is pass by reference (real). So only b changes in main.
A=4+18=22 (local), B=22-18=4 (b in main changes!), A=22-4=18 (local only)
Back in main: a=4, b=4
β Output: 4, 4
PART V β Programs
Q1. Income Tax
using namespace std;
int main(){
float salary, tax = 0;
cout << "Enter salary: ";
cin >> salary;
if(salary <= 200)
tax = 0;
else if(salary <= 600)
tax = (salary - 200) * 0.10;
else if(salary <= 1200)
tax = 400*0.10 + (salary - 600)*0.15;
else if(salary <= 2000)
tax = 400*0.10 + 600*0.15 + (salary-1200)*0.20;
else if(salary <= 3500)
tax = 400*0.10 + 600*0.15 + 800*0.20 + (salary-2000)*0.25;
else
tax = 400*0.10 + 600*0.15 + 800*0.20 + 1500*0.25 + (salary-3500)*0.30;
cout << "Income tax = " << tax << " Birr" << endl;
return 0;
}
Q2. Count students below 45
using namespace std;
int main(){
int n, mark, count = 0;
cout << "Enter number of students: ";
cin >> n;
for(int i = 0; i < n; i++){
cout << "Enter mark for student " << i+1 << ": ";
cin >> mark;
if(mark < 45)
count++;
}
cout << "Students below 45: " << count << endl;
return 0;
}
Q3. Enter until negative
using namespace std;
void enterNumbers(){
int num;
while(true){
cout << "Enter a number: ";
cin >> num;
if(num < 0){
cout << "Now you have entered a negative number" << endl;
break;
}
}
}
int main(){
enterNumbers();
return 0;
}
@ProgrammingWithFaith2018
β€4
If anyone has last year's C++ final exam, please post it here in the comment section. π»π
@ProgrammingWithFaith2018
π²
@ProgrammingWithFaith2018
π²
1.
Function declaration malet just le compilerα sle function αααα nw
Syntax : datatypes functions_name(parameters )
Example
int sum(int a,int b)
with parameter
int sum() without parameter
So
Answer:) D
Because it lack return type
2.
ANSWER:) A
We define structure first then we create a variable @ProgrammingWithFaith2018
Function declaration malet just le compilerα sle function αααα nw
Syntax : datatypes functions_name(parameters )
Example
int sum(int a,int b)
with parameter
int sum() without parameter
So
Answer:) D
Because it lack return type
2.
ANSWER:) A
We define structure first then we create a variable @ProgrammingWithFaith2018
β€3
5.
Arrya is collection of elements with the same data types.
To access first element of array we use
Array[0]
To access the last
Array[n-1]
But to access the memory address of first element just we call it's name
for example int ages[]={1,3};
ages // to access the memory address of first element
So
β Answer :)D
6.
Strcpy(a,b) copies the entire string from b to a
So
β Answer :) A
Arrya is collection of elements with the same data types.
To access first element of array we use
Array[0]
To access the last
Array[n-1]
But to access the memory address of first element just we call it's name
for example int ages[]={1,3};
ages // to access the memory address of first element
So
β Answer :)D
6.
Strcpy(a,b) copies the entire string from b to a
So
β Answer :) A
β€3
Forwarded from Hustler Hub (βFaithβ)
α«αα viral α³ααα£ ααα©
ααααͺα« link αα©α΅ α ααα αα αα° playstore α²αα°α³α½α app download α£ααα΅ αα α²α¨αα΅αα½α α google account ααα± α£αα
β α α°α¨α α°α αα₯α,video α αα¨α΅α αα¨ααα
1 invitatin - 1$$$$$
αα αΆα ααα©
α«ααα£α½α ααα α«α α ααα
linkπ
https://play.google.com/store/apps/details?id=com.app.cash.adda.playandwin
1000 coin =1$ αααα α α¨α³α½ α«ααα Referral code copy α ααα½α αα
ππ
@examanswer1
ααααͺα« link αα©α΅ α ααα αα αα° playstore α²αα°α³α½α app download α£ααα΅ αα α²α¨αα΅αα½α α google account ααα± α£αα
β α α°α¨α α°α αα₯α,video α αα¨α΅α αα¨ααα
1 invitatin - 1$$$$$
αα αΆα ααα©
α«ααα£α½α ααα α«α α ααα
linkπ
https://play.google.com/store/apps/details?id=com.app.cash.adda.playandwin
1000 coin =1$ αααα α α¨α³α½ α«ααα Referral code copy α ααα½α αα
ππ
M97b6xshpKQNOLUkbKwc2T1gxPw2@examanswer1
π2β€1
Affirmative Action α¨αα°α α αα΄αΆα½ α£α¨ α α³α ααα ααα‘ α₯α α α α«α αα³α°αα½ ααα’
So α΄αΆα½ 20%
α α³α ααα 5%
α α«α αα³α°αα½ 5% Free quota α ααΈα ααα΅ ααα’
ααα³α :-Software maximum in take capacity last year 80 students αα αα’
80%20 = 16 ,so 64 α°ααͺ α rank αα ααα£α α¨αα©α΅ 16 α°ααͺ α°α free Quota αα΄αΆα½ α αα’
α₯αα΅ α΄α΅ rankα 160 α’αα α₯α Software α Affirmative ααα£α΅ α₯ααα 64 α αα α«αα΅α α΄αΆα½ ααα α αα , ααα³α 1-160 rank αα΅α₯ 30 α΄αΆα½ α’αα© α£ α¨ α₯αα αα΅α₯ α°α 15 α΄αΆα½ 1-64 rank αα΅α₯ α’αα© α¨αα©α΅ 15 α΄αΆα½ α α ααΈα rank compete α«α°αααα’
So 15 α rank α΅α αα‘ α¨Affirmative Action Qouta α ααα α’
α¨αα©α΅ 10 α΄αΆα½ αα ααα³α 100-160 α’αα α Affirmative Action Quota 15 α΅α αα 10 αα α₯αα ααα£α α₯αα°αα 5 free Quota ααα«α ααα΅α α¨160 α αα α«αα΅ 5 α΄αΆα½ α¨αα α«αααα Risk Soft ααα£αα’
Mostly α°ααͺ α α αα°α α¨αααα α Software ,CS,Elec ,Bio ,IT αα α΅ααα 1-100 rank α«αα΅ ααα Software αααα£α ααα΅ α α°αα α₯α Just Worst Case senario αα΅α ααα soft α’αα‘ α₯α¬ α α΅α₯ αα 1-64 αα΅α₯ Elec,Cs,Bio ααα α΅α ααα© α¨ααααα΅ dep. α¨ααα£α΅ Chance ααα―αΈαα ααα΅ ααα’
@ProgrammingWithFaith2018
How affirmative action work ?
Affirmative Action α¨αα°α α αα΄αΆα½ α£α¨ α α³α ααα ααα‘ α₯α α α α«α αα³α°αα½ ααα’
So α΄αΆα½ 20%
α α³α ααα 5%
α α«α αα³α°αα½ 5% Free quota α ααΈα ααα΅ ααα’
ααα³α :-Software maximum in take capacity last year 80 students αα αα’
80%20 = 16 ,so 64 α°ααͺ α rank αα ααα£α α¨αα©α΅ 16 α°ααͺ α°α free Quota αα΄αΆα½ α αα’
α₯αα΅ α΄α΅ rankα 160 α’αα α₯α Software α Affirmative ααα£α΅ α₯ααα 64 α αα α«αα΅α α΄αΆα½ ααα α αα , ααα³α 1-160 rank αα΅α₯ 30 α΄αΆα½ α’αα© α£ α¨ α₯αα αα΅α₯ α°α 15 α΄αΆα½ 1-64 rank αα΅α₯ α’αα© α¨αα©α΅ 15 α΄αΆα½ α α ααΈα rank compete α«α°αααα’
So 15 α rank α΅α αα‘ α¨Affirmative Action Qouta α ααα α’
α¨αα©α΅ 10 α΄αΆα½ αα ααα³α 100-160 α’αα α Affirmative Action Quota 15 α΅α αα 10 αα α₯αα ααα£α α₯αα°αα 5 free Quota ααα«α ααα΅α α¨160 α αα α«αα΅ 5 α΄αΆα½ α¨αα α«αααα Risk Soft ααα£αα’
Mostly α°ααͺ α α αα°α α¨αααα α Software ,CS,Elec ,Bio ,IT αα α΅ααα 1-100 rank α«αα΅ ααα Software αααα£α ααα΅ α α°αα α₯α Just Worst Case senario αα΅α ααα soft α’αα‘ α₯α¬ α α΅α₯ αα 1-64 αα΅α₯ Elec,Cs,Bio ααα α΅α ααα© α¨ααααα΅ dep. α¨ααα£α΅ Chance ααα―αΈαα ααα΅ ααα’
@ProgrammingWithFaith2018
β€2π1
Forwarded from ααα α€α΅ | Film Bet ποΈπ½οΈ
Media is too big
VIEW IN TELEGRAM
Spider-Man: Brand New Day (2026) 1080p V3-HDTC Multi-LiNE [English + Hindi + Tamil +Telugu] ESub
πΈ@filmbet28
πΈ@filmbet28
Forwarded from Jimma University CS 2015
How is the grade given for the internship? π
For IT, CS, and IS, it will count as one course, and the grade is based on how much you get. π
Ass1 represents the result from the companyβit is worth 50% of the total grade. However, the company will give you a score out of 100%, which will then be divided by 2 to convert it to a score out of 50%.
For example, if the company gives you 94 out of 100%, in Ass1 it will be divided: 94/2 = 47.
Ass2 is evaluated by your advisor based on your report and is worth 25%. π
So far: 50 + 25 = 75.
The remaining 25% is split into:
β Quiz (5%) β they will ask you questions after your presentation. π£οΈ
β Final Examination (20%) β your presentation and document will be evaluated while you present. π€
Example:
If the company gives you 100 out of 100, your advisor gives you 24 out of 25, you get 4 on the quiz, and 17 on the final exam:
β Ass1 = 50
β Ass2 = 24
β Quiz = 4
β Final Examination = 17
Total = 50 + 24 + 4 + 17 = 95 β which is an A+.
@jucs_2015
#Cs
#Internship
β€1