You are on page 1of 2

Performance-Based Assessments:

Activity No. 1
Directions:
1. Download the following computer programs on this link
https://quest.jhcsc.edu.ph/mod/assign/view.php?id=5in
2. Discuss and differentiates what type of programming paradigms they used on the programs you have
downloaded.
3. Based on No. 2. Write a reflection paper on importance different programming paradigms and
languages in solving computing problems. (In your reflection journal raise the value of computer
programming (whatever the paradigm is used) in our daily living?

(Program No. 1)
#include <iostream>
using namespace std;
void line(), message(); // Prototypes
int main()
{
cout << "Hello! The program starts in main()." << endl;
line();
message();
line();
cout << "At the end of main()." << endl;
return 0;
}
void line() // To draw a line.
{
cout << "--------------------------------" << endl;
}
void message() // To display a message.
{
cout << "In function message()." << endl;
}

(Program No. 2)
#include <iostream>
using namespace std;
int main ()
{
double price1=390;
double price2=25.70;
double price3=150;
double totalcost,change,payment;
cout<<"\n Welcome to ABC COMPUTER SHOP"<<endl;
cout<<"\n *** List of Items***"<<endl;
cout<<"\n Kingston 16GB USB 3.0 Flash Drive:"<<price1;
cout<<"\n A4 Tech OP-720 PS2 Optical Mouse "<<price2;
cout<<"\n K280 USB Gaming Keyboard with Mouse"<<price3<<endl;
totalcost= price1+price2+price3;
cout<<"\n TOTAL :"<<totalcost;
cout<<"\n Please enter payment:";
cin>>payment;

if (payment>=totalcost)
{
change =payment - totalcost;
cout<<"\n Your change is: "<<change<<endl;
}
else
{
cout<<"\n Sorry you have entered an Insufficient amount!";
}

return 1;
}

(Program No. 3)
#include <iostream>
using namespace std;

int main()
{
//local variable declaration
float grade;

cout << "\n Input Student Grade : ";


cin >> grade;

if(grade>85)

cout << "\t\t Very Good" << endl;

else if(grade>=60 && grade<=80)

cout << "\t\t Good" << endl;

else if(grade>=40 && grade<=60 )

cout << "\t\t Fair" << endl;


else
cout << "\t\t Need Improvement" << endl;
return 0;
}

You might also like