Techkhan

In this blog we will provide info about tech,beauty,health and very other topic trending topic will also discuss

Breaking

Saturday, March 28, 2020

March 28, 2020

How to make Hangman Game using C++

#include<iostream> // Library
#include<time.h> // for time
#include <stdlib.h> // for rand, srand
using namespace std; 

void hangman(); // function prototype
int charcount(const char* x); // function prototype
void game(const char* y); // function prototype

int charcount(const char* x) // counting characters in a country's name
{
    int count = 0;
    while (*x != '\0')
    {
        x++;
        count++;
    }
    return count;
}
void game(const char* y) // This is the main game and print function where everything happens
{
    int size = charcount(y); // getting number of characters in a country's name
    char temparr[10];// creating a temporary character array of size 10
    int loopcount = 0; // loopcheck is used to check if the word that user entered matches any letter of the country name and counts it
    int wrngcount = 0; // it counts when the word user entered does not match any character

    for (int i = 0; i < size; i++) // fills the tempstr with dashes and prints it separately
    {
        temparr[i] = '_';
        cout << "_ ";
    }
    for (int loop = 0; loop < 8;)// this loop runs if user makes 8 mistakes during game
    {
        int wrngcheck = 0; // this is a check variable to check for right and wrong answers
        char guess; // this is an input character variable that user will enter 

        cout << "\nGuess any Letter of the Country's Name: ";
        cin >> guess; // taking input from user 
        for (int i = 0; i < size; i++)// this is the loop that compares the input letter with the characters of the country name
        {
            if (guess == y[i] && temparr[i] == '_') // if statment to check variable and vheck tempstr if any value is already in there
            {
                temparr[i] = guess;       // writing the tempstr character string
                loopcount++; // the loopcount counts the time this loop has run
                wrngcheck = 1;// if any letter matches the check is turned true(value set to 1) 
            }
            else;
        } // letter check loop ends here

        if (wrngcheck == 0) // 
        {
            wrngcount++; //if letter doesnt match, it increses the wrong count
            loop++;// and it also increases the loop
        }
        else;
        system("CLS"); // clearing screen
        for (int i = 0; i < size; i++)
        {
            cout << temparr[i] << " "; // printing the temporary character string with the modified values in it
        }
        if (wrngcount == 8) // hangman displaying code from here below. it shows the character based on the value of wrong choices counter 
        {
           cout << endl << endl<< endl
                << "     ('')   " << endl
                << "     _||_/  " << endl
                << "    / ||    " << endl
                << "    _/  L_  " << endl
                << "==============" << endl << endl
                << "NO MORE CHANCES! YOU ARE DEAD!" << endl;
        }
        else if (wrngcount == 7)
        {
            cout << endl << endl<< endl
                << "     ('') " << endl
                << "     _||_/" << endl
                << "    / ||  " << endl
                << "    _/    " << endl<< endl<< "==============" << endl << endl;
            cout << "\n\nWrong!! 1 Chance Left! Try Again\n";
        }
        else if (wrngcount == 6)
        {
            cout << endl << endl<< endl
                << "     ('') " << endl
                << "     _||_/" << endl
                << "    / ||  " << endl<< endl<< endl<< "==============" << endl << endl;
            cout << "\n\nWrong!! 2 Chance Left! Try Again\n";
        }
        else if (wrngcount == 5)
        {
            cout << endl << endl<< endl
                << "     ('') " << endl
                << "     _||_/" << endl
                << "    /     " << endl<< endl<< endl<< "==============" << endl << endl;
            cout << "\n\nWrong!! 3 Chance Left! Try Again\n";
        }
        else if (wrngcount == 4)
        {
            cout << endl << endl<< endl
                << "     ('')     " << endl
                << "     _||      " << endl
                << "    /         " << endl<< endl<< endl<< "==============" << endl << endl;
            cout << "\n\nWrong!! 4 Chance Left! Try Again\n";
        }
        else if (wrngcount == 3)
        {
            cout << endl << endl<< endl
                << "     ('') " << endl
                << "      ||  " << endl<< endl<< endl<< endl<< "==============" << endl << endl;
            cout << "\n\nWrong!! 5 Chance Left! Try Again\n";
        }
        else if (wrngcount == 2)
        {
            cout << endl << endl<< endl<< "     ('') " << endl<< endl<< endl<< endl<< endl<< "==============" << endl << endl;
            cout << "\n\nWrong!! 6 Chance Left! Try Again\n";
        }
        else if (wrngcount == 1)
        {
            cout << endl << endl<< endl<< "     ('   " << endl<< endl<< endl<< endl<< endl<< "==============" << endl << endl;
            cout << "\n\nWrong! 7 Chance Left! Try Again\n";
        }
        else
        {
            cout << "\n\n8 Chances Left!";
        } // hangman cartoon printing stops here
        if (loopcount == size || loop == 8) // if game correct choices reach country name's character limit or game wrong choices reach limit 8. loop will teerminate 
        {
            if (loopcount == size)// checking if user entered all correct characters before limit reached and print win messege
                cout << "\n\nYOU WIN";
            else // otherwise it will print the lost messege and shows the correct answer
            {
                cout << "\n\nYOU LOSE";
                cout << "\n\nCorrect Answer is " << y;
            }
            cout << "\n\n***GAMEOVER***"; // printing game over and breaking loop if either of the above condition is satisfied
            break;
        }
    }
    int select = 0; // declaring another variable for user choice and using it to call the game again if user wants to play again otherwise it exits the game
    cout << "\n\nDo You want to play again!(0 for no): ";
    cin >> select;
    if (select == 0)
        cout << "\n\nEXITING GAME\n\n";
    else {
        system("CLS"); // clears the screen before game restarts
        hangman();
    }
}

void hangman()
{
    const char* china = "china"; // declaring five countries as shown below
    const char* pak = "pakistan";
    const char* turk = "turkey";
    const char* india = "india";
    const char* japan = "japan";
    srand((unsigned int) time(0)); // calling random funtion to choose any number between 1 and 5
    int n = rand() % 5 + 1;

    if (n == 1) // assigning numbers to countries calling the game function by passing country names pointer to the game function
        game(pak);
    else if (n == 2)
        game(japan);
    else if (n == 3)
        game(turk);
    else if (n == 4)
        game(china);
    else if (n == 5)
        game(india);
    else;
    cout << "\n";
}

int main()
{
    cout << "***WELCOME TO HANG THE MAN GAME***\n\n"; // displaying main screen and rules
    cout << "Rules\n\n1.Use lower case letters only\n2.You have only 8 wrong choice limit\n3.One letter once used cannot be used later as you will end up using your Wrong choices\n\n";
    hangman(); // calling the main function

Friday, March 27, 2020

March 27, 2020

Cronavirus origin and its causes and treatment


In December 2019 the Chinese leadership
Warn the world that the virus has spread across their communities.

In the next few months, it spread to other countries, with patients twice a day.

This disease is the Coronavirus 2 Coronary Syndrome

resulting in Covid-19 infection and everyone simply calls coronavirus.

What happens when it spreads to humans and what should we all do?

The disease is just the body around the genetic material and some protein, in fact not a living organism.

It can only be amplified by itself by accessing the collection cell.

Corona is spread on site, but it is not yet clear how long it can last between them.Its the most likely route to infection when people cough, or if you touch a patient and then your face,say wash your eyes or nose.

The disease begins its journey here, and then breaks off a stowaway element deeper into the body

Its targets are the gastrointestinal tract, respiratory tract or lungs, where it can be most effective.

Even a few corona species can be quite dangerous.The lungs are lined with millions of epithelial cells.These are the borders of your body, lining your organs and mucosa waiting to be spread.
Corona linked a special injection to his victims' tumors by injecting his genetic code.

The cell, ignorant of what is happening, completes the new information, which is pretty simple:
copied and reused.

He wrote with more and more copies of the original virus until he reached the critical point and

received a final order to make oneself.



The cell melts away and releases new corona particles that are ready to attack more cells.
The number of infected cells is growing exponentially
After about ten days, millions of body cells become infected, and billions of viruses warm the lungs.

The virus has not done too much damage yet, but corona will now release a real animal on you,
your own immune system.The immune system, although it is there to protect you, can actually be quite dangerous for you and needs strict regulation.

While immune cells pour into the lungs to fight the virus, Corona infects some of it and creates confusion.Cells do not have ears or eyes.They mostly communicate via small information proteins called cytokines.Almost every major immune response is controlled by them.

Corona causes infected immune cells to respond too much and screams bloody murder.

In a sense, it puts the immune system in a fight and sends more soldiers away than it should, wasting its resources and causing damage.

Especially two types of cells destroyed.
First, neutrophils, which are very good at killing things, including our cells.

As they arrive in their thousands, they begin to pump out enzymes that destroy as many friends as enemies.The other important type of cells that go into a frenzy are killer T cells, which usually command infected cells to commit suicide.Confused as they are, they start ordering healthy cells to kill themselves as well.
The more and more immune cells show up, the more damage they do, and the more healthy lung tissue they kill.It can become so severe that it can cause permanent irreversible damage, leading to lifelong disabilities.
In most cases, the immune system is slowly gaining control.

It kills the infected cells, intercepts the viruses that are trying to infect new ones and clears the battlefield.

Recovery begins.

The majority of people infected with Corona will experience relatively mild symptoms.But many cases become serious or even critical.We don't know the percentage because not all cases have been identified,but it is safe to say that there is much more to it than with the flu. In more severe cases,

Millions of epithelial cells are dead and the protective covering of the lungs disappearsa slow pandemic will not be remembered by history books.The worst case scenario for a rapid pandemic starts with a very rapid rate of infection because there are no countermeasures to slow down.

Why is this so bad?

In a rapid pandemic, many people become ill at the same time.If the numbers are too large, health systems will be unable to cope.There are not enough resources, like medical staff or equipment like ventilators, to help everyone.People will die without treatment.And, as more healthcare professionals become ill, the capacity of healthcare systems drops further.

If that happens, horrible decisions will be needed about who will live and who will not live.The number of deaths increases significantly in this scenario.To avoid this, the world - it means that we all - need to do everything possible to turn this into a slow pandemic.A pandemic is delayed by the correct responses.Especially in the initial phase, so that everyone who gets sick can receive treatment and there is no point of crisis in overburdened hospitals.

Since we don't have a vaccine for Corona, we have to socially project our behavior,act as a social vaccine. This simply means two things:

1. You are not being infected; and
2. Do not infect others.

Although it seems trivial, the best thing you can do is wash your hands.Soap is really a powerful tool.
The corona virus is wrapped in what is basically a layer of fat; the soap breaks this fat and leaves you unable to infect it.

It also makes your hands slippery and, with the mechanical movements of washing, viruses are pulled out.To do this correctly, wash your hands as if you have just cut some jalapeno and want to put the contact lenses below.

The next step is social distance, which is not a pleasant experience,but a cool thing to do. That means: no hugs, no handshakes.If you can stay at home, stay at home to protect those who need to leave for society to work:from doctors to cashiers or police officers; You depend on them all; they all depend on you not to get sick.

On a higher level, there are quarantines, which can mean different things, from travel restrictions or real requests to staying at home.Quarantines are not great to experiment with and are certainly not popular.But they buy us - and especially researchers working on drugs and vaccines - crucial time
Therefore, if you are quarantined, you must understand why and respect it.None of this is fun. But looking at the big picture, it's a really small price to pay.

The question of how pandemics end depends on how they start;if they start quickly on a steep slope, they end badly.If they start slowly, with a slope not so steep, they end well.And today, it really is in all of our hands.

Friday, October 25, 2019

October 25, 2019

MENTAL HEALTH AWARENESS

                                            MENTAL HEALTH AWARENESS
           

 Life ! They say its a gift, an opportunity.  I only see it as a curse, a dark pathway with no exit gate.  I want to quit this game called life. I have the flu, not the kind you can see that makes you jump between every sneeze.  But its there and it weighs me down everyday. Hi - I am I feel drowned with tiredness.. yet I can’t sleep I struggle through the night, and wake up with no feeling or emotion,  the energy i once had already drained[Sound of the metro train] I go to work and put on my best face I work so hard just to stay in the same place hey.. good morning guys! Good morning... I hope, reports will be completed today Yes, i am planning to finish it by today 4.. hmm 4:30 You need to understand this . I cant afford time validating your report sand  i don not want to see any errors this time.If you have any doubts, clarify it right away.I will..As i have a meeting, i wont be available for next 4 hour so  okay.. okay and one more thing. I hope you are ready for the presentation today  Yes.. . Good..Are you sure it will be completed by today He scares me, my manager Actually, its not him. He is a good guy.  Its me, who is always messing up. Time just flies. Or does it? My thoughts consume me.. I cannot anything done. I cant focus...I am useless...  I feel like throwing up. I need to calm down I need to breathe.  I am .  , so, I am useless So what? I am not going to worry anymore. Everyone will mock me.. Again.. I will fail.. yet again!do you want to take a coffee break They say the more you laugh, the more you live...  is it bad that I don’t even feel alive So guys.. this is the report of your work what you have done for the last 2 months So are you happy with this report?even the management is not happy with the report We were suppose ... [fades..] I am confident.. I am brave.. I am who I want to be. Have to completed within this month...  are you with me?... Yes Okay.. I hope you are ready with the presentation... then please So I talk about the marketing mix modeling today and.. hmm.. first I will give some introduction about it and then slowly.. and.... sorry... sorry sir.. Lies ... All lies...lies I tell myself to stop the racing thoughts in my head Start... What are you all thinking?  Stop... You’re nothing. You’re worthless. You will never be who you want to be. Run away, go hide, no one will care. I freeze... I see them stare, I know they’re laughing..  but I can’t hear them. I can’t hear anything,  I can’t feel anything. Make it stop.  Great. He noticed. What do I say?  I can’t open my mouth. It hurts.  I feel it now. Something pressing against my chest.  Something screaming in my ears. It keeps getting louder and louder.  I feel powerless and I don’t know how I overdose on the good life thinking It will make me feel better.  The pleasure is temporary.  I know it’s gonna come back. It’s simply waiting for the perfect time to attack. I hurt for years.  I’ve been crying for as long as I can remember. [crying] I hate you.. I hate you..[crying] I want to die[crying] I want to die Breathing has become an effort.  I want to forget, If that means leaving, then i want to leave.  I have been coping all this time,  but I’m exhausted.  I’m a ticking time bomb,  I can feel it coming.  I am done pretending everything is okay.  Save me or Kill me. Either one is fine One may choose not to remember me  May not recall me gazing up the sky When my foot steps will not be printed on this road, I shall not be there to row my little boat across this pier 
READ MORE

Wednesday, October 23, 2019

October 23, 2019

what is global marketing

    GLOBAL MARKETING
                
 growing number of U.S. corporations ha transverse geographical boundaries and become Transvaal geographical boundary and become true.
multinational in nature. For most other dome companies, the question is no longer, Should we go int factional? Instead, the questions relate to when, how, and where companies should enter the international marketplace. The 15 years have seen the reality of a truly world market unfold in today's world, the global economy is becoming almost total integrated, versus 25 percent integrated in 1980 and 50 percent integrated in the early 90s. Primary reasons for previously sane rated, individual markets evolving to a network of interpret. dent economies include
1. The growing influence and economic development of lesser developed countries. In years to come, the real battleground for the two trade powers. the United States and Japan, will take place in the developing world. Containing 80 percent of the world's population and with growth rates nearly double those of industrial nations, these countries have emerged as the “fourth engine in the world economy” (following the United States, Japan,and Europe).
 2. The integration of world financial markets. For example, changes in currency exchange rates between the yen and the dollar greatly influence issues relating to import and export activities for all countries.
3. Increased efficient in transportation and telecommunication and data communication networks. To illustrate, consider the cases of Eastern Europe, China, and Russia. In these countries, technological advances have allowed the emergence of stock exchanges on which brokers throughout the world can trade.
 4. The opening of new markets. For example, recent political events in Vietnam have led to the opening of a market that for decades (since the Che the Vietnam War) was closed to U.S. companies.


Multinational firms invest in foreign countries for the same basic reasons they invest in their own country. These reasons vary from firm to firm but falll under the categories of achieving offense or defense goals. Offense goals recto (1) increase long-term growth and profit prospects; (2) maximize total vales revenue; (3) take advantage of economies of scale; and (4) improve era market position. As many American markets reach saturation, American firms look to foreign markets as outlets for surplus production capacity cures of new customers, increased profit margins, and improved returns investment. For example, the ability to expand the number of locations of McDonald's restaurants in the United States is becoming severely limited. Yet, on any given day, only 0.5 percent of the world's population visits McDonald's. This fact illustrates the vast potential markets still open to the company Indeed, in the recent past, of the 50 most profitable McDonald's outlets, 25 were located in Hmong Kong. For Pepsi Co, the results are similar. Its restaurant division operates 7,400 Kentucky Fried Chicken, Pizza Hut, and Taco Bell outlets abroad, deriving over $5.6 billion in sales from these foreign locations.


Multinational firms also invest in other countries to achieve defense goals. Chief among these goals are the desire to (1) compete with foreign companies on their own turf instead of in the United States; (2) have access to technological innovations that are developed in other countries; (3) take advantage of significant differences in operating costs between countries; (4) preempt competitors' global moves; and (5) not be locked out of future markets by arriving too late.
Such well-known companies as Zenith, Pillsbury, A&P, Shell Oil, CBS Records, and Firestone Tire & Rubber are now owned by non-U.S. interests. Since 1980, the share of the U.S. high-tech market held by foreign products has grown from less than 8 percent to close to 25 percent. In such diverse industries as power tools, tractors, television, and banking, U.S. companies have lost the dominant position they once held. By investing solely in domestic operations or not being willing to adapt products to foreign markets, U.S. companies are more susceptible to foreign incursions. For example, there has been a great uproar over Japan's practice of not opening up its domestic automobile market to U.S. companies. However, as of 1996, a great majority of the American cars shipped to Japan still had the steering wheel located on the left side of the vehicle--the opposite of where it should be for the Japanese market.
In many ways. marketing globally is the same as marketing at home. Regardless of which part of the world the firm sells in, the marketing program must still be built around a sound product or service that is properly priced, promoted, and distributed to a carefully analyzed target market. In other words, the marketing manager has the same controllable decision variables in both domestic and non domestic markets.
read more in this blog:
October 23, 2019

UP COMING GOOGLE PROJECTS



I didnt think we could fall in love broken from the start into our paste we had closed hearts Whats up guys? Hope you are all doing well today. We will be talking about 10 ambitious Google alphabet projects. You may not have heard about Google went through a massive Reorganization in October of 2015 when alphabet became its parent company Projects that [we arent] [a] part of Google core businesses such as Google search engines and Android were spun out into separate alphabet companies with their own C.E.Os All of these moonshot projects cover everything from making smarter homes to creating robots that can work alongside humans But even Google proper which now falls on the alphabet still has oversight over some of these futuristic projects Here are 10 most ambitious.










MOONSHOT PROJECTS:
 Moonshot projects on the alphabet and what they hope to accomplish First is delivery drones project wing is alphabets desire to replace your mailman with flying drones a Patent filed in October of 2014 gave us better insight as to how the project would work The drone will lower a package using a winch to tiny robots on the ground These robots will then wheel the packages to a safe holding location Alphabet plans and releasing the Drone delivery service to the public in 2017 Project wing is run by Google x the company under Alphabet.Next up is smart contact lenses Alphabet is pursuing smart contact lenses that are [solar-Powered] and Collect biological data about the wearer Sensors embedded in the contacts could collect information like body temperature and blood alcohol content The tech giant [also] announced in 2014 that it was receiving contact lenses that would use tiny glucose sensors to measure sugar levels in your cheers The project is run by Alphabets verify company which was originally named "Google life sciences"Next up; internet beaming, hot-air balloons project loon is Alphabets desire to bring internet to two-thirds of the worlds population using internet beaming,

 Hot-air balloons:
The project has been in the web since 2011 about two years before it was unveiled to the public The solar-Powered balloons fly at a high altitude to provide broadband to areas without internet access you[can] read the specifics about how the project works here project loon is one under Google Next on; our list cancer detecting pill the tech giant is designing tiny magnet particles that can look into signs of cancer and other diseases in the human body [the][project] however is at least another four years away from being ready for the [final] time the project is being run by Google X research lab Next on; our list is internet beaming drones Alphabet has two approaches to beaming the [internet] around the world Hot air balloons and drones the tech giant bought titan aerospace which makes the solar-Powered drones that are built to fly non-stop for years the Titan aerospace, So lara 50 has a wingspan of150 feet and is equipped with[3,000] solar cells which can provide seven kilowatts of electricity to stay airborne for five years?They can also take aerial photography the drone project is run as a part of [project] titan under Google Next up; robots Google turn Alphabet acquired a ton of robotic companies in 2013One that stands out is Boston Dynamics Boston Dynamics creates a number of robots Inspired by animals to aid in military use the one pictured here is called the cheetah robot the fast legged robot in the world.The cheetah Robot can get to a speed of 29 miles per hour crushing a 13.1 mile per hour speed record set by MIT in1989 you can see a list of.
 its robotic projects:
 here all robot projects are run as a part of replicant which is controlled by Google Next on our list is longer lasting batteries Creating longer-lasting batteries may not seem like an ambitious project, but its actually a pretty difficult one There is a lot of demand [for] batteries that last longer when it comes to creating popular consumer items like smart phones. The [Alphabet] CEO larry page told analysts in 2013 that battery life and mobile devices is a huge issue with real potential to invent new and better experiences a small group of just four members is currently working on that issue under Google Next up a giant genomic [storing] services Google will store your genome in the cloud for $25 and the storage system could have a major impact on the scientific community the hope is to collect millions of genomes to aid in scientific research as MIT review reports of the system could aid in Collecting cancer Genome clouds that would allow scientists to Share information and one virtual experiments the project is run Under Google X[next] up [goods] project to cure death the tech giant has taken on the ambitious project of extending the average Life span.The research being done has been kept fairly hush But we know researchers are looking at things like genes that correlate to longer Lifespans in certain people.The project is run by Calico a company under Alphabet that stands for California Life Company and Next on our list is artificial intelligence Deep mind. Which is the Company AI research firm falls under Google as a traditional product Google has made massive strides with refining its AI in January Google [AI] beats a human at a complex game of go for the very first time Google AI was also capable of learning to play and win Atari 2600 games without any prior instruction in 2015More recently a company AI system was able [to] successfully navigate a maze on a computer game. The same way [a] human would So, thats it for this video guys I hope you found this video useful we will be coming up [with] more interesting Topics like these so stay tuned and until next time have a great day.
READ MORE


Friday, October 4, 2019

October 04, 2019

How to control remotely one computer from another?


How to control remotely one computer from another?


We will discuss a simple and useful tricks for every person that "How to remotely control one computer from another " after reading this article you will be able to use one computer from another and can use all the features and functions of other computer which you want to access. This trick is quiet helpful for those peoples who are Freelancer because in Freelancing sometimes you need to connect two computers or Laptop with each others and solve the problems and earn money from them.
So Let's Start

Requirements:
(1) Both the Computers must be connected to the internet.
(2) Team viewer must be install in both computers or laptops.
(3) You must use this trick legally.
Download Team viewer:
Team Viewer
Click the link given below.

You can also download this software online from google by type “Download Team viewer” on search bar and click the team viewer website.

Procedure:

(1) First of all install and launch team viewer.
(2) Then asked the password and I’d from other Computer person’s which you want to control.

(3) Type the I’d as shown.

(4) Then it ask the password as shown.
(5) Type the password in the dialog box and press enter.
(6) Now it shows the desktop of the other Computer or laptop and you can easily use it.
(7) Even you can Play games in other computer.

Advantages:

(1) Using this trick you can work online as a Freelancer and earn some extra money at home.
(2) You can remotely control other computer without touching it.
(3) It is simple and reliable way of working more than one computer or laptop at a time.

Disadvantage:

(1Your data are at risk.
(2) The person who is working on your computer can steal your data.
Also check this