Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

So I need this written in C not C++, but please take your time, I\'ve had an awf

ID: 3887161 • Letter: S

Question

So I need this written in C not C++, but please take your time, I've had an awful lot going on and I just need help getting a good grasp on this.

Project Overview: Part of your adjustment to college is determining how much time you need to spend talking with your family and keeping in touch. Deciding when and how much to communicate with your family can be a difficult decision, so you are going to write a program to simplify your life. This program asks a few basic questions and then tells you the most appropriate action to take on the next page guides the decision process. Your program will implement this flowchart. Specifically, The flowchart it will prompt the user for several inputs. It then tells the user what to do. Two sample executions of the program are shown below, with the program prompts in blue and the user responses in red Who are you thinking about? parents Mom? yes Are things bothering you? yes Who are you thinking about? sibling Younger or older? younger How do they view you? hero Do you have a test tomorrow? yes Call them (and be prepared to spend at least 10 minutes on the phone) Send a quick text about your day You can assume the user will always enter legal input. Every input will be one of the lowercase words shown below, and each input will be one of the expected answers to the respective question. yes no parents sib 1ng other younger der hero useless The exact wording of the prompts (questions) is up to you. You can customize them as you want as long as you maintain the existing flowchart functionality. What You Need To Do Create a directory project2 on your machine. In that directory, create a file named talk. c In talk.c, write the code needed to implement the "keep in touch" flowchart. Make sure that you: · * Include a header block of comments with your name and a brief overview of the program Prompt the user for input and make a recommendation based on that input. Print the expected output in a clear, legible format, such as o o o Do nothing (let them call you) " Send a quick text about your day Call them (and be prepared to spend at least 10 minutes on the phone You may assume that all input is lowercase and legal and answers the specific question that was asked There are fifteen possible paths through this flowchart. You can see where each of the paths should lead Make sure that your program works for all possible paths through the flowchart. When you are ready to submit your project, bundle your project2 directory into a single (compressed) zip file. See the Basics document on Blackboard if vou do not remember how to do this. Once you have a compressed zip file that contains your project2 code, submit that file to Blackboard. * * *

Explanation / Answer

//Name:
//description:
#include<stdio.h>
//method to check whether entered string is parent or not
int match_parent(char b[])
{
   char a[]= "parents";
   int i=0;
   while(b[i]!=0)i++;
   if(i==7)//matching to parent length
   {
       i=0;
       while(b[i]!='')
       {
           if(a[i]==b[i])
           i++;//matching every char
           else //if not match
           return 0;  
       }
       //if every char is matched
       return 1;
   }
   return 0;//if length not matched
  
}
//method to check whether entered string is sibling or not

int match_sibling(char b[])
{
   char a[]= "sibling";
   int i=0;
   while(b[i]!=0)i++;
   if(i==7)//matching to sibling length
   {
       i=0;
       while(b[i]!='')
       {
           if(a[i]==b[i])
           i++;//matching every char
           else //if not match
           return 0;  
       }
       //if every char is matched
       return 1;
   }
   return 0;//if length not matched
  
}
//method to check whether entered string is odler or not

int match_older(char b[])
{
   char a[]= "older";
   int i=0;
   while(b[i]!=0)i++;
   if(i==5)//matching to older length
   {
       i=0;
       while(b[i]!='')
       {
           if(a[i]==b[i])
           i++;//matching every char
           else //if not match
           return 0;  
       }
       //if every char is matched
       return 1;
   }
   return 0;//if length not matched
  
}
//method to check whether entered string is hero or not
int match_hero(char b[])
{
   char a[]= "hero";
   int i=0;
   while(b[i]!=0)i++;
   if(i==4)//matching to hero length
   {
       i=0;
       while(b[i]!='')
       {
           if(a[i]==b[i])
           i++;//matching every char
           else //if not match
           return 0;  
       }
       //if every char is matched
       return 1;
   }
   return 0;//if length not matched
  
}


//method to check whether entered string is yes or not
int match_yes(char b[])
{
   char a[]= "yes";
   int i=0;
   while(b[i]!=0)i++;
   if(i==3)//matching to hero length
   {
       i=0;
       while(b[i]!='')
       {
           if(a[i]==b[i])
           i++;//matching every char
           else //if not match
           return 0;  
       }
       //if every char is matched
       return 1;
   }
   return 0;//if length not matched
  
}


int main()
{
  
   char buffer[10];
   printf("Who are you thinking about ?");
   scanf("%s",buffer);   //reading input..
  
   if(match_parent(buffer)==1)//if parent entered
   {
       char c[10];
      
       printf("MOm ?");
       scanf("%s",c);   //reading input..
       if(match_yes(c)==1)//if yes entered
       {
           char c1[10];
      
           printf("Are things bothering you?");
           scanf("%s",c1);   //reading input..
           if(match_yes(c1)==1)//if yes entered
           {
           printf("Call them (and be prepared to spend at least 10 minutes on the phone) ");  
           }
           else
           {
           printf("Send a quick text about your day ");  
           }
          
       }
       else//if no entered
       {
           char c1[10];
      
           printf("Talked recenty?");
           scanf("%s",c1);   //reading input..
           if(match_yes(c1)==1)//if yes entered
           {
           printf("Do nothing(let them cal you) ");  
           }
           else
           {
           printf("Send a quick text about your day ");  
           }
          
              
       }
      
   }
   else if(match_sibling(buffer)==1)//if sibling entered
   {
      
       char c1[10];
      
           printf("youger or older?");
           scanf("%s",c1);   //reading input..
           if(match_older(c1)==1)//if older entered
           {
               char c1[10];
      
               printf("where they always there for you?");
               scanf("%s",c1);   //reading input..
               if(match_yes(c1)==1)//if yes entered
               {
               printf("Call them (and be prepared to spend at least 10 minutes on the phone) ");  
               }
               else
               {
              
               char c1[10];
      
                   printf("Was it due to the way you acted?");
                   scanf("%s",c1);   //reading input..
                   if(match_yes(c1)==1)//if yes entered
                   {
                   printf("Send a quick text message ");  
                   }
                   else
                   {
                   printf("Do nothing(let them call you) ");  
                   }
              
              
              
                  
               }  
              
              
              
          
           }
           else
           {
               char c1[10];
      
               printf("How do the view you?");
               scanf("%s",c1);   //reading input..
               if(match_hero(c1)==1)//if hero entered
               {
                   char c1[10];
      
                   printf("Do you have a test tomorrow?");
                   scanf("%s",c1);   //reading input..
                   if(match_yes(c1)==1)//if yes entered
                   {
                       printf("Send a quick text about your day ");
                   }
                   else
                   {
                   ;
                   printf("Call them (and be prepared to spend at least 10 minutes on the phone) ");  
                      
                   }
                  
                  
               }
               else
               {
               printf("Do nothing(let them cal you) ");  
               }
              
              
              
              
          
           }
      
   }
   else//if other entered
   {
      
           char c1[10];
      
           printf("Is it one of you grand parents?");
           scanf("%s",c1);   //reading input..
           if(match_yes(c1)==1)//if yes entered
           {
              
               char c1[10];
      
                   printf("Do they like you?");
                   scanf("%s",c1);   //reading input..
                   if(match_yes(c1)==1)//if yes entered
                   {
                       char c1[10];
                      
                           printf("But do they like everyone?");
                           scanf("%s",c1);   //reading input..
                           if(match_yes(c1)==1)//if yes entered
                           {
                               printf("Send a quick text about your day ");
                           }
                           else
                           {
                               printf("Call them (and be prepared to spend at least 10 minutes on the phone) ");  
                          
                           }
                      
                      
                      
                      
                   }
                   else
                   {
                   printf("Do nothing (let them call you) ");  
                   }
              
              
           }
           else
           {
              
               char c1[10];
      
                   printf("You in their will?");
                   scanf("%s",c1);   //reading input..
                   if(match_yes(c1)==1)//if yes entered
                   {
                   printf("Call them (and be prepared to spend at least 10 minutes on the phone) ");  
                   }
                   else
                   {
                   printf("Do nothing (let them call you) ");  
                   }
              
              
              
              
              
           }
      
      
      
      
   }
  
   return 0;
}


//output:
/*
Who are you thinking about ?parents
MOm ?yes
Are things bothering you?yes
Call them (and be prepared to spend at least 10 minutes on the phone)


Process exited normally.
Press any key to continue . . .

Who are you thinking about ?sibling
youger or older?younger
How do the view you?hero
Do you have a test tomorrow?yes
Send a quick text about your day


Process exited normally.
Press any key to continue . . .

*/  

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote