Giter Club home page Giter Club logo

belajar_program's People

belajar_program's Issues

Belajar Fuzzy.c

#include <iostream.h>
#include<iomanip.h>
#include <stdlib.h>
#include<string.h>
#include<stdio.h>
#include<conio.h>

float x;
float n_panas, n_normal, n_sedang, n_dingin, n_sgtdgn ;

float panas()
{
n_panas=0;

if( x >= 40)
n_panas=0;

else if ( x > 30 && x < 40)
n_panas=(40-x)/(40-30);

else if ( x >= 10 && x <=30)
n_panas=1;

return n_panas;

}

float normal()
{
n_normal=0;

if( x < 30 || x > 50)
n_normal=0;

else if (x >= 30 && x <= 40)

n_normal=(x-30)/(40-30);

else if (x > 40 && x <= 50)
n_normal=(50-x)/(50-40);

return n_normal;

}

float sedang()
{
n_sedang=0;

if(x < 40 || x > 100)
n_sedang=0;

else if (x >= 40 && x <=50)
n_sedang=(x-40)/(50-40);

else if (x > 50 && x <=100)
n_sedang=(100-x)/(100-50);

return n_sedang;

}

float dingin()
{
n_dingin=0;

if(x < 50 || x > 110)
n_dingin=0;

else if (x >= 50 && x <= 100)
n_dingin=(x-50)/(100-50);

else if (x > 100 && x <= 110)
n_dingin=(110-x)/(110-100);

return n_dingin;

}

float sgtdgn()
{
n_sgtdgn=0;

if( x < 110)
n_sgtdgn=0;

else if (x >= 110)
n_sgtdgn=1;

else if ( x >= 100 && x <= 110 )
n_sgtdgn=(x-100)/(110-100);

return n_sgtdgn;

}

main() {
float total;
clrscr();

cout<<" Logika Fuzzy Menentukan Suhu "<<endl<<endl;
cout<<" Siti Mulia Sari J1F115017 "<<endl<<endl<<endl;

cout<< "Suhu (Celcius) = ";
cin>> x;

cout<<endl<<endl;
cout<<"======================="<<endl;
//cout<<"Hasil : "<<endl;

cout << "M. Panas ["<< x <<"] = "<<panas()<<endl;
cout << "M. Normal ["<< x <<"] = "<<normal()<<endl;
cout << "M. Sedang ["<< x <<"] = "<<sedang()<<endl;
cout << "M. Dingin ["<< x <<"] = "<<dingin()<<endl;
cout << "M. Sangat Dingin ["<< x <<"] = "<<sgtdgn()<<endl;

cout <<"------------------------------------------------+"<<endl;
total =
panas()+normal()+sedang()+dingin()+ sgtdgn();

cout<<" Hasil : "<<total;
getch();
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.