Showing posts with label EasyToMake. Show all posts
Showing posts with label EasyToMake. Show all posts

Monday, January 25, 2021

How to Create a Calculator in C++🤔🤔 | Explained in English | Less than 100 Lines Code

Macstock

In this Post, I have Managed to Show you how you Can Easily Create Calculator in C++. It is very Simple and Easy to Create Program.

For Better Understanding You Should Watch the Full Video [Explained In Hindi Language] By Clicking the Video Button Given Below


Source Code Here :-


#include <iostream>
#include <stdio.h>
using namespace std;

int main(){
    int inp_number;
    int while_runner = 0;
    int add_first;
    int add_second;
    int sub_first;
    int sub_second;
    int multi_first;
    int multi_second;
    int div_first;
    int div_second;
    cout<<"Welcome to Calculator. Press Enter to Continue"<<endl;
    getchar();
    while (while_runner==0)
    {       
        cout<<"Use any of the Below Functions."<<endl;
        cout<<"Press 1 For Addition"<<endl;
        cout<<"Press 2 For Substraction"<<endl;
        cout<<"Press 3 For Multiplication"<<endl;
        cout<<"Press 4 For Division"<<endl;
        cin>>inp_number;
        if (inp_number==1)
        {
            cout<<"Enter the first Number to Add:- "<<endl;
            cin>>add_first;
            cout<<"Enter the Second Number to Add:- "<<endl;
            cin>>add_second;
            try
            {
                cout<<add_first+add_second<<endl;
            }
            catch(const std::exception& e)
            {
                cout<<"Enter a Valid Number"<<endl;
                break;
            }
            
        }
        else if (inp_number==2)
        {
            cout<<"Enter the first Number to Substract:- "<<endl;
            cin>>sub_first;
            cout<<"Enter the Second Number to Substract:- "<<endl;
            cin>>sub_second;
            try
            {
                cout<<sub_first-sub_second<<endl;
            }
            catch(const std::exception& e)
            {
                cout<<"Enter a Valid Number"<<endl;
                break;
            }
             
        }
        
        else if (inp_number==3)
        {
            cout<<"Enter the first Number to Multiply:- "<<endl;
            cin>>multi_first;
            cout<<"Enter the Second Number to Multiply:- "<<endl;
            cin>>multi_second;
            try
            {
                cout<<multi_first*multi_second<<endl;
            }
            catch(const std::exception& e)
            {
                cout<<"Enter a Valid Number"<<endl;
                break;
            }
            
            
        }

        else if(inp_number==4)
        {
            cout<<"Enter the first Number to Divide:- "<<endl;
            cin>>div_first;
            cout<<"Enter the Second Number to Divide:- "<<endl;
            cin>>div_second;
            try
            {
                cout<<div_first/div_second<<endl;
            }
            catch(const std::exception& e)
            {
                cout<<"Enter a Valid Number"<<endl;
                break;
            }
        
        }
        else {
            cout<<"Enter a Valid Option";
            break;
        }
        
    }

}
    

Hope you Will Like It😊

Monday, August 10, 2020

Fantastic and Cool Websites [Source Code] - CSS FILE

Macstock

Fantastic and Cool Website Source Code - CSS File



If You did not Copy the Html File Yet Then Here Is the Link to Html File : HTML FILE


*{margin: 0; padding: 20;}
.logo{
    width: 20%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.logo img{
    width: 44%;
    border: 5px solid white;
    border-radius: 50px;
}
.navbar{
    display: flex;
    position: sticky;
    top: 0;
    cursor: auto;
    
}
.nav-list{
    width: 70%;
    background-color:gray;
    display: flex;
    justify-content: center;
    align-items: center;
}
.nav-list li{
    list-style: none;
    padding: 23px;

}
.nav-list li a{
    text-decoration: none;
    color: white;

}
.nav-list li a:hover{
    text-decoration: none;
    color:pink;

}
.rightNav{
    background-color: gray;
    width: 30%;
    text-align: right;
    padding-right: 60px;
    padding-top: 23px;
}
#search{
    font-size: 16px;
    border: 3px solid Yellow;
    border-radius: 12px;
    text-align: left;
}
.background{
    background: grey url(river.jpg);
    height: 100vh;
}
.firstSection{
    height: 100vh;
}
.box-main{
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    max-width: 50%;
    margin: auto;
    height: 80%;
    font-size: x-large;
}

.first-half{
width: 80%;
display: flex;
flex-direction: column;
justify-content: center;

}
.second-half{
   
    width: 30%;
}
.second-half img{
    
    
    border: 5px solid lightblue;
    border-radius: 200px;
    display: block;
    margin: auto;
}
.text-big{
    padding-right: 50px;
    font-size: xx-large;
    color: blue;
    text-align: center;
    border: 2px solid rgba(165, 209, 164, 0.486);
    border-radius: 23px;
    background-color: black;
}

.btn{
    padding: 8px 20px;
    margin: 7PX 0;
    border: 3px solid gray;
    border-radius: 21px;
    font-size: large;
    color: white;
    background-color: red;
    cursor: pointer;
    margin-bottom: 10px;

}
.bal{
    padding: 8px 20px;
    margin: 7PX 0;
    border: 3px solid gray;
    border-radius: 21px;
    font-size: large;
    color: white;
    background-color: red;
    cursor: pointer;
}
.bal:hover{
    color: grey;
    background-color: white;
}
.btn-sm{
    padding: 6px 10px;
    vertical-align: middle;
}
.secRight{
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    margin-right: 180px;
    margin-left: 180px;
     flex-direction: row-reverse;
     background-color: white;
    }
    
.paras{
    padding: 0px 65px;
}
.sect{
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    margin-left: 180px;
    margin-right: 180px;
}

 .bkk{
     padding: 8px 20px;
     font-weight: bold;
     border: 4px solid brown;
     background-color: orange;
     color: aqua;
     border-radius: 50px;
     cursor: pointer;
     margin-right: 100px;
     font-family: 'Ubuntu',  sans-serif;
 
 }
 .bkk:hover{
     color: black;
     background-color: pink;
 }

 .imgt{
     width: 250px;
     border: 3px solid red;
     border-radius: 23px;
     margin-right: 50px;
 }
 .burgem{
     display: none;
    position: absolute;
    cursor: pointer;
    left: 5%;
    top: 15px;
 }
 .line{
     width: 33px;
     background: white;
     height: 4px;
     margin: 3px 3px;
 }
 .footer{
     background-color: grey;
     color: white;
     height: 20px;
     position: relative;
     border: 5px solid pink;
     border-radius: 25px;
 }
 .footer .footer-bottom{
    background-color: grey;
    color: white;
    height: 50px;
    text-align: center;
    position: absolute;
    bottom: 2px;
    left: 0px;
    padding-top: 20px;
    width: 100%;
 }
 .imgFluid{
     border: 3px solid yellow;
     border-radius: 23px;
     margin-left: 30px;
 }
 .sect{
     background-color: rgb(255, 255, 255);
 }
 .nav-list .homing{
     color: aqua;
 }
 .sep{
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    margin-right: 400px;
    margin-left: 400px;
 }
 .imgp{
     margin: 62px;
     border: 3px solid yellow;
     border-radius: 32px;
     width: 300px;
     height: 300px;
 }
 .puop{
    padding: 15px 33px;
    font-weight: bold;
    border: 4px solid white;
    background-color: grey;
    color: lightsalmon;
    border-radius: 50px;
    cursor: pointer;
    margin-right: 100px;
    margin-left: 377px;
    margin-top: 45px;
    font-family: 'Ubuntu',  sans-serif;
 }
 .puop:hover{
     color: white;
     background-color: black;
 }
 .rfg{
     font-family: 'Ubuntu',  sans-serif;
 }
 .homing{
    font-family: 'Ubuntu',  sans-serif;
 }
 
 @media only screen and (max-width: 1140px){
     .nav-list{
         flex-direction: column;
     }
     .navbar{
         flex-direction: column;
         position: absolute;
     }
     #search{
         width: 100%;
     }
     .rightNav{
         text-align: center;
         margin-left: 200px;
         padding-left: 45px;
         
     }
     .burgem{
        display: block;
    }
    .footer{
        margin-top: 254px;
    }
    .hui-vpn{
        height: 72px;
    }
    .vpn{
        opacity: 0;
    }

 }

.sectionSubTag{
    font-family: 'Ubuntu',  sans-serif;
}
.oin{
     font-weight: bold;
}    
    

Fantastic and Cool Website [Source Code] - HTML FILE

Macstock

How this Website Actually Looks :




Wanna Get This Cool Website, Here Is The Code :-



<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>MacStock Official - Right Place for Gaming and Technology Related VIdeos</title>
</head>

<body>
    <nav class="navbar">
        <ul class="nav-list">
            <div class="logo"><img src="logo.jpeg" alt="logo"></div>
            <li><a href="index.html" target="_blank" class="homing">Home</a></li>
            <li><a href="https://www.youtube.com/channel/UCIXud9Ot8pfDQizzdmQ-FyQ" target="_blank">Subscribe For
                    Free</a7gt;</li>
            <li>7lt;a href="#home" target="_blank">Contact Us</a></li>
            <li><a href="Games.html" target="_blank">Games</a></li>>
            <li><a href="#home" target="_blank">Source Codes</a></li>
        </ul>
        <div class="rightNav">
            <input type="text" name="search" id="search">
            <button class="btn btn-sm">Search</button>
        </div>
    </nav>

    <section class="background firstSection">
        <div class="box-main">
            <div class="first-half">
                <p class="text-big">MacStock Tech & Gaming</p>
                <p class="text-small">This is the First YouTube channel I have ever created. I upload Tech and Gaming
                    Related Videos on this channel. If you are tech or game lover and hadn't Subscribed my channel Yet,
                    then Go now and Subscribe My Channel By Clicking on SUBSCRIBE </p>

                <div class="buttons">
                    <a href="https://www.youtube.com/channel/UCIXud9Ot8pfDQizzdmQ-FyQ" target="_blank"> <button
                            class="btn">Subscribe</button> </a>
                    <a href="https://www.youtube.com/channel/UCIXud9Ot8pfDQizzdmQ-FyQ/videos" target="_blank"> <button
                            class="btn">Watch Videos</button> </a>
                </div>
            </div>
            <div class="second-half">
                <img src="MacStock.png" height="200" width="200" alt="YouTube Logo"></div>



        </div>

    </section>
    <section class="secRight">
        <div class="paras">
            <p class="sectionTag text-big">The End of your Search Is here</p>
            <p class="sectionSubTag">If you are searching for a website which Provides Free Games download link and
                Provides Source Code of Websites for Free. Note : Every Single thing in our website is free and You not
                have to pay money for Anything, So if you are a Student, then It will be a great Advantage for You coz
                now a days Every single thing requires money, whether it is a game, movie or any other downloadable
                files, which is free is not cool, But in this website I give you gaurantee that Every single thing is
                cool and Free to Downlaod, So don't forget to add this website into your Bookmark and Visit this website
                in every week one time, coz I will keep updating my content per week</p>
        </div>
        <div class="thumbnail">
            <img src="free.png" alt="" class="imgFluid">
        </div>
    </section>
    <hr>
    <section class="sect">
        <div class="paras">
            <p class="sectionTag text-big">Follow us on Blogger</p>
            <p class="sectionSubTag">Do not Forget to Follow us on Blogger, coz we upload many types of source codes and
                other important files related to HTML, CSS, JavaScript, and other Programming languages. If you will not
                follow Us on Blogger, you will lose many Important information related to Programmming Languages, You
                will also get this Website Source Code on My Blogger Page,So if you want to make a Website like THIS
                then follow my Blogger Page Now, if you will not follow you will miss many amzing contents, If you want
                to Follow, then click the FOLLOW button and Follow the Steps given there.</p>
        </div>
        <a href="howtofollow.html" target="_blank">
            <button class="bkk"> Follow </button>
        </a>
        <div class="thumbnail">
            <img src="blog2.jpg" alt="Blogger Image" class="imgt">
        </div>
    </section>
    <div class="footer">
        <div class="footer-bottom">
            © Copyright 2020 | MacStockOfficial.com | Designed By Kunal Gupta
        </div>
    </div>
</body>

</html>