Solved

C program & flowchart

Posted on 2003-10-26
10
341 Views
Last Modified: 2010-04-15
I am very  new to C programming and I'm working with an ancient brain So if anyone can help
Program Example
/*  Case Program */
#include <stdio.h>
main(void)
{
char menu;
printf("input menu letter? \n");
scanf(" %c", &menu);
menu = toupper(menu);
/* case */
switch (menu)
{
case 'A': printf("You have selected A \n");
break;
case 'B': printf("You have selected B \n");
break;
case 'C': printf("You have selected C \n");
break;
default: Printf("Invalid selection \n");
}

/* end case */
return 0;
}
I'm supposed to contrust a flow chart from this an so far I have Start
Output
Message

Input
Data

Output
Information

Case
Output
Information 1
Output
Information2
output
Information 3
Stopany suggestions for improvement
0
Comment
Question by:Serena2345
10 Comments
 
LVL 9

Expert Comment

by:tinchos
Comment Utility
Sorry

I didn't understand what you are trying to do.
Can you explain a little more?
0
 

Author Comment

by:Serena2345
Comment Utility
I am trying to make the program flowchart fit the program.
0
 
LVL 5

Accepted Solution

by:
snehanshu earned 50 total points
Comment Utility
Serena2345,
Not sure what exactly you want, but perhaps you could add "process data" for the statement menu = toupper(menu);

Here's my attempt to make a text-o-graph :)
(Note: It looks better if pasted in notepad!)


                      _____
                     (START)
                      -----
                        |
            _____________________________
           /      Output Message        /
          /____________________________/      
                        |
            _____________________________
           /    Input Data             /
          /____________________________/      
                        |
           ______________________________
           |      Process Data          |
           |____________________________|      
                        |
                        |
                        |
                       / \
               = C    /   \        = A
              _______/case \______________________________
              |      \Data /                             |
              |       \   /                              |
              |        \ /    = B                        |
              |         |_________                       |
              |                  |                       |
              |                  |                       |
              |                  |                       |
              |                  |                       |
              |                  |                       |
              |                  |                       |
              |                  |                       |
              |                  |                       |
  ________________      ________________    ________________
 / Output Message/     / Output Message/   / Output Message/
/_______________/     /_______________/   /_______________/
              |                |                         |
              |________________|                         |
              |                                          |
              |__________________________________________|
              |
              |
              |
       _______________
      (    STOP       )
       ---------------

Hope that helps.
Cheers!
...Shu
0
 
LVL 5

Expert Comment

by:snehanshu
Comment Utility
Hi!
  Haven't heard from Sarena since I posted. Don't know whether it actually helped.
Cheers!
...Shu
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
No comment has been added lately and this question is therefore classified abandoned.

If asker wishes to close the question, then refer to
http://www.experts-exchange.com/help/closing.jsp

Otherwise, I will leave a recommendation in the Cleanup topic area that this question is:
PAQed with A grade to snehanshu

Please leave any comments here within the next seven days. It is assumed that any participant not responding to this request is no longer interested in its final disposition.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Sunny
EE Cleanup Volunteer
0
 
LVL 5

Expert Comment

by:snehanshu
Comment Utility
Thank you sunny for the recommendation! I shall steal your cleanup post format for my posts in the Delphi TA. Hope you don't mind.
:-)
...Snehanshu
0
 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
Be my guest and welcome to the club .. return to help C programming TA with cleanup someday :o)
0
 
LVL 5

Expert Comment

by:snehanshu
Comment Utility
Thank you Sunny.
>>return to help C programming TA with cleanup someday
I'll try to :-)
...Shu
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now