Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 5

CS10-1L Computer Fundamentals and Programming Laboratory

Laboratory Exercise

Name

Viado, Emmanuel Russell

Date
Section

1/19/2016
A2

File Name: LE1_Surname.doc


To be uploaded in blackboard

Problem Statement:
1.) The perimeter, approximate surface area, and the approximate volume of an in
ground pool is given by the following formula:
Perimeter = 2(length + width)
Underground surface area = 2(length + width) x average depth + (length x width)
Volume = (length x width) x average depth
Design a flowchart and a C++ program that prompts the user to input value for
length, width, and average depth. Calculate and output the perimeter,
underground surface area, and volume of the swimming pool.
2.) Design a flowchart and a C++ program that will input the numerators and
denominators of the two fractions. Compute and output the product of the two
fractions as a fraction and as a percent.
Sample:
Input:
Output:

Numerator 1 = 1
Denominator 1 = 5
Numerator 2 = 3
Denominator 2 = 8
Product of two fractions as a fraction = 3/40
Product of two fractions as percent = 7.5%

3.) Design a flowchart and a C++ program that will input values to variable E, X, I,
and T. Get their ones digit and compute and output the sum.
Sample:
Input:
Output:

E = 12
X= 628
I= 3
T= 10203
Sum of the ones digit of E, X, I, and T = 16

Laboratory Exercise Score Sheet

Criteria
1.)
2.)
3.)
4.)
5.)
6.)
7.)
8.)
9.)
10.)

Score

Proper Indention of C++ program for number 1


Intelligent/Descriptive naming of variables for number 1

Correct logic for problem number 1


Proper Indention of C++ program for number 2
Intelligent/Descriptive naming of variables for number 2
Correct logic for problem number 2

Proper Indention of C++ program for number 3


Intelligent/Descriptive naming of variables for number 3

Correct logic for problem 3


Exercise finished/submitted within time-frame

Total

_______________________
Engr. Cristina A. Pascua

5
5
20
5
5
20
5
5
20
10
100

_______________
Date

CS10-1L Computer Fundamentals and Programming Laboratory


Laboratory Exercise

Name

1
Viado, Emmanuel Russell P.

Date
Section

File Name: LE1_Surname.doc


To be uploaded in blackboard
1.)
C++ Program
#include <iostream>
#include <cmath>
using namespace std;
int main ()
{
float L, W, AVGD, P, UGSA, V, LW, LW2;
cout<<"Input Length, Width, and Average";
cout<<"Length :";
cin>>L;
cout<<"Width :";
cin>>W;
cout<<"Average Depth : ";
cin>>AVGD;
LW = L + W;
LW2 = L*W;
P = 2*LW;
cout<<"Perimeter is = "<<P<<"\n\n\n";
UGSA = 2*LW*AVGD+LW2;
cout<<"Underground Surface is = "<<UGSA<<"\n\n\n";
V = LW2*AVGD;
cout<<"Volume is = "<<V<<"\n\n\n";
system("pause");
return 0;
}

1/19/2016
A2

2.)
C++ Program
#include <iostream>
#include <cmath>
using namespace std;
int main ()
{
float Num1, Num2, Den1, Den2, Prod1, N, D, P, ND;
cout<<"Numerator 1 = ";
cin>>Num1;
cout<<"Numerator 2 = ";
cin>>Num2;
cout<<"Denominator 1 = ";
cin>>Den1;
cout<<"Denominator 2 = ";
cin>>Den2;
N = Num1*Num2;
D = Den1*Den2;
ND = N/D;
cout<<"\n\n\n";
cout<<"Answer in Fractionn"<<"\n\n\n";
cout<< N <<"/"<<D<<"\n\n\n";
P = ND*100;
cout<<"Answer in Percentage = "<<P<<"\n\n\n";
system("pause");
return 0;
}

3.)
C++ Program
#include <iostream>
using namespace std;
int main ()
{
int E, X, I, T, S;
cout<<"Input the Values of : "<<"\n\n\n"
cout<<"E = ";
cin>>E;
cout<<"X = ";
cin>>X;
cout<<"I = ";
cin>>I;
cout<<"T = ";
cin>>T;
S = E % 10 + X % 10 + I % 10 + T % 10;
cout<<"Sum of the one's digit = "<<S<<"\n\n\n";
system("pause");
return 0;
}

You might also like