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

Ok so I am in a computer science class, and we are programming in C and I am hav

ID: 3790019 • Letter: O

Question

Ok so I am in a computer science class, and we are programming in C and I am having a hell of a time making this flowchart work. I know I must construct it with if, and else if statements so if I could please get some assistance making just one branch work, that would help me out tremendoulsy. I am working on the (family > parent > mom (yes/no)) branch. Could I please get assistance with this? By the way we are programming in C.

CS 100 Valentine's Gift Giving Guide who is getting the gift? family friend Which one? What type? sibling other childhood college parent Ever beat Young or Mom? Still talk Room you up? old? to them? Yes No mate? Yes Still does Calls you No old young regularly? your wash? Deserve yes sometimes no t? Dating them? You in their will? Ever date Good them? friend? No Ye No No Yes No Nothing Yes Yes Ye No A funny Valentine's Card Yes Yes Something nice (chocolate or flowers) Yet

Explanation / Answer

#include<stdio.h>
#include<conio.h>
void main()
{

   char choice,cc,cc2,dc,washchoice,callchoice,yo,will;
   clrscr();
   printf(" **** valentine's day gift*****");
   printf(" Parent... press 'p'");
   printf(" Sibling... press 's'");
   printf(" Other.... press 'o' ");
   printf(" whom do you want to give valentine gift? ");
   scanf("%c",&choice);


   switch(choice)
   {

   case 'p': printf("for mom or dad...press 'm' for mom,'d' for dad... ");
          scanf(" %c",&cc);

          if (cc=='m')
          {
           printf("Is she still does your wash? (y/n) ... ");
           scanf(" %c",&washchoice);

           if(washchoice=='y')
           {
               printf("Nice chocolate and flowers to MOM");
           }
           else if (washchoice=='n')
           {
               printf("funny valentine card to mom");
           }
           else
           {
               printf("enter valid choice");
           }
          }
          else if (cc=='d')
          {

           printf("Is your dad calls you regularly (y/n) ...");
           scanf(" %c",&callchoice);
           if(callchoice=='y')
           {
               printf("funny valentines card to dad");
           }
           else if (callchoice=='n')
           {
               printf("Nothing for dad");
           }
           else
           {
               printf("enter valid choice");
           }
          }
          else
          {
           printf("enter valid choice");
          }
          break;

   case 's': printf(" Ever your sibling beat you up?....(y/n)...");
          scanf(" %c",&cc2);

          if(cc2=='n')
          {
           printf(" funny valentine card to sibling");
          }
          else if (cc2=='y')
          {
           printf(" do you deserve for that beat? ...(y/n)..");
           scanf(" %c",&dc);
           if(dc=='y')
           {
               printf("funny valentine card to sibling");
           }
           else if (dc=='n')
           {
               printf("nothing for sibling");
           }
           else{
           printf("enter valid choice");
           }
          }
          else
          {
           printf("enter valid choice");
          }
          break;


   case 'o': printf("whether young or old...'y' for young , 'o' for old...");
          scanf(" %c",&yo);
          if(yo=='y')
          {
           printf("a funny valentine card to young");
          }
          else if (yo=='o')
          {
           printf(" You are in their will?...(y/n)...");
           scanf(" %c",&will);
           if(will=='y')
           {
               printf(" a funny valentine card to old");
           }
           else if(will=='n')
           {
               printf(" Nothing to old");
           }
           else
           {
               printf("enter valid choice");
           }
          }
          else
          {
           printf("enter valid choice ");
          }

          break;

   default:printf("enter valid choice");
   }
getch();
}

sample output

*** valentine's day gift ******
Parent.... press 'p'
sibling.... press 's'
other.... press 'o'
whom do you want to give valentine gift? p
for mom or dad... press 'm' for mom,'d' for dad...
m
is she still does your wash?(y/n)...y
Nice chocolate and flowers to MOM

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