Google Answers Logo
View Question
 
Q: C++ Assignment ( No Answer,   0 Comments )
Question  
Subject: C++ Assignment
Category: Computers > Programming
Asked by: willstein-ga
List Price: $5.50
Posted: 07 Dec 2003 12:46 PST
Expires: 07 Dec 2003 13:32 PST
Question ID: 284478
Please convert the following design into a C++ Program


-----What's Needed:-----
1.) The design in Pseudocode or Flowchart
2.) The source code in C++ (nice header would be good)
3.) The output, appended to the source code
4.) After every pass (before incrememnting passid) print elements of the array. 
(cout << val [0] << '' << val [1] << '' << val [2] << ... << '' << val [7] << endl;




---Design---

Assume that the following Array Values exist in memory:

val (1) 44
val (2) 80
val (3) 53
val (4) 47
val (5) 4
val (6) 9
val (7) 36
val (8) 46

numel = 8
maxpasses = numel - 1
passid = 1

WHILE (passid <= maxpasses) DO
	
	numchecks = numel - passid
	j = 1

	WHILE (j <= numchecks) DO
	
		IF (val (j) > val (j + 1) THEN
			temp = val (j)
			val (j) = val (j + 1)
			val (j + 1) = temp
		ENDIF
	
		j = j + 1

	ENDWHILE

	passid = passid + 1

ENDWHILE

Clarification of Question by willstein-ga on 07 Dec 2003 13:13 PST
**NEEDED TONIGHT
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy