Advertisement

04.10.2007 at 04:58AM PDT, ID: 22501489
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.8

Simplify C++ statement block (flowchart output)

Asked by ali_fakoor in Microsoft Visual C++.Net, Development Software, Algorithms

Tags: , ,

I WANT TO BEAUTIFY MY CODE AND AVOID COMPLEXITY AND NESTED STATEMENTS AS MUCH AS POSSIBLE.

I have a flowchart and converted it to code the way below. Now it seems that it is not in a friendly and readable format. It has some nested statements that are less easy to follow.

Can anyone suggest a way to simplify it to a most readable format. Also it is much appreciated if anyone could provide a GENERAL GUIDELINE FOR SIMPLIFYING C++ CODE and keeping it readable (specially when CONVERTING FROM A PRE-DESIGNED FLOWCHART which may lead to deep nested structures if directly implemented)

Many Thanks in Advance,

Here is the sample code (compilable):
---------------------------------
void block1(){
}

void block2(){
}

void flowchart(){
      bool changed = true;
      bool dbChange = true;
      int changeType = 4;
      bool deviceChange = true;
      bool override = true;
      bool active = true;

      if (changed){
            if (changeType==1/*s*/){
            }else if (changeType==2/*d*/){
                  if (override/*h2d*/){
                  }else{
                        block1();
                  }
            }else{
                  if (active){
                        block1();
                  }else{
                        block2();
                  }
            }
      }else{
                  if (active){
                        block1();
                  }else{
                        block2();
                  }
      }

}
---------------------------------Start Free Trial
 
Loading Advertisement...
 
[+][-]04.10.2007 at 05:27AM PDT, ID: 18881725

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C++.Net, Development Software, Algorithms
Tags: blocks, nested, simplify
Sign Up Now!
Solution Provided By: Infinity08
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.10.2007 at 09:21AM PDT, ID: 18883494

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.10.2007 at 10:46AM PDT, ID: 18884092

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.10.2007 at 11:51PM PDT, ID: 18887797

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.11.2007 at 01:04AM PDT, ID: 18888019

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.11.2007 at 02:48AM PDT, ID: 18888340

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.11.2007 at 02:58AM PDT, ID: 18888387

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.11.2007 at 04:25AM PDT, ID: 18888688

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.11.2007 at 04:35AM PDT, ID: 18888723

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.11.2007 at 04:42AM PDT, ID: 18888751

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.11.2007 at 04:53AM PDT, ID: 18888809

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.11.2007 at 06:45AM PDT, ID: 18889513

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32