Go Back   Cyber Tech Help Support Forums > Software > Web Development & Graphic Design

Notices

Reply
 
Topic Tools
  #1  
Old September 15th, 2007, 03:55 PM
philmetz's Avatar
philmetz philmetz is offline
Senior Member
 
Join Date: Jan 2006
O/S: Windows Vista
Posts: 685
Post C Pseudocode

Hi, below i created some Pseudocode for a program i am writing in C. Could some please have a look at it and provide feedback whether the loop will work? Thanks

Code:
CHARACTER name [1..20]
INTEGER iso  0
CHARACTER aperture  0
CHARACTER menuNo  0
FLOAT exposureTime  0

Output ‘Exposure Time Calculator’

Repeat
	Output ‘MENU............................................’
	Input  menuNo

	If menuNo = 1 then
		Output ‘Please enter your name’, name
		Input name
	Else if menuNo =2 then
		Output ‘Please enter the ISO number’, iso
		Input iso
If iso != 6 || iso != 8 || iso != 10 || iso != 12 || iso != 16 || iso != 20 || iso != 25 || iso != 32 || iso != 40 || iso != 50 || iso != 64 || iso != 80 || iso != 100 || iso != 125 || iso != 160 || iso != 200 || iso != 250 || iso != 320 || iso != 400 || iso != 500 || iso != 640 || iso != 800 || iso != 1000 || iso != 1250 || iso !=1600 || iso != 2000 || iso != 2500 || iso != 3200 || iso != 4000 || iso != 5000 || iso != 6400 the
	Output ‘Error in ISO value’
	Iso  0
		
	Else if menuNo = 3 then
		Output ‘Please enter your aperture value’, aperture
		Input aperture
If aperture != f1.2 || aperture != f1.4 || aperture != f1.8 || aperture != f2 || aperture != f2.8 || aperture != f4 || aperture != f5.6 || aperture != f8 || aperture != f11 || aperture != f16 || aperture != f22 || aperture != f1.432 then
	Output ‘Error in aperture value’
	Aperture  0	
	
	Else if menuNo = ? then
		Output ‘welcome to the help menu’
	Else if menuNo = Q then
		Program ends
	Endif
Until iso != 0 and aperture != 0
So basically i want to be able to input in menu number at any time and once it has a value for iso and aperture it ends.
__________________
"As much as we have progressed in science, we are still finite creatures with limited conceptual abilities and imperfect observational tools" - James Sweitzer

You'll Never Walk Alone - Liverpool FC
Reply With Quote
  #2  
Old September 15th, 2007, 04:00 PM
cHiNgY1788's Avatar
cHiNgY1788 cHiNgY1788 is offline
Senior Member
 
Join Date: Sep 2004
O/S: Windows XP Pro
Location: Aussieland
Age: 20
Posts: 4,237
should work
aperture should be a char array or a float
iso needs to be put through a string to int converter
__________________
Starcraft II is coming

AMD Athlon 4000+ @ 2.9GHz
Asus A8NSLI Deluxe
LeadTek nVidia Geforce 9600GT 512MB
2GB DDR400

Its an Alienware

http://www.chingy1788.co.nr/


Last edited by cHiNgY1788; September 15th, 2007 at 04:02 PM.
Reply With Quote
  #3  
Old September 15th, 2007, 04:16 PM
philmetz's Avatar
philmetz philmetz is offline
Senior Member
 
Join Date: Jan 2006
O/S: Windows Vista
Posts: 685
aperture yes will be a char array.
but why should iso be put through the converter? its a int value??
__________________
"As much as we have progressed in science, we are still finite creatures with limited conceptual abilities and imperfect observational tools" - James Sweitzer

You'll Never Walk Alone - Liverpool FC

Last edited by philmetz; September 15th, 2007 at 10:14 PM.
Reply With Quote
  #4  
Old September 15th, 2007, 10:57 PM
philmetz's Avatar
philmetz philmetz is offline
Senior Member
 
Join Date: Jan 2006
O/S: Windows Vista
Posts: 685
my if statement in aperture and ISO.
i dont need an else for that right? if i dont need one i dont need to put one?
thanks
__________________
"As much as we have progressed in science, we are still finite creatures with limited conceptual abilities and imperfect observational tools" - James Sweitzer

You'll Never Walk Alone - Liverpool FC
Reply With Quote
Reply

Bookmarks

Topic Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:54 AM.

[ RSS ]