0% found this document useful (0 votes)
51 views16 pages

Volume Control and Conversion Programs

The documents contain code listings and flowcharts for programs that perform various calculations and conversions. The first program uses a while loop to convert between pressure units like atm, mmHg, Pa and psi. The second uses a for loop to calculate powers of x from 1 to 10. The remaining documents describe programs for trigonometric conversions, mass unit conversions, and calculating the filling time of a water tank.

Uploaded by

Putera Putera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views16 pages

Volume Control and Conversion Programs

The documents contain code listings and flowcharts for programs that perform various calculations and conversions. The first program uses a while loop to convert between pressure units like atm, mmHg, Pa and psi. The second uses a for loop to calculate powers of x from 1 to 10. The remaining documents describe programs for trigonometric conversions, mass unit conversions, and calculating the filling time of a water tank.

Uploaded by

Putera Putera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

4.a.

Listing Program Volume Kontrol


clear all;
disp('volume kontrol');
d=input('diameter tangki(ft)=');
t=input('tinggi tangki(ft)=');
Q=input('debit air(ft^3/menit)=');
pi=3.14;
VTA=0;
VT=((1/4)*pi*d*d*t);
Va=((95/100)*VT);
disp(['volume tangki(ft^3)=',num2str(VT)]);
disp('waktu yang diperlukan untuk mengisi hingga 95% tangki(menit)');
for V=VT[Link]Va
men=V/Q;
out=[men'];
disp([num2str(out)]);
end
2. [Link] Program Sudut Trigonometri
clear all;
disp('konversi sudut trigonometri');
x=input('masukkan sudut awal=');
b=input('masukkan sudut akhir=');
c=input('interval=');
disp('sudut(x) Sin(x) Cos(x) Tan(x)');
while x<=b
x=x+c;
a=sin(x);
d=cos(x);
f=tan(x);
out=[x' a' d' f'];
fprintf('%8.1f %10.1f %12.1f %15.1f\n',out);
end
3. [Link] Program Konversi Satuan Massa
clear all;
disp('konversi satuan massa');
a=input('masukkan massa beban awal(gr)=');
i=input('interval=');
m=input('masukkan massa beban akhir(gr)=');
disp('gr kg Ib ons');
while a<=m
a=a+i;
kg=(a/1000);
Ib=(a*0.00205);
ons=(a/28.35);
out=[a' kg' Ib' ons'];
disp([num2str(out)]);
end
[Link] Program While End
clear all;
disp('konversi tekanan');
atm0=input('tekanan awal =');
atm1=input('tekanan akhir =');
a=input('interval =');
disp('Atm mmHg Pa Psi Bar');
while atm0<=atm1
atm0=atm0+a;
mmHg=atm0*760;
Pa=atm0*9.869;
Psi=atm0*6.805;
Bar=atm0*1.01325;
out=[atm0' mmHg' Pa' Psi' Bar'];
disp([num2str(out)]);
end
1. [Link] Program For
clear all;
disp('perhitungan pangkat x');
disp(' x x2 x3');
for x=1:10
x2=(x*x);
x3=((x*x)*x);
out=[x' x2' x3'];
fprintf('%8.1f %10.1f %12.1f\n',out);
end
1.b1. Hasil Listing Program While End
1.b2. Hasil Listing Program For
[Link] Listing Program Sudut Trigonometri
3.b. Hasil Listing Program Konversi Satuan Massa
4.b. Hasil Listing Program Volume Kontrol
1.c1. Flowchart Listing Program While End

START

disp('konversi tekanan');
atm0=input('tekanan awal =');
atm1=input('tekanan akhir =');
a=input('interval =');
disp('Atm mmHg Pa Psi');

while
atm0<=atm1

atm0=atm0+a;
mmHg=atm0*760;
Pa=atm0*9.869;
YES Psi=atm0*6.805;
out=[atm0' mmHg' Pa' Psi'];

disp([num2s
tr(out)]);

NO

END
1.c2. Flowchart Listing Program For

START

disp('perhitungan pangkat x');


disp(' x x2 x3');

for
x=1:10

x2=(x*x);
x3=((x*x)*x);
out=[x' x2' x3'];

fprintf('%8.1f
%10.1f %12.1f\
n',out);

END
2.c. Flowchart Program Sudut Trigonometri

START

Disp(‘konversi angka trigonometri’);


X=input(‘masukkan sudut awal=’);
B=input(‘masukkan sudut akhir=’);
C=input(‘interval=’);
Disp(‘sudut(x) sin(x) cos(x) tan(x)’);

While
x<=b

X=x+c;
YES A=sin(x);
D=cos(x);
F=tan(x);

Out=[x’ a’ d’ f’];
Fprintf(‘%8.1f %10.1f
%12.1f %15.1f\n’,out);
NO

END
3.c. Flowchart Listing Program Konversi Satuan Massa

START

Disp(‘konversi satuan massa’);


A=input(‘masukkan beban awal(gr)=’);
i=input(‘interval=’);
M=input(‘masukkan beban akhir(gr)=’);
Disp(‘gr kg Ib ons’);

While
a<=m

YES
A=a+i;
Kg=(a/1000);
Ib=(a*0.00205);
Ons=(a/28.35);

Out=[a’ kg’ Ib’ ons’];


Disp([num2str(out)]);

NO

END
4.c. Flowchart Listing Program Volume Kontrol

START

pi=3.14;
VTA=0;

disp('volume kontrol');
d=input('diameter tangki(ft)=');
t=input('tinggi tangki(ft)=');
Q=input('debit air(ft^3/menit)=');
disp('waktu yang diperlukan untuk
mengisi hingga 95% tangki(menit)');

VT=((1/4)*pi*d*d*t);
Va=((95/100)*VT);

disp(['volume
tangki(ft^3)=',num2
str(VT)]);

for
V=VT[Link]Va

men=V/Q;

out=[men'];
disp([num2str(out)]);

END

You might also like